7#ifndef PXR_BASE_PLUG_REGISTRY_H
8#define PXR_BASE_PLUG_REGISTRY_H
11#include "pxr/base/plug/api.h"
16#include "pxr/base/tf/hashset.h"
19#include "pxr/base/tf/type.h"
27PXR_NAMESPACE_OPEN_SCOPE
30class Plug_RegistrationMetadata;
324 typedef std::vector<TfType> TypeVector;
374 template <
class Base>
385 static std::vector<TfType>
404 template <
class Base>
430 const std::string &key)
const;
436 const std::string &key)
const;
448 _RegisterPlugins(
const std::vector<std::string>& pathsToPlugInfo,
449 bool pathsAreOrdered);
451 template <
class ConcurrentVector>
453 void _RegisterPlugin(
const Plug_RegistrationMetadata&,
454 ConcurrentVector *newPlugins);
456 bool _InsertRegisteredPluginPath(
const std::string &path);
462 TfHashSet<std::string, TfHash> _registeredPluginPaths;
469PXR_NAMESPACE_CLOSE_SCOPE
A discriminated union type for JSON values.
Defines an interface to registered plugins.
Defines an interface for registering plugins.
static void GetAllDerivedTypes(std::set< TfType > *result)
Return the set of all types derived (directly or indirectly) from Base.
PLUG_API PlugPluginPtrVector RegisterPlugins(const std::vector< std::string > &pathsToPlugInfo)
Registers all plug-ins discovered in any of pathsToPlugInfo.
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.
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...
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...
PLUG_API PlugPluginPtrVector GetAllPlugins() const
Returns all registered plug-ins.
static PLUG_API std::vector< TfType > GetDirectlyDerivedTypes(TfType base)
Return a vector of types derived directly from base.
static PLUG_API PlugRegistry & GetInstance()
Returns the singleton PlugRegistry instance.
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.
PLUG_API PlugPluginPtr GetPluginWithName(const std::string &name) const
Returns a plugin with the specified library name.
static PLUG_API TfType FindTypeByName(std::string const &typeName)
Retrieve the TfType corresponding to the given name.
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 PlugPluginPtrVector RegisterPlugins(const std::string &pathToPlugInfo)
Registers all plug-ins discovered at pathToPlugInfo.
static PLUG_API void GetAllDerivedTypes(TfType base, std::set< TfType > *result)
Return the set of all types derived (directly or indirectly) from base.
Manage a single instance of an object (see.
TfType represents a dynamic runtime type.
Enable a concrete base class for use with TfWeakPtr.
Standard pointer typedefs.
#define TF_DECLARE_WEAK_PTRS(type)
Define standard weak pointer types.
Manage a single instance of an object.
Pointer storage with deletion detection.