usdrt::SdfValueTypeName

Defined in usdrt/scenegraph/usd/sdf/valueTypeName.h

Functions

class SdfValueTypeName

Represents a value type name, i.e. an attribute’s type name. This class fairly simply wraps omni::fabric::Type which has an omni::fabric::BaseDataType and an optional omni::fabric::AttributeRole, along with additional metadata.

SdfValueTypeNames defined in sdf/types.h provides an accessor to all valid SdfValueTypeNames (i.e. Fabric types) Usage Example:

SdfValueTypeName bool_type = SdfValueTypeNames->Bool;
SdfValueTypeName float_type = SdfValueTypeNames->Float;

Public Functions

inline SdfValueTypeName()

Constructs an invalid type name. Uses omni::fabric::BaseDataType::eUnknown.

inline SdfValueTypeName(const Type &type)

Constructs a type name from the omni::fabric::Type.

Parameters

type – Fabric type

inline SdfValueTypeName(BaseDataType baseType, uint8_t componentCount = 1, uint8_t arrayDepth = 0, AttributeRole role = AttributeRole::eNone)

Constructs a type name. See omni::fabric::Type constructor.

Parameters
  • baseType – Base data type. omni::fabric::BaseDataType

  • componentCount – Number of components in the full type. Default 1.

  • arrayDepth – Number of array levels the type contains. Default 0.

  • role – Fabric attribute role. Default omni::fabric::AttributeRole::eNone

inline operator omni::fabric::TypeC() const

Get the TypeC representation of this value type name.

Returns

Return integer key that identifies this types.

inline omni::fabric::TypeC GetAsTypeC() const

Get the TypeC representation of this value type name.

Returns

Return integer key that identifies this types.

inline TfToken GetAsToken() const

Returns the type name as a token. This should not be used for comparison purposes.

inline std::string GetAsString() const

Returns the type name as a string.

inline bool operator==(const SdfValueTypeName &rhs) const

Returns true if this type name is equal to rhs. Aliases compare equal.

inline bool operator!=(const SdfValueTypeName &rhs) const

Returns true if this type name is not equal to rhs.

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

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

inline bool IsScalar() const

Returns true iff this type is a scalar. The invalid type is considered neither scalar nor array.

inline bool IsArray() const

Returns true iff this type is an array. The invalid type is considered neither scalar nor array.