24 #ifndef PXR_IMAGING_HF_PLUGIN_REGISTRY_H
25 #define PXR_IMAGING_HF_PLUGIN_REGISTRY_H
141 template<
typename T,
typename PluginBaseType,
typename... Bases>
151 typedef std::vector<Hf_PluginEntry> _PluginEntryVector;
152 typedef std::map<TfToken, size_t> _TokenMap;
159 typedef std::function<HfPluginBase *()> _FactoryFn;
173 _PluginEntryVector _pluginEntries;
174 _TokenMap _pluginIndex;
177 bool _pluginCachePopulated;
180 void _DiscoverPlugins();
183 Hf_PluginEntry *_GetEntryForPlugin(
HfPluginBase *plugin);
188 HfPluginRegistry() =
delete;
189 HfPluginRegistry(
const HfPluginRegistry &) =
delete;
190 HfPluginRegistry &operator=(
const HfPluginRegistry &) =
delete;
195 HfPluginRegistry::_CreatePlugin()
202 template<
typename T,
typename PluginBaseType,
typename... Bases>
209 _FactoryFn
func = &_CreatePlugin<T>;
210 _SetFactory(type, func);
217 #endif //PXR_IMAGING_HF_PLUGIN_REGISTRY_H
HF_API TfToken GetPluginId(const HfPluginBase *plugin) const
#define HF_MALLOC_TAG_FUNCTION()
virtual HF_API void _CollectAdditionalMetadata(const PlugRegistry &plugRegistry, const TfType &pluginType)
HF_API void ReleasePlugin(HfPluginBase *plugin)
HF_API bool IsRegisteredPlugin(const TfToken &pluginId)
static TfType const & Define()
HF_API bool GetPluginDesc(const TfToken &pluginId, HfPluginDesc *desc)
HF_API void GetPluginDescs(HfPluginDescVector *plugins)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
HF_API HfPluginBase * GetPlugin(const TfToken &pluginId)
#define PXR_NAMESPACE_CLOSE_SCOPE
std::vector< HfPluginDesc > HfPluginDescVector
HF_API void AddPluginReference(HfPluginBase *plugin)
virtual HF_API ~HfPluginRegistry()