HDK
|
#include <discoveryPlugin.h>
Public Types | |
using | Context = NdrDiscoveryPluginContext |
Public Types inherited from TfRefBase | |
typedef void(* | UniqueChangedFuncPtr )(TfRefBase const *, bool) |
Public Member Functions | |
NDR_API | NdrDiscoveryPlugin () |
virtual NDR_API | ~NdrDiscoveryPlugin () |
virtual NDR_API NdrNodeDiscoveryResultVec | DiscoverNodes (const Context &)=0 |
virtual NDR_API const NdrStringVec & | GetSearchURIs () const =0 |
Gets the URIs that this plugin is searching for nodes in. More... | |
Public Member Functions inherited from TfRefBase | |
TfRefBase () | |
TfRefBase (TfRefBase const &) | |
TfRefBase & | operator= (TfRefBase const &) |
size_t | GetCurrentCount () const |
Return the current reference count of this object. More... | |
bool | IsUnique () const |
Return true if only one TfRefPtr points to this object. More... | |
void | SetShouldInvokeUniqueChangedListener (bool shouldCall) |
Public Member Functions inherited from TfWeakBase | |
TfWeakBase () | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Additional Inherited Members | |
Static Public Member Functions inherited from TfRefBase | |
static TF_API void | SetUniqueChangedListener (UniqueChangedListener listener) |
Protected Member Functions inherited from TfRefBase | |
virtual TF_API | ~TfRefBase () |
Protected Member Functions inherited from TfWeakBase | |
~TfWeakBase () | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
Interface for discovery plugins.
Discovery plugins, like the name implies, find nodes. Where the plugin searches is up to the plugin that implements this interface. Examples of discovery plugins could include plugins that look for nodes on the filesystem, another that finds nodes in a cloud service, and another that searches a local database. Multiple discovery plugins that search the filesystem in specific locations/ways could also be created. All discovery plugins are executed as soon as the registry is instantiated.
These plugins simply report back to the registry what nodes they found in a generic way. The registry doesn't know much about the innards of the nodes yet, just that the nodes exist. Understanding the nodes is the responsibility of another set of plugins defined by the NdrParserPlugin
interface.
Discovery plugins report back to the registry via NdrNodeDiscoveryResult
s. These are small, lightweight classes that contain the information for a single node that was found during discovery. The discovery result only includes node information that can be gleaned pre-parse, so the data is fairly limited; to see exactly what's included, and what is expected to be populated, see the documentation for NdrNodeDiscoveryResult
.
There are three steps to creating a discovery plugin:
NdrDiscoveryPlugin
In the same folder as your plugin, create a plugInfo.json
file. This file must be formatted like so, substituting YOUR_LIBRARY_NAME
, YOUR_CLASS_NAME
, and YOUR_DISPLAY_NAME
:
The NDR ships with one discovery plugin, the _NdrFilesystemDiscoveryPlugin
. Take a look at NDR's plugInfo.json file for example values for YOUR_LIBRARY_NAME
, YOUR_CLASS_NAME
, and YOUR_DISPLAY_NAME
. If multiple discovery plugins exist in the same folder, you can continue adding additional plugins under the Types
key in the JSON. More detailed information about the plugInfo.json format can be found in the documentation for the plug
library (in pxr/base).
Definition at line 143 of file discoveryPlugin.h.
Definition at line 146 of file discoveryPlugin.h.
NDR_API NdrDiscoveryPlugin::NdrDiscoveryPlugin | ( | ) |
|
virtual |
|
pure virtual |
Finds and returns all nodes that the implementing plugin should be aware of.
Implemented in _NdrFilesystemDiscoveryPlugin, and UsdHydraDiscoveryPlugin.
|
pure virtual |
Gets the URIs that this plugin is searching for nodes in.
Implemented in _NdrFilesystemDiscoveryPlugin, and UsdHydraDiscoveryPlugin.