7#ifndef PXR_IMAGING_HF_PLUGIN_REGISTRY_H
8#define PXR_IMAGING_HF_PLUGIN_REGISTRY_H
11#include "pxr/imaging/hf/api.h"
12#include "pxr/imaging/hf/perfLog.h"
13#include "pxr/imaging/hf/pluginDesc.h"
14#include "pxr/base/plug/registry.h"
15#include "pxr/base/tf/type.h"
19PXR_NAMESPACE_OPEN_SCOPE
124 template<
typename T,
typename PluginBaseType,
typename... Bases>
134 typedef std::vector<Hf_PluginEntry> _PluginEntryVector;
135 typedef std::map<TfToken, size_t> _TokenMap;
148 static void _SetFactory(
TfType &type, _FactoryFn &func);
156 _PluginEntryVector _pluginEntries;
157 _TokenMap _pluginIndex;
160 bool _pluginCachePopulated;
163 void _DiscoverPlugins();
166 Hf_PluginEntry *_GetEntryForPlugin(
HfPluginBase *plugin);
178HfPluginRegistry::_CreatePlugin()
180 HF_MALLOC_TAG_FUNCTION();
185template<
typename T,
typename PluginBaseType,
typename... Bases>
192 _FactoryFn func = &_CreatePlugin<T>;
193 _SetFactory(type, func);
198PXR_NAMESPACE_CLOSE_SCOPE
Base class for all hydra plugin classes.
Base class for registering Hydra plugins using the plug mechanism.
HF_API HfPluginRegistry(const TfType &pluginBaseType)
Constructs a Plugin Registry.
HF_API void ReleasePlugin(HfPluginBase *plugin)
Decrement the reference count on the plugin.
static void Define()
Entry point for registering a types implementation.
HF_API void AddPluginReference(HfPluginBase *plugin)
Increment the reference count on an existing plugin.
HF_API bool IsRegisteredPlugin(const TfToken &pluginId)
Returns true if a plugin has been registered for the given id.
HF_API void GetPluginDescs(HfPluginDescVector *plugins)
Returns an ordered list of all registered plugins.
HF_API bool GetPluginDesc(const TfToken &pluginId, HfPluginDesc *desc)
Returns the description for the given plugin id.
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.
HF_API HfPluginBase * GetPlugin(const TfToken &pluginId)
Returns the plugin from the given pluginId.
Defines an interface for registering plugins.
Token for efficient comparison, assignment, and hashing of known strings.
TfType represents a dynamic runtime type.
static TfType const & Define()
Define a TfType with the given C++ type T and C++ base types B.
A type-list of C++ base types.
Common structure used to report registered plugins in one of the plugin registries.