Loading...
Searching...
No Matches
UsdProfileRegistry Class Reference

A singleton that manages profile capabilities and their relationships. More...

#include <profileRegistry.h>

+ Inheritance diagram for UsdProfileRegistry:

Classes

struct  CapabilityResult
 Per-capability query result. More...
 

Public Types

enum class  QueryStatus {
  NoPath , ValidPath , Deprecated , DeprecationConflict ,
  Excepted , CycleFound
}
 Result of a predecessor reachability query. More...
 

Static Public Member Functions

static USDPROFILES_API bool HasCapability (const TfToken &capability)
 Test whether capability is known to the registry.
 
static USDPROFILES_API bool IsProfile (const TfToken &capability)
 Return true if capability is tagged as a profile node (i.e., declared with "isProfile": true in plugInfo.json).
 
static USDPROFILES_API VtDictionary GetCapabilityMetadata (const TfToken &capability)
 Return metadata associated with capability as a VtDictionary with keys name, docstring, style, and subgraph.
 
static USDPROFILES_API std::vector< CapabilityResultGetPredecessors (const TfToken &capability)
 Return all direct predecessors (incoming edges) of capability.
 
static USDPROFILES_API std::vector< CapabilityResultGetTransitivePredecessors (const TfToken &capability)
 Return the full transitive closure of all ancestors of capability.
 
static USDPROFILES_API std::pair< TfToken, int > ParseCapabilityVersion (const TfToken &capability)
 Parse the _vN version suffix from a capability token.
 
static USDPROFILES_API TfToken ResolveCapability (const TfToken &capability)
 Return the preferred registered capability for the given token, applying the versioning precedence rules from §6 of the Profiles spec:
 
static USDPROFILES_API QueryStatus HasPredecessor (const TfToken &capabilityA, const TfToken &capabilityB)
 Return whether capabilityA has capabilityB anywhere in its predecessor DAG (i.e., A transitively depends on B).
 
static USDPROFILES_API QueryStatus CoversCapabilities (const TfToken &perspective, const std::vector< TfToken > &required, const std::vector< TfToken > &excepted={}, std::vector< CapabilityResult > *results=nullptr)
 Return whether perspective transitively reaches every capability in required, and with what deprecation status.
 
static USDPROFILES_API std::vector< TfTokenGetAllCapabilities ()
 Return an unordered vector of all capabilities known to the registry.
 
static USDPROFILES_API std::vector< TfTokenGetAllProfiles ()
 Return an unordered vector of all profiles known to the registry.
 
static USDPROFILES_API TfToken GetStyleForCapability (const TfToken &capability)
 Get the style token for a given capability.
 
static USDPROFILES_API TfToken GetSubgraphForCapability (const TfToken &capability)
 Get the subgraph name for a given capability.
 
static USDPROFILES_API std::string GetDocString (const TfToken &capability)
 Get docstring for a given capability.
 
static USDPROFILES_API std::string GetDisplayName (const TfToken &capability)
 Get display name for a given capability.
 
static USDPROFILES_API std::map< TfToken, std::string > GetCapabilityStyles ()
 Get all capability styles.
 
- Static Public Member Functions inherited from TfSingleton< UsdProfileRegistry >
static UsdProfileRegistryGetInstance ()
 Return a reference to an object of type T, creating it if necessary.
 
static bool CurrentlyExists ()
 Return whether or not the single object of type T is currently in existence.
 
static void SetInstanceConstructed (UsdProfileRegistry &instance)
 Indicate that the sole instance object has already been created.
 
static void DeleteInstance ()
 Destroy the sole instance object of type T, if it exists.
 

Friends

class TfSingleton< UsdProfileRegistry >
 

Additional Inherited Members

- Public Member Functions inherited from TfSingleton< UsdProfileRegistry >
void DeleteInstance ()=delete
 

Detailed Description

A singleton that manages profile capabilities and their relationships.

The profile registry collects capability information from plugins and provides methods to query capabilities and their relationships.

UsdProfileRegistry Threadsafety

UsdProfileRegistry serves performance-critical clients that operate under the STL threading model, and therefore itself follows that model in order to avoid locking during queries.

Definition at line 39 of file profileRegistry.h.


Class Documentation

◆ UsdProfileRegistry::CapabilityResult

struct UsdProfileRegistry::CapabilityResult

Per-capability query result.

Definition at line 82 of file profileRegistry.h.

Class Members
TfToken capability
QueryStatus status

Member Enumeration Documentation

◆ QueryStatus

enum class QueryStatus
strong

Result of a predecessor reachability query.

See also
HasPredecessor
Enumerator
NoPath 

No path exists from capability to the candidate.

ValidPath 

A non-deprecated path exists.

Deprecated 

All paths to the candidate pass through at least one deprecated edge.

DeprecationConflict 

Both deprecated and non-deprecated paths exist.

Excepted 

The capability is reachable but was explicitly excluded by the caller via the excepted parameter of CoversCapabilities.

Treated as NoPath for aggregate coverage purposes, but reported distinctly so callers can distinguish "not present" from "present but intentionally excluded".

CycleFound 

A cycle was detected in the graph (indicates malformed data).

Definition at line 46 of file profileRegistry.h.

Member Function Documentation

◆ CoversCapabilities()

