24#ifndef PXR_USD_IMAGING_USD_IMAGING_ADAPTER_REGISTRY_H
25#define PXR_USD_IMAGING_USD_IMAGING_ADAPTER_REGISTRY_H
30#include "pxr/usdImaging/usdImaging/api.h"
34#include "pxr/base/tf/type.h"
36#include <unordered_map>
38PXR_NAMESPACE_OPEN_SCOPE
42using UsdImagingPrimAdapterSharedPtr = std::shared_ptr<UsdImagingPrimAdapter>;
45using UsdImagingAPISchemaAdapterSharedPtr =
46 std::shared_ptr<UsdImagingAPISchemaAdapter>;
48#define USD_IMAGING_ADAPTER_KEY_TOKENS \
49 ((instanceAdapterKey, "__instanceAdapter")) \
50 ((drawModeAdapterKey, "__drawModeAdapter")) \
54 USD_IMAGING_ADAPTER_KEY_TOKENS);
67 typedef std::unordered_map<TfToken,TfType,TfToken::HashFunctor> _TypeMap;
70 _TypeMap _apiSchemaTypeMap;
73 typedef std::vector<TfType> _TypeVector;
74 _TypeVector _keylessApiSchemaAdapterTypes;
76 template <
typename T,
typename factoryT>
77 std::shared_ptr<T> _ConstructAdapter(
78 TfToken const& adapterKey,
const _TypeMap &tm);
80 template <
typename T,
typename factoryT>
81 std::shared_ptr<T> _ConstructAdapter(
136 using ApiSchemaAdapters = std::vector<UsdImagingAPISchemaAdapterSharedPtr>;
147PXR_NAMESPACE_CLOSE_SCOPE
Manage a single instance of an object (see.
static T & GetInstance()
Return a reference to an object of type T, creating it if necessary.
Token for efficient comparison, assignment, and hashing of known strings.
TfType represents a dynamic runtime type.
Base class for all API schema adapters.
Registry of PrimAdapter plug-ins.
USDIMAGING_API const TfTokenVector & GetAdapterKeys()
Returns the set of adapter keys this class responds to; i.e.
USDIMAGING_API bool HasAPISchemaAdapter(TfToken const &adapterKey)
Returns true if an api schema adapter has been registered to handle the given adapterKey.
static USDIMAGING_API bool AreExternalPluginsEnabled()
Returns true if external plugins are enabled.
USDIMAGING_API UsdImagingAPISchemaAdapterSharedPtr ConstructAPISchemaAdapter(TfToken const &adapterKey)
Returns a new instance of the UsdImagingAPISchemaAdapter that has been registered to handle the given...
USDIMAGING_API const TfTokenVector & GetAPISchemaAdapterKeys()
Returns the set of api schema adapter keys this class responds to; i.e.
USDIMAGING_API UsdImagingPrimAdapterSharedPtr ConstructAdapter(TfToken const &adapterKey)
Returns a new instance of the UsdImagingPrimAdapter that has been registered to handle the given adap...
USDIMAGING_API ApiSchemaAdapters ConstructKeylessAPISchemaAdapters()
Constructs instances of "keyless" api schema adapters which are intended to run for every prim.
USDIMAGING_API bool HasAdapter(TfToken const &adapterKey)
Returns true if an adapter has been registered to handle the given adapterKey.
Base class for all PrimAdapters.
Manage a single instance of an object.
This file defines some macros that are useful for declaring and using static TfTokens.
#define TF_DECLARE_PUBLIC_TOKENS(...)
Macro to define public tokens.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
std::vector< TfToken > TfTokenVector
Convenience types.