7 #ifndef PXR_BASE_PLUG_PLUGIN_H
8 #define PXR_BASE_PLUG_PLUGIN_H
26 class Plug_RegistrationMetadata;
52 #ifdef PXR_PYTHON_SUPPORT_ENABLED
54 PLUG_API bool IsPythonModule()
const;
55 #endif // PXR_PYTHON_SUPPORT_ENABLED
109 const std::string &
name,
110 const std::string & resourcePath,
115 static PlugPluginPtr _GetPluginForType(
const TfType & type);
118 static void _RegisterAllPlugins();
120 static PlugPluginPtr _GetPluginWithName(
const std::string&
name);
122 static PlugPluginPtrVector _GetAllPlugins();
124 template <
class PluginMap>
126 static std::pair<PlugPluginPtr, bool>
127 _NewPlugin(
const Plug_RegistrationMetadata &metadata,
129 const std::string& pluginCreationPath,
130 PluginMap *allPluginsByNamePtr);
133 static std::pair<PlugPluginPtr, bool>
134 _NewDynamicLibraryPlugin(
const Plug_RegistrationMetadata& metadata);
136 #ifdef PXR_PYTHON_SUPPORT_ENABLED
138 static std::pair<PlugPluginPtr, bool>
139 _NewPythonModulePlugin(
const Plug_RegistrationMetadata& metadata);
140 #endif // PXR_PYTHON_SUPPORT_ENABLED
143 static std::pair<PlugPluginPtr, bool>
144 _NewResourcePlugin(
const Plug_RegistrationMetadata& metadata);
152 void _DeclareTypes();
154 void _DeclareType(
const std::string &
name,
const JsObject &dict);
156 static void _DefineType(
TfType t );
160 bool _LoadWithDependents(_SeenPlugins * seenPlugins);
163 static void _UpdatePluginMaps(
const TfType & baseType );
166 static constexpr
char const *_GetPluginTypeDisplayName(_Type type);
171 std::string _resourcePath;
174 std::atomic<bool> _isLoaded;
187 const std::string&
path,
bool verify =
true);
191 #endif // PXR_BASE_PLUG_PLUGIN_H
PLUG_API JsObject GetMetadataForType(const TfType &type)
Returns the metadata sub-dictionary for a particular type.
std::string const & GetPath() const
Returns the plugin's filesystem path.
GLsizei const GLchar *const * path
std::string const & GetName() const
Returns the plugin's name.
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_PTRS(PlugPlugin)
GLint GLint GLsizei GLint GLenum GLenum type
PLUG_API bool IsResource() const
Returns true if the plugin is resource-only.
GLuint const GLchar * name
std::map< std::string, JsValue > JsObject
PLUG_API JsObject GetDependencies()
Returns the dictionary containing the dependencies for the plugin.
PLUG_API std::string FindPluginResource(const std::string &path, bool verify=true) const
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
PLUG_API std::string PlugFindPluginResource(const PlugPluginPtr &plugin, const std::string &path, bool verify=true)
#define PXR_NAMESPACE_CLOSE_SCOPE
PLUG_API JsObject GetMetadata()
Returns the dictionary containing meta-data for the plugin.
PLUG_API bool IsLoaded() const
PLUG_API std::string MakeResourcePath(const std::string &path) const
PLUG_API bool DeclaresType(const TfType &type, bool includeSubclasses=false) const
std::string const & GetResourcePath() const
Returns the plugin's resources filesystem path.