24 #ifndef PXR_IMAGING_HF_PLUGIN_REGISTRY_H 25 #define PXR_IMAGING_HF_PLUGIN_REGISTRY_H 28 #include "pxr/imaging/hf/api.h" 29 #include "pxr/imaging/hf/perfLog.h" 30 #include "pxr/imaging/hf/pluginDesc.h" 31 #include "pxr/base/plug/registry.h" 32 #include "pxr/base/tf/type.h" 36 PXR_NAMESPACE_OPEN_SCOPE
141 template<
typename T,
typename PluginBaseType,
typename... Bases>
151 typedef std::vector<Hf_PluginEntry> _PluginEntryVector;
152 typedef std::map<TfToken, size_t> _TokenMap;
165 static void _SetFactory(
TfType &type, _FactoryFn &func);
173 _PluginEntryVector _pluginEntries;
174 _TokenMap _pluginIndex;
177 bool _pluginCachePopulated;
180 void _DiscoverPlugins();
183 Hf_PluginEntry *_GetEntryForPlugin(
HfPluginBase *plugin);
195 HfPluginRegistry::_CreatePlugin()
197 HF_MALLOC_TAG_FUNCTION();
202 template<
typename T,
typename PluginBaseType,
typename... Bases>
209 _FactoryFn func = &_CreatePlugin<T>;
210 _SetFactory(type, func);
215 PXR_NAMESPACE_CLOSE_SCOPE
217 #endif //PXR_IMAGING_HF_PLUGIN_REGISTRY_H virtual HF_API void _CollectAdditionalMetadata(const PlugRegistry &plugRegistry, const TfType &pluginType)
Gives subclasses an opportunity to inspect plugInfo-based metadata at the time of discovery.
Base class for registering Hydra plugins using the plug mechanism.
HF_API bool IsRegisteredPlugin(const TfToken &pluginId)
Returns true if a plugin has been registered for the given id.
Defines an interface for registering plugins.
HF_API void ReleasePlugin(HfPluginBase *plugin)
Decrement the reference count on the plugin.
HF_API void GetPluginDescs(HfPluginDescVector *plugins)
Returns an ordered list of all registered plugins.
static void Define()
Entry point for registering a types implementation.
Base class for all hydra plugin classes.
Token for efficient comparison, assignment, and hashing of known strings.
HF_API HfPluginBase * GetPlugin(const TfToken &pluginId)
Returns the plugin from the given pluginId.
HF_API bool GetPluginDesc(const TfToken &pluginId, HfPluginDesc *desc)
Returns the description for the given plugin id.
A type-list of C++ base types.
HF_API void AddPluginReference(HfPluginBase *plugin)
Increment the reference count on an existing plugin.
static TfType const & Define()
Define a TfType with the given C++ type T and C++ base types B.
TfType represents a dynamic runtime type.
Common structure used to report registered plugins in one of the plugin registries.