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"
36PXR_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);
195HfPluginRegistry::_CreatePlugin()
197 HF_MALLOC_TAG_FUNCTION();
202template<
typename T,
typename PluginBaseType,
typename... Bases>
209 _FactoryFn func = &_CreatePlugin<T>;
210 _SetFactory(type, func);
215PXR_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.