static USDPROFILES_API QueryStatus CoversCapabilities ( const TfToken & perspective,
const std::vector< TfToken > & required,
const std::vector< TfToken > & excepted = {},
std::vector< CapabilityResult > * results = nullptr )
static

Return whether perspective transitively reaches every capability in required, and with what deprecation status.

perspective and each token in required are resolved via ResolveCapability before the DAG query, so unversioned names automatically match the highest registered versioned form.

excepted is an optional caller-supplied set of capabilities to exclude from coverage. A required capability whose resolved token appears in excepted is reported with status Excepted rather than its DAG-derived status, and is treated as NoPath for the aggregate. This allows callers to express "profile X is satisfied under these known exclusions" without modifying the registry.

The aggregate QueryStatus precedence is: NoPath > DeprecationConflict > Excepted > Deprecated > ValidPath. CycleFound is treated as NoPath in the aggregate.

If results is non-null it is populated with one entry per required capability. Each entry's capability field holds the resolved token (which may differ from the input if a higher versioned form was found), and status holds that capability's individual QueryStatus. Entries are in the same order as required.

Returns NoPath (with an empty results) if perspective is unknown after resolution, or if required is empty.

See also
HasCapability

◆ GetAllCapabilities()

static USDPROFILES_API std::vector< TfToken > GetAllCapabilities ( )
static

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

◆ GetAllProfiles()

static USDPROFILES_API std::vector< TfToken > GetAllProfiles ( )
static

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

Profiles are capabilities declared with "isProfile": true in plugInfo.json.

◆ GetCapabilityMetadata()

static USDPROFILES_API VtDictionary GetCapabilityMetadata ( const TfToken & capability)
static

Return metadata associated with capability as a VtDictionary with keys name, docstring, style, and subgraph.

Returns an empty dictionary if the capability is unknown.

See also
HasCapability

◆ GetCapabilityStyles()

static USDPROFILES_API std::map< TfToken, std::string > GetCapabilityStyles ( )
static

Get all capability styles.

◆ GetDisplayName()

static USDPROFILES_API std::string GetDisplayName ( const TfToken & capability)
static

Get display name for a given capability.

◆ GetDocString()

static USDPROFILES_API std::string GetDocString ( const TfToken & capability)
static

Get docstring for a given capability.

◆ GetPredecessors()

static USDPROFILES_API std::vector< CapabilityResult > GetPredecessors ( const TfToken & capability)
static

Return all direct predecessors (incoming edges) of capability.

Each entry carries the predecessor token and ValidPath or Deprecated reflecting whether that edge is deprecated. Returns an empty vector if capability is unknown or has no predecessors.

See also
HasCapability

◆ GetStyleForCapability()

static USDPROFILES_API TfToken GetStyleForCapability ( const TfToken & capability)
static

Get the style token for a given capability.

◆ GetSubgraphForCapability()

static USDPROFILES_API TfToken GetSubgraphForCapability ( const TfToken & capability)
static

Get the subgraph name for a given capability.

◆ GetTransitivePredecessors()

static USDPROFILES_API std::vector< CapabilityResult > GetTransitivePredecessors ( const TfToken & capability)
static

Return the full transitive closure of all ancestors of capability.

Each entry carries the ancestor token and the best QueryStatus of any path from capability to that ancestor (ValidPath, Deprecated, or DeprecationConflict). Does not include capability itself. Returns an empty vector if capability is unknown or has no predecessors.

See also
HasCapability

◆ HasCapability()

static USDPROFILES_API bool HasCapability ( const TfToken & capability)
static

Test whether capability is known to the registry.

◆ HasPredecessor()

static USDPROFILES_API QueryStatus HasPredecessor ( const TfToken & capabilityA,
const TfToken & capabilityB )
static

Return whether capabilityA has capabilityB anywhere in its predecessor DAG (i.e., A transitively depends on B).

Both tokens are resolved via ResolveCapability before the DAG query. Returns NoPath if either resolved capability is unknown or if A == B.

See also
HasCapability

◆ IsProfile()

static USDPROFILES_API bool IsProfile ( const TfToken & capability)
static

Return true if capability is tagged as a profile node (i.e., declared with "isProfile": true in plugInfo.json).

Returns false for unknown capabilities.

See also
HasCapability

◆ ParseCapabilityVersion()

static USDPROFILES_API std::pair< TfToken, int > ParseCapabilityVersion ( const TfToken & capability)
static

Parse the _vN version suffix from a capability token.

Returns the base name and integer version, where an unversioned capability (e.g. usd.physics) returns version 0. Examples:

  • usd.physics → {usd.physics, 0}
  • usd.physics_v2 → {usd.physics, 2}
  • yoyo.foo_v10 → {yoyo.foo, 10}

◆ ResolveCapability()

static USDPROFILES_API TfToken ResolveCapability ( const TfToken & capability)
static

Return the preferred registered capability for the given token, applying the versioning precedence rules from §6 of the Profiles spec:

  • A versioned form (_vN) is preferred over the unversioned base name.
  • Among multiple versioned forms, the highest N wins.

If capability is already the preferred form (or no versioned siblings are registered), returns capability unchanged. Returns an empty TfToken if neither capability nor any versioned sibling is registered.

Friends And Related Symbol Documentation

◆ TfSingleton< UsdProfileRegistry >

friend class TfSingleton< UsdProfileRegistry >
friend

Definition at line 195 of file profileRegistry.h.


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