24 #ifndef PXR_BASE_PLUG_REGISTRY_H 25 #define PXR_BASE_PLUG_REGISTRY_H 28 #include "pxr/base/plug/api.h" 33 #include "pxr/base/tf/hashset.h" 36 #include "pxr/base/tf/type.h" 44 PXR_NAMESPACE_OPEN_SCOPE
47 class Plug_RegistrationMetadata;
341 typedef std::vector<TfType> TypeVector;
350 PlugPluginPtrVector
RegisterPlugins(
const std::string & pathToPlugInfo);
391 template <
class Base>
402 static std::vector<TfType>
421 template <
class Base>
447 const std::string &key)
const;
453 const std::string &key)
const;
465 _RegisterPlugins(
const std::vector<std::string>& pathsToPlugInfo,
466 bool pathsAreOrdered);
468 template <
class ConcurrentVector>
470 void _RegisterPlugin(
const Plug_RegistrationMetadata&,
471 ConcurrentVector *newPlugins);
473 bool _InsertRegisteredPluginPath(
const std::string &path);
479 TfHashSet<std::string, TfHash> _registeredPluginPaths;
486 PXR_NAMESPACE_CLOSE_SCOPE
488 #endif // PXR_BASE_PLUG_REGISTRY_H static PLUG_API TfType FindTypeByName(std::string const &typeName)
Retrieve the TfType corresponding to the given name.
PLUG_API std::string GetStringFromPluginMetaData(TfType type, const std::string &key) const
Looks for a string associated with type and key and returns it, or an empty string if type or key are...
Manage a single instance of an object.
static void GetAllDerivedTypes(std::set< TfType > *result)
Return the set of all types derived (directly or indirectly) from Base.
Manage a single instance of an object (see.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Standard pointer typedefs.
PLUG_API PlugPluginPtr GetPluginWithName(const std::string &name) const
Returns a plugin with the specified library name.
Defines an interface for registering plugins.
static PLUG_API std::vector< TfType > GetDirectlyDerivedTypes(TfType base)
Return a vector of types derived directly from base.
Pointer storage with deletion detection.
static TfType FindDerivedTypeByName(std::string const &typeName)
Retrieve the TfType that derives from Base and has the given alias or type name typeName.
PLUG_API PlugPluginPtr GetPluginForType(TfType t) const
Returns the plug-in for the given type, or a null pointer if there is no registered plug-in.
A discriminated union type for JSON values.
PLUG_API PlugPluginPtrVector RegisterPlugins(const std::string &pathToPlugInfo)
Registers all plug-ins discovered at pathToPlugInfo.
static PLUG_API PlugRegistry & GetInstance()
Returns the singleton PlugRegistry instance.
PLUG_API JsValue GetDataFromPluginMetaData(TfType type, const std::string &key) const
Looks for a JsValue associated with type and key and returns it, or a null JsValue if type or key are...
Defines an interface to registered plugins.
static PLUG_API void GetAllDerivedTypes(TfType base, std::set< TfType > *result)
Return the set of all types derived (directly or indirectly) from base.
static PLUG_API TfType FindDerivedTypeByName(TfType base, std::string const &typeName)
Retrieve the TfType that derives from base and has the given alias or type name typeName.
TfType represents a dynamic runtime type.
PLUG_API PlugPluginPtrVector GetAllPlugins() const
Returns all registered plug-ins.
Enable a concrete base class for use with TfWeakPtr.