|
| VtValue () |
| Default ctor gives empty VtValue. More...
|
|
| VtValue (VtValue const &other) |
| Copy construct with other . More...
|
|
| VtValue (VtValue &&other) noexcept |
| Move construct with other . More...
|
|
template<class T > |
| VtValue (T const &obj) |
|
| ~VtValue () |
| Destructor. More...
|
|
VtValue & | operator= (VtValue const &other) |
| Copy assignment from another VtValue. More...
|
|
VtValue & | operator= (VtValue &&other) noexcept |
| Move assignment from another VtValue. More...
|
|
template<class T > |
std::enable_if_t< _TypeInfoFor
< T >::Type::IsLocal
&&_TypeInfoFor< T >
::Type::HasTrivialCopy,
VtValue & > | operator= (T obj) |
|
template<class T > |
std::enable_if_t
< !_TypeInfoFor< T >
::Type::IsLocal||!_TypeInfoFor
< T >::Type::HasTrivialCopy,
VtValue & > | operator= (T const &obj) |
| Assignment operator from any type. More...
|
|
VtValue & | operator= (char const *cstr) |
| Assigning a char const * gives a VtValue holding a std::string. More...
|
|
VtValue & | operator= (char *cstr) |
| Assigning a char * gives a VtValue holding a std::string. More...
|
|
VtValue & | Swap (VtValue &rhs) noexcept |
| Swap this with rhs. More...
|
|
template<class T > |
std::enable_if_t< std::is_same
< T, typename
Vt_ValueGetStored< T >::Type >
::value > | Swap (T &rhs) |
| Swap the held value with rhs. If this value is holding a T,. More...
|
|
template<class T > |
std::enable_if_t< std::is_same
< T, typename
Vt_ValueGetStored< T >::Type >
::value > | UncheckedSwap (T &rhs) |
|
void | UncheckedSwap (VtValue &rhs) |
|
template<class T > |
T | Remove () |
|
template<class T > |
T | UncheckedRemove () |
|
template<class T , class Fn > |
std::enable_if_t< std::is_same
< T, typename
Vt_ValueGetStored< T >::Type >
::value, bool > | Mutate (Fn &&mutateFn) |
|
template<class T , class Fn > |
std::enable_if_t< std::is_same
< T, typename
Vt_ValueGetStored< T >::Type >
::value > | UncheckedMutate (Fn &&mutateFn) |
|
template<class T > |
bool | IsHolding () const |
|
VT_API bool | IsArrayValued () const |
| Returns true iff this is holding an array type (see VtIsArray<>). More...
|
|
size_t | GetArraySize () const |
|
VT_API std::type_info const & | GetTypeid () const |
| Returns the typeid of the type held by this value. More...
|
|
VT_API std::type_info const & | GetElementTypeid () const |
|
VT_API TfType | GetType () const |
| Returns the TfType of the type held by this value. More...
|
|
VT_API std::string | GetTypeName () const |
| Return the type name of the held typeid. More...
|
|
int | GetKnownValueTypeIndex () const |
|
template<class T > |
T const & | UncheckedGet () const & |
|
template<class T > |
T | UncheckedGet ()&& |
|
template<class T > |
T const & | Get () const & |
|
template<class T > |
T | Get ()&& |
|
template<class T > |
T | GetWithDefault (T const &def=T()) const |
|
template<typename T > |
VtValue & | Cast () |
|
VtValue & | CastToTypeOf (VtValue const &other) |
|
VtValue & | CastToTypeid (std::type_info const &type) |
|
template<typename T > |
bool | CanCast () const |
|
bool | CanCastToTypeOf (VtValue const &other) const |
|
bool | CanCastToTypeid (std::type_info const &type) const |
|
bool | IsEmpty () const |
| Returns true iff this value is empty. More...
|
|
VT_API bool | CanHash () const |
| Return true if the held object provides a hash implementation. More...
|
|
VT_API size_t | GetHash () const |
| Return a hash code for the held object by calling VtHashValue() on it. More...
|
|
bool | operator== (const VtValue &rhs) const |
| Test two values for equality. More...
|
|
bool | operator!= (const VtValue &rhs) const |
|
template<> |
VtValue | Get ()&& |
|
template<> |
const VtValue & | UncheckedGet () const & |
|
template<> |
VtValue | UncheckedGet ()&& |
|
template<> |
bool | IsHolding () const |
|
template<> |
bool | IsHolding () const |
|
Provides a container which may hold any type, and provides introspection and iteration over array types. See VtIsArray for more info.
Held-type Conversion with VtValue::Cast
VtValue provides a suite of "Cast" methods that convert or create a VtValue holding a requested type (via template parameter, typeid, or type-matching to another VtValue) from the type of the currently-held value. Clients can add conversions between their own types using the RegisterCast(), RegisterSimpleCast(), and RegisterSimpleBidirectionalCast() methods. Conversions from plugins can be guaranteed to be registered before they are needed by registering them from within a
block.
Builtin Type Conversion
Conversions between most of the basic "value types" that are intrinsically convertible are builtin, including all numeric types (including Gf's half
), std::string/TfToken, GfVec* (for vecs of the same dimension), and VtArray<T> for floating-point POD and GfVec of the preceding.
Numeric Conversion Safety
The conversions between all scalar numeric types are performed with range checks such as provided by hboost::numeric_cast(), and will fail, returning an empty VtValue if the source value is out of range of the destination type.
Conversions between GfVec and other compound-numeric types provide no more or less safety or checking than the conversion constructors of the types themselves. This includes VtArray, even VtArray<T> for T in scalar types that are range-checked when held singly.
Definition at line 164 of file value.h.