|
HDK
|
#include <valueRef.h>
Inheritance diagram for VtMutableValueRef:Public Member Functions | |
| VtMutableValueRef ()=default | |
| Default ctor gives empty VtMutableValueRef. More... | |
| template<class T > | |
| VtMutableValueRef (T &obj) | |
| template<class T > | |
| VtMutableValueRef & | operator= (T &&obj) |
| Assign to the viewed value. More... | |
| template<class T > | |
| VtMutableValueRef & | UncheckedAssign (T &&obj) |
| template<class T > | |
| void | Swap (T &rhs) |
| template<class T > | |
| void | UncheckedSwap (T &rhs) |
| template<class T , class Fn > | |
| bool | Mutate (Fn &&mutateFn) |
| template<class T , class Fn > | |
| void | UncheckedMutate (Fn &&mutateFn) |
Public Member Functions inherited from VtValueRef | |
| VtValueRef () | |
| Default ctor gives empty VtValueRef. More... | |
| VtValueRef (VtValueRef const &)=default | |
| VtValueRef (VtValueRef &&)=default | |
| template<class T > | |
| VtValueRef (T &&obj, std::enable_if_t< !std::is_same_v< std::decay_t< T >, VtValueRef > &&!std::is_same_v< std::decay_t< T >, VtValue >> *=0) | |
| VtValueRef & | operator= (VtValueRef const &ref)=default |
| Rebind to view the same object as another VtValueRef. More... | |
| VtValueRef & | operator= (VtValueRef &&ref)=default |
| template<class T > | |
| VtValueRef & | operator= (T &&)=delete |
| template<class T > | |
| bool | IsHolding () const |
| bool | IsRValue () const |
| VT_API bool | IsArrayValued () const |
| Return true if this views a VtArray instance, false otherwise. More... | |
| VT_API bool | IsArrayEditValued () const |
| Return true if this views a VtArrayEdit instance, false otherwise. More... | |
| size_t | GetArraySize () const |
| std::type_info const & | GetTypeid () const |
| Return the typeid of the type viewed by this value. More... | |
| std::type_info const & | GetElementTypeid () const |
| VT_API TfType | GetType () const |
| Returns the TfType of the type viewed by this value. More... | |
| VT_API std::string | GetTypeName () const |
| Return the type name of the viewed typeid. More... | |
| int | GetKnownValueTypeIndex () const |
| template<class T > | |
| _TypeInfoFor< T >::GetObjResultType | UncheckedGet () const |
| template<class T > | |
| _TypeInfoFor< T >::GetObjResultType | Get () const |
| template<class T > | |
| T | GetWithDefault (T const &def=T()) const |
| template<class T > | |
| T | Remove () |
| template<class T > | |
| T | UncheckedRemove () |
| bool | IsEmpty () const |
| Returns true iff this value is empty. More... | |
| VT_API | operator VtValue () const |
| Implicitly convert to a VtValue by copying the viewed object. More... | |
| VT_API bool | CanHash () const |
| Return true if the viewed object provides a hash implementation. More... | |
| VT_API size_t | GetHash () const |
| Return a hash code for the viewed object by calling VtHashValue() on it. More... | |
| bool | CanComposeOver () const |
| bool | CanTransform () const |
| bool | operator== (const VtValueRef &rhs) const |
| Test two values for equality. More... | |
| bool | operator!= (const VtValueRef &rhs) const |
| template<> | |
| VtValueRef const & | Get () const |
| template<> | |
| VtValueRef const & | UncheckedGet () const |
| template<> | |
| bool | IsHolding () const |
| template<> | |
| bool | IsHolding () const |
Additional Inherited Members | |
Protected Types inherited from VtValueRef | |
| template<class T > | |
| using | _ArrayHelper = TfConditionalType< VtIsArray< T >::value, _IsArrayHelper< T >, TfConditionalType< VtIsArrayEdit< T >::value, _IsArrayEditHelper< T >, _NonArrayHelper< T >> > |
| template<class T > | |
| using | _TypeInfoFor = _TypeInfoImpl< std::decay_t< T >, std::is_reference_v< T > &&std::is_const_v< T >> |
Protected Member Functions inherited from VtValueRef | |
| VT_API size_t | _GetNumElements () const |
| template<class T > | |
| bool | _TypeIs () const |
| template<class T > | |
| _TypeInfoFor< T > ::GetMutableObjResultType | _GetMutable () |
| template<class T > | |
| _TypeInfoFor< T >::GetObjResultType | _Get () const |
| VT_API void const * | _FailGet (Vt_DefaultValueHolder(*factory)(), std::type_info const &queryType) const |
| VT_API void | _FailRemove (std::type_info const &) |
| VT_API TfPyObjWrapper | _GetPythonObject () const |
Protected Attributes inherited from VtValueRef | |
| _RefdObjPtr | _ptr |
| _TypeInfo const * | _info |
A non-owning type-erased view of a mutable lvalue, interoperating with VtValue. Since VtMutableValueRef is non-owning it must not persist beyond the lifetime of the value it views, and so it is typically best used as a function argument or an automatic variable.
Ordinary typed values are implicitly convertible to VtMutableValueRef. This makes it convenient to use when writing a function that can take an object of any type. Since it's non-owning, it is relatively light-weight, incurring no heap allocations or reference counting operations.
Definition at line 661 of file valueRef.h.
|
default |
Default ctor gives empty VtMutableValueRef.
|
inline |
Definition at line 668 of file valueRef.h.
|
inline |
If this value holds an object of type T, invoke mutateFn, passing it a non-const reference to the viewed object and return true. Otherwise do nothing and return false.
Definition at line 731 of file valueRef.h.
|
inline |
Assign to the viewed value.
Definition at line 672 of file valueRef.h.
Swap the viewed value with rhs. If this value is holding a T, make an unqualified call to swap(<viewed-value>, rhs). If this value is not holding a T, replace the viewed value with a value-initialized T instance first, then swap.
Definition at line 700 of file valueRef.h.
|
inline |
Definition at line 686 of file valueRef.h.
|
inline |
Invoke mutateFn, passing it a non-const reference to the viewed object which must be of type T. If the viewed object is not of type T, this function invokes undefined behavior.
Definition at line 746 of file valueRef.h.
Swap the viewed value with rhs. This VtValue must be holding an object of type T. If it does not, this invokes undefined behavior. Use Swap() if this VtValue is not known to contain an object of type T.
Definition at line 718 of file valueRef.h.