This document is for a version of USD that is under development. See this page for the current release.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PlugPlugin Class Reference

Defines an interface to registered plugins. More...

#include <plugin.h>

+ Inheritance diagram for PlugPlugin:

Public Member Functions

PLUG_API bool Load ()
 Loads the plugin.
 
PLUG_API bool IsLoaded () const
 Returns true if the plugin is currently loaded.
 
PLUG_API bool IsPythonModule () const
 Returns true if the plugin is a python module.
 
PLUG_API bool IsResource () const
 Returns true if the plugin is resource-only.
 
PLUG_API JsObject GetMetadata ()
 Returns the dictionary containing meta-data for the plugin.
 
PLUG_API JsObject GetMetadataForType (const TfType &type)
 Returns the metadata sub-dictionary for a particular type.
 
PLUG_API JsObject GetDependencies ()
 Returns the dictionary containing the dependencies for the plugin.
 
PLUG_API bool DeclaresType (const TfType &type, bool includeSubclasses=false) const
 Returns true if type is declared by this plugin.
 
std::string const & GetName () const
 Returns the plugin's name.
 
std::string const & GetPath () const
 Returns the plugin's filesystem path.
 
std::string const & GetResourcePath () const
 Returns the plugin's resources filesystem path.
 
PLUG_API std::string MakeResourcePath (const std::string &path) const
 Build a plugin resource path by returning a given absolute path or combining the plugin's resource path with a given relative path.
 
PLUG_API std::string FindPluginResource (const std::string &path, bool verify=true) const
 Find a plugin resource by absolute or relative path optionally verifying that file exists.
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void const * GetUniqueIdentifier () const
 

Friends

class PlugRegistry
 

Additional Inherited Members

- Protected Member Functions inherited from TfWeakBase
TfRefPtr< Tf_Remnant > _Register () const
 
template<class T >
TfRefPtr< Tf_Remnant > _Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Detailed Description

Defines an interface to registered plugins.

Plugins are registered using the interfaces in PlugRegistry.

For each registered plugin, there is an instance of PlugPlugin which can be used to load and unload the plugin and to retrieve information about the classes implemented by the plugin.

Definition at line 40 of file plugin.h.

Member Function Documentation

◆ DeclaresType()

PLUG_API bool DeclaresType ( const TfType type,
bool  includeSubclasses = false 
) const

Returns true if type is declared by this plugin.

If includeSubclasses is specified, also returns true if any subclasses of type have been declared.

◆ FindPluginResource()

PLUG_API std::string FindPluginResource ( const std::string &  path,
bool  verify = true 
) const

Find a plugin resource by absolute or relative path optionally verifying that file exists.

If verification fails an empty path is returned. Relative paths are relative to the plugin's resource path.

◆ GetDependencies()

PLUG_API JsObject GetDependencies ( )

Returns the dictionary containing the dependencies for the plugin.

◆ GetMetadata()

PLUG_API JsObject GetMetadata ( )

Returns the dictionary containing meta-data for the plugin.

◆ GetMetadataForType()

PLUG_API JsObject GetMetadataForType ( const TfType type)

Returns the metadata sub-dictionary for a particular type.

◆ GetName()

std::string const & GetName ( ) const
inline

Returns the plugin's name.

Definition at line 75 of file plugin.h.

◆ GetPath()

std::string const & GetPath ( ) const
inline

Returns the plugin's filesystem path.

Definition at line 80 of file plugin.h.

◆ GetResourcePath()

std::string const & GetResourcePath ( ) const
inline

Returns the plugin's resources filesystem path.

Definition at line 85 of file plugin.h.

◆ IsLoaded()

PLUG_API bool IsLoaded ( ) const

Returns true if the plugin is currently loaded.

Resource plugins always report as loaded.

◆ IsPythonModule()

PLUG_API bool IsPythonModule ( ) const

Returns true if the plugin is a python module.

◆ IsResource()

PLUG_API bool IsResource ( ) const

Returns true if the plugin is resource-only.

◆ Load()

PLUG_API bool Load ( )

Loads the plugin.

This is a noop if the plugin is already loaded.

◆ MakeResourcePath()

PLUG_API std::string MakeResourcePath ( const std::string &  path) const

Build a plugin resource path by returning a given absolute path or combining the plugin's resource path with a given relative path.

Friends And Related Function Documentation

◆ PlugRegistry

friend class PlugRegistry
friend

Definition at line 177 of file plugin.h.


The documentation for this class was generated from the following file: