Loading...
Searching...
No Matches
SdfValueTypeName Class Reference

Represents a value type name, i.e. More...

#include <valueTypeName.h>

Public Member Functions

SDF_API SdfValueTypeName ()
 Constructs an invalid type name.
 
SDF_API TfToken GetAsToken () const
 Returns the type name as a token.
 
SDF_API const TfTypeGetType () const
 Returns the TfType of the type.
 
SDF_API const std::string & GetCPPTypeName () const
 Returns the C++ type name for this type.
 
SDF_API const TfTokenGetRole () const
 Returns the type's role.
 
SDF_API const VtValueGetDefaultValue () const
 Returns the default value for the type.
 
SDF_API const TfEnumGetDefaultUnit () const
 Returns the default unit enum for the type.
 
SDF_API SdfValueTypeName GetScalarType () const
 Returns the scalar version of this type name if it's an array type name, otherwise returns this type name.
 
SDF_API SdfValueTypeName GetArrayType () const
 Returns the array version of this type name if it's an scalar type name, otherwise returns this type name.
 
SDF_API bool IsScalar () const
 Returns true iff this type is a scalar.
 
SDF_API bool IsArray () const
 Returns true iff this type is an array.
 
SDF_API SdfTupleDimensions GetDimensions () const
 Returns the dimensions of the scalar value, e.g. 3 for a 3D point.
 
SDF_API bool operator== (const SdfValueTypeName &rhs) const
 Returns true if this type name is equal to rhs.
 
bool operator!= (const SdfValueTypeName &rhs) const
 
SDF_API bool operator== (const std::string &rhs) const
 Returns true if this type name is equal to rhs.
 
bool operator!= (const std::string &rhs) const
 
SDF_API bool operator== (const TfToken &rhs) const
 Returns true if this type name is equal to rhs.
 
bool operator!= (const TfToken &rhs) const
 
SDF_API size_t GetHash () const
 Returns a hash value for this type name.
 
 operator bool () const
 Explicit bool conversion operator.
 
SDF_API std::vector< TfTokenGetAliasesAsTokens () const
 Returns all aliases of the type name as tokens.
 

Friends

bool operator== (const std::string &lhs, const SdfValueTypeName &rhs)
 
bool operator!= (const std::string &lhs, const SdfValueTypeName &rhs)
 
bool operator== (const TfToken &lhs, const SdfValueTypeName &rhs)
 
bool operator!= (const TfToken &lhs, const SdfValueTypeName &rhs)
 

Detailed Description

Represents a value type name, i.e.

an attribute's type name. Usually, a value type name associates a string with a TfType and an optional role, along with additional metadata. A schema registers all known value type names and may register multiple names for the same TfType and role pair. All name strings for a given pair are collectively called its aliases.

A value type name may also represent just a name string, without a TfType, role or other metadata. This is currently used exclusively to unserialize and re-serialize an attribute's type name where that name is not known to the schema.

Because value type names can have aliases and those aliases may change in the future, clients should avoid using the value type name's string representation except to report human readable messages and when serializing. Clients can look up a value type name by string using SdfSchemaBase::FindType() and shouldn't otherwise need the string. Aliases compare equal, even if registered by different schemas.

Definition at line 87 of file valueTypeName.h.

Constructor & Destructor Documentation

◆ SdfValueTypeName()

SDF_API SdfValueTypeName ( )

Constructs an invalid type name.

Member Function Documentation

◆ GetAliasesAsTokens()

SDF_API std::vector< TfToken > GetAliasesAsTokens ( ) const

Returns all aliases of the type name as tokens.

These should not be used for comparison purposes.

◆ GetArrayType()

SDF_API SdfValueTypeName GetArrayType ( ) const

Returns the array version of this type name if it's an scalar type name, otherwise returns this type name.

If there is no array type name then this returns the invalid type name.

◆ GetAsToken()

SDF_API TfToken GetAsToken ( ) const

Returns the type name as a token.

This should not be used for comparison purposes.

◆ GetCPPTypeName()

SDF_API const std::string & GetCPPTypeName ( ) const

Returns the C++ type name for this type.

This may not be the same as the type name returned by GetType().GetTypeName(), since that method may have had additional transformations applied for readability.

◆ GetDefaultUnit()

SDF_API const TfEnum & GetDefaultUnit ( ) const

Returns the default unit enum for the type.

◆ GetDefaultValue()

SDF_API const VtValue & GetDefaultValue ( ) const

Returns the default value for the type.

◆ GetDimensions()

SDF_API SdfTupleDimensions GetDimensions ( ) const

Returns the dimensions of the scalar value, e.g. 3 for a 3D point.

◆ GetHash()

SDF_API size_t GetHash ( ) const

Returns a hash value for this type name.

◆ GetRole()

SDF_API const TfToken & GetRole ( ) const

Returns the type's role.

◆ GetScalarType()

SDF_API SdfValueTypeName GetScalarType ( ) const

Returns the scalar version of this type name if it's an array type name, otherwise returns this type name.

If there is no scalar type name then this returns the invalid type name.

◆ GetType()

SDF_API const TfType & GetType ( ) const

Returns the TfType of the type.

◆ IsArray()

SDF_API bool IsArray ( ) const

Returns true iff this type is an array.

The invalid type is considered neither scalar nor array.

◆ IsScalar()

SDF_API bool IsScalar ( ) const

Returns true iff this type is a scalar.

The invalid type is considered neither scalar nor array.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Explicit bool conversion operator.

Converts to true if this is a valid, non-empty type, false otherwise.

Definition at line 196 of file valueTypeName.h.

◆ operator!=() [1/3]

bool operator!= ( const SdfValueTypeName rhs) const
inline

Definition at line 152 of file valueTypeName.h.

◆ operator!=() [2/3]

bool operator!= ( const std::string &  rhs) const
inline

Definition at line 160 of file valueTypeName.h.

◆ operator!=() [3/3]

bool operator!= ( const TfToken rhs) const
inline

Definition at line 168 of file valueTypeName.h.

◆ operator==() [1/3]

SDF_API bool operator== ( const SdfValueTypeName rhs) const

Returns true if this type name is equal to rhs.

Aliases compare equal.

◆ operator==() [2/3]

SDF_API bool operator== ( const std::string &  rhs) const

Returns true if this type name is equal to rhs.

Aliases compare equal. Avoid relying on this overload.

◆ operator==() [3/3]

SDF_API bool operator== ( const TfToken rhs) const

Returns true if this type name is equal to rhs.

Aliases compare equal. Avoid relying on this overload.

Friends And Related Function Documentation

◆ operator!= [1/2]

bool operator!= ( const std::string &  lhs,
const SdfValueTypeName rhs 
)
friend

Definition at line 177 of file valueTypeName.h.

◆ operator!= [2/2]

bool operator!= ( const TfToken lhs,
const SdfValueTypeName rhs 
)
friend

Definition at line 186 of file valueTypeName.h.

◆ operator== [1/2]

bool operator== ( const std::string &  lhs,
const SdfValueTypeName rhs 
)
friend

Definition at line 173 of file valueTypeName.h.

◆ operator== [2/2]

bool operator== ( const TfToken lhs,
const SdfValueTypeName rhs 
)
friend

Definition at line 182 of file valueTypeName.h.


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