All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KindRegistry Class Reference

#include <registry.h>

+ Inheritance diagram for KindRegistry:

Static Public Member Functions

static KIND_API KindRegistryGetInstance ()
 Return the single KindRegistry instance. More...
static KIND_API bool HasKind (const TfToken &kind)
 Test whether kind is known to the registry. More...
static KIND_API TfToken GetBaseKind (const TfToken &kind)
static KIND_API bool IsA (const TfToken &derivedKind, const TfToken &baseKind)
static KIND_API std::vector
< TfToken
GetAllKinds ()
 Return an unordered vector of all kinds known to the registry. More...


class TfSingleton< KindRegistry >

Additional Inherited Members

- Public Member Functions inherited from TfWeakBase
 TfWeakBase ()
 TfWeakBase (const TfWeakBase &)
const TfWeakBase__GetTfWeakBase__ () const
const TfWeakBaseoperator= (const TfWeakBase &)
void EnableNotification2 () const
TF_API void constGetUniqueIdentifier () const
- 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

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

Definition at line 71 of file registry.h.

Member Function Documentation

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

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

static KIND_API TfToken KindRegistry::GetBaseKind ( const TfToken kind)

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.

static KIND_API KindRegistry& KindRegistry::GetInstance ( )

Return the single KindRegistry instance.

static KIND_API bool KindRegistry::HasKind ( const TfToken kind)

Test whether kind is known to the registry.

static KIND_API bool KindRegistry::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).

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.

Friends And Related Function Documentation

friend class TfSingleton< KindRegistry >

Definition at line 100 of file registry.h.

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