Loading...
Searching...
No Matches
UsdPrimDefinition::Property Class Reference

Accessor to a property's definition in the prim definition. More...

#include <primDefinition.h>

+ Inheritance diagram for UsdPrimDefinition::Property:

Public Member Functions

 Property ()=default
 Default constructor returns an invalid property.
 
USD_API const TfTokenGetName () const
 Returns the name of the requested property.
 
 operator bool () const
 Conversion to bool returns true if this represents a valid property in the prim definition, and false otherwise.
 
USD_API bool IsAttribute () const
 Return true if the property is a valid is a valid property in the prim definition and is an attribute.
 
USD_API bool IsRelationship () const
 Return true if the property is a valid is a valid property in the prim definition and is a relationship.
 
Field Access Methods

These methods help get values for fields defined on a property in a prim definition.

None of the data access methods check that the property is valid before trying to access the property. I.e. they all assume the property is already known to be valid when called.

Client code is on the hook for verifying the validity of the Property before calling any of these methods. The validity can be determined by converting the Property to bool.

USD_API SdfSpecType GetSpecType () const
 Returns the spec type of this property in the prim definition.
 
USD_API TfTokenVector ListMetadataFields () const
 Returns the list of names of metadata fields that are defined for this property in the prim definition.
 
template<class T >
bool GetMetadata (const TfToken &key, T *value) const
 Retrieves the fallback value for the metadata field named key, that is defined for this property in the prim definition, and stores it in value if possible.
 
template<class T >
bool GetMetadataByDictKey (const TfToken &key, const TfToken &keyPath, T *value) const
 Retrieves the value at keyPath from the dictionary value for the dictionary metadata field named key, that is defined for this property in the prim definition, and stores it in value if possible.
 
USD_API SdfVariability GetVariability () const
 Returns the variability of this property in the prim definition.
 
USD_API std::string GetDocumentation () const
 Returns the documentation metadata defined by the prim definition for this property.
 

Protected Member Functions

 Property (const TfToken &name, const _LayerAndPath *layerAndPath)
 
 Property (const _LayerAndPath *layerAndPath)
 

Protected Attributes

TfToken _name
 
const _LayerAndPath * _layerAndPath = nullptr
 

Friends

class UsdPrimDefinition
 

Detailed Description

Accessor to a property's definition in the prim definition.

These are returned by calls to UsdPrimDefinition::GetPropertyDefinition and can be used check the existence of a property (via conversion to bool) and get field values that a defined for a property in the prim definition.

This class is just a thin wrapper around the property representation in the UsdPrimDefinition that creates it and cannot be stored or accessed beyond the lifetime of the prim definition itself.

Definition at line 77 of file primDefinition.h.

Constructor & Destructor Documentation

◆ Property() [1/3]

Property ( )
default

Default constructor returns an invalid property.

◆ Property() [2/3]

Property ( const TfToken name,
const _LayerAndPath *  layerAndPath 
)
inlineprotected

Definition at line 163 of file primDefinition.h.

◆ Property() [3/3]

Property ( const _LayerAndPath *  layerAndPath)
inlineprotected

Definition at line 165 of file primDefinition.h.

Member Function Documentation

◆ GetDocumentation()

USD_API std::string GetDocumentation ( ) const

Returns the documentation metadata defined by the prim definition for this property.

◆ GetMetadata()

bool GetMetadata ( const TfToken key,
T *  value 
) const

Retrieves the fallback value for the metadata field named key, that is defined for this property in the prim definition, and stores it in value if possible.

Returns true if a value is defined for the given metadata key for this property. Returns false otherwise.

Definition at line 632 of file primDefinition.h.

◆ GetMetadataByDictKey()

bool GetMetadataByDictKey ( const TfToken key,
const TfToken keyPath,
T *  value 
) const

Retrieves the value at keyPath from the dictionary value for the dictionary metadata field named key, that is defined for this property in the prim definition, and stores it in value if possible.

Returns true if a dictionary value is defined for the given metadata key for this property and it contains a value at keyPath. Returns false otherwise.

Definition at line 642 of file primDefinition.h.

◆ GetName()

USD_API const TfToken & GetName ( ) const

Returns the name of the requested property.

Note that the return value of GetName gives no indication as to whether this is a valid property.

◆ GetSpecType()

USD_API SdfSpecType GetSpecType ( ) const

Returns the spec type of this property in the prim definition.

◆ GetVariability()

USD_API SdfVariability GetVariability ( ) const

Returns the variability of this property in the prim definition.

◆ IsAttribute()

USD_API bool IsAttribute ( ) const

Return true if the property is a valid is a valid property in the prim definition and is an attribute.

◆ IsRelationship()

USD_API bool IsRelationship ( ) const

Return true if the property is a valid is a valid property in the prim definition and is a relationship.

◆ ListMetadataFields()

USD_API TfTokenVector ListMetadataFields ( ) const

Returns the list of names of metadata fields that are defined for this property in the prim definition.


◆ operator bool()

operator bool ( ) const
inlineexplicit

Conversion to bool returns true if this represents a valid property in the prim definition, and false otherwise.

Definition at line 90 of file primDefinition.h.

Friends And Related Function Documentation

◆ UsdPrimDefinition

friend class UsdPrimDefinition
friend

Definition at line 162 of file primDefinition.h.

Member Data Documentation

◆ _layerAndPath

const _LayerAndPath* _layerAndPath = nullptr
protected

Definition at line 169 of file primDefinition.h.

◆ _name

TfToken _name
protected

Definition at line 168 of file primDefinition.h.


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