![]() |
|
Base class for registering Hydra plugins using the plug mechanism. More...
Inherited by HdGpGenerativeProceduralPluginRegistry, HdRendererPluginRegistry, and HdSceneIndexPluginRegistry.
Public Member Functions | |
HF_API void | GetPluginDescs (HfPluginDescVector *plugins) |
Returns an ordered list of all registered plugins. More... | |
HF_API bool | GetPluginDesc (const TfToken &pluginId, HfPluginDesc *desc) |
Returns the description for the given plugin id. More... | |
HF_API void | AddPluginReference (HfPluginBase *plugin) |
Increment the reference count on an existing plugin. More... | |
HF_API void | ReleasePlugin (HfPluginBase *plugin) |
Decrement the reference count on the plugin. More... | |
HF_API bool | IsRegisteredPlugin (const TfToken &pluginId) |
Returns true if a plugin has been registered for the given id. More... | |
HF_API TfToken | GetPluginId (const HfPluginBase *plugin) const |
Protected Member Functions | |
HF_API | HfPluginRegistry (const TfType &pluginBaseType) |
Constructs a Plugin Registry. More... | |
HF_API HfPluginBase * | GetPlugin (const TfToken &pluginId) |
Returns the plugin from the given pluginId. More... | |
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. More... | |
Static Protected Member Functions | |
template<typename T , typename PluginBaseType , typename... Bases> | |
static void | Define () |
Entry point for registering a types implementation. More... | |
Base class for registering Hydra plugins using the plug mechanism.
It is expected that each plugin has a pluginfo.json file that contains a list of types, where each type provides a list of base classes, displayName and priority.
The priority is used to order plugins, with the plugin with the highest priority being at the front of the order. priority is a signed integer. In the event of two plugins having the same priority, the plugins are sorted alphabetically on the type name.
The plugin sorted to the front is used as the default plugin, when not specified.
Example:
{ "Types": { "CPPTypeName": { "bases": ["BaseTypeName"], "displayName": "Human Readable Name", "priority" : 0 } } }
Definition at line 71 of file pluginRegistry.h.
|
protected |
Constructs a Plugin Registry.
pluginBaseType is the TfType of the class derived from HfPluginBase that provides the plugin API.
|
protectedvirtual |
Gives subclasses an opportunity to inspect plugInfo-based metadata at the time of discovery.
HF_API void AddPluginReference | ( | HfPluginBase * | plugin | ) |
Increment the reference count on an existing plugin.
|
staticprotected |
Entry point for registering a types implementation.
T is the plugin being registered. PluginBaseType is the HfPluginBase derived class that specifies the API (the same one the TfType is for in the constructor).
Bases optionally specifies other classes that T is derived from.
Definition at line 204 of file pluginRegistry.h.
|
protected |
Returns the plugin from the given pluginId.
The reference count on the plugin is automatically increased.
HF_API bool GetPluginDesc | ( | const TfToken & | pluginId, |
HfPluginDesc * | desc | ||
) |
Returns the description for the given plugin id.
The plugin may not be loaded or been actually created yet.
HF_API void GetPluginDescs | ( | HfPluginDescVector * | plugins | ) |
Returns an ordered list of all registered plugins.
The plugins are ordered by priority then alphabetically
HF_API bool IsRegisteredPlugin | ( | const TfToken & | pluginId | ) |
Returns true if a plugin has been registered for the given id.
The plugin may not be loaded or been actually created yet.
HF_API void ReleasePlugin | ( | HfPluginBase * | plugin | ) |
Decrement the reference count on the plugin.
If the reference count get to 0, the plugin is freed.