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
KindRegistry Class Reference

A singleton that holds known kinds and information about them. More...

#include <registry.h>

+ Inheritance diagram for KindRegistry:

Static Public Member Functions

static KIND_API KindRegistryGetInstance ()
 Return the single KindRegistry instance.
 
static KIND_API bool HasKind (const TfToken &kind)
 Test whether kind is known to the registry.
 
static KIND_API TfToken GetBaseKind (const TfToken &kind)
 Return the base kind of the given kind.
 
static KIND_API bool IsA (const TfToken &derivedKind, const TfToken &baseKind)
 Test whether derivedKind is the same as baseKind or has it as a base kind (either directly or indirectly).
 
static KIND_API std::vector< TfTokenGetAllKinds ()
 Return an unordered vector of all kinds known to the registry.
 
static KIND_API bool IsModel (const TfToken &kind)
 Returns true if kind IsA model kind.
 
static KIND_API bool IsGroup (const TfToken &kind)
 Returns true if kind IsA group kind.
 
static KIND_API bool IsAssembly (const TfToken &kind)
 Return true if kind IsA assembly kind.
 
static KIND_API bool IsComponent (const TfToken &kind)
 Returns true if kind IsA component kind.
 
static KIND_API bool IsSubComponent (const TfToken &kind)
 Returns true if kind IsA subcomponent kind.
 

Friends

class TfSingleton< KindRegistry >
 

Additional Inherited Members

- 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
 
- 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

A singleton that holds known kinds and information about them.

See Kind Overview for a description of why kind exists, what the builtin registered kinds are, and how to extend the core kinds.

KindRegistry Threadsafty

KindRegistry serves performance-critical clients that operate under the stl threading model, and therefore itself follows that model in order to avoid locking during HasKind() and IsA() queries.

To make this robust, KindRegistry exposes no means to mutate the registry. All extensions must be accomplished via plugInfo.json files, which are consumed once during the registry initialization (See Extending the KindRegistry )

Definition at line 53 of file registry.h.

Member Function Documentation

◆ GetAllKinds()

static KIND_API std::vector< TfToken > GetAllKinds ( )
static

Return an unordered vector of all kinds known to the registry.

◆ GetBaseKind()

static KIND_API TfToken GetBaseKind ( const TfToken kind)
static

Return the base kind of the given kind.

If there is no base, the result will be an empty token. Issues a coding error if kind is unknown to the registry.

◆ GetInstance()

static KIND_API KindRegistry & GetInstance ( )
static

Return the single KindRegistry instance.

◆ HasKind()

static KIND_API bool HasKind ( const TfToken kind)
static

Test whether kind is known to the registry.

◆ IsA()

static KIND_API bool IsA ( const TfToken derivedKind,
const TfToken baseKind 
)
static

Test whether derivedKind is the same as baseKind or has it as a base kind (either directly or indirectly).

It is not required that derivedKind or baseKind be known to the registry: if they are unknown but equal, IsA will return true; otherwise if either is unknown, we will simply return false.

Therefore this method will not raise any errors.

◆ IsAssembly()

static KIND_API bool IsAssembly ( const TfToken kind)
static

Return true if kind IsA assembly kind.

◆ IsComponent()

static KIND_API bool IsComponent ( const TfToken kind)
static

Returns true if kind IsA component kind.

◆ IsGroup()

static KIND_API bool IsGroup ( const TfToken kind)
static

Returns true if kind IsA group kind.

◆ IsModel()

static KIND_API bool IsModel ( const TfToken kind)
static

Returns true if kind IsA model kind.

◆ IsSubComponent()

static KIND_API bool IsSubComponent ( const TfToken kind)
static

Returns true if kind IsA subcomponent kind.

Friends And Related Function Documentation

◆ TfSingleton< KindRegistry >

friend class TfSingleton< KindRegistry >
friend

Definition at line 96 of file registry.h.


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