MoveDataPtr Class Reference

#include <datatypebase.h>

Inheritance diagram for MoveDataPtr:

Detailed Description

MoveDataPtr contains type info and a pointer to an arbitrary generic object. The type of the object is only known at run-time. MoveDataPtr is typically used as parameter type of a generic function which accepts any type of object and moves the object to some other location.

Public Member Functions

 MoveDataPtr ()=default
 
 MoveDataPtr (const DataType &typeInfo, Generic *dataPtr)
 
 MoveDataPtr (Data &&value)
 
template<typename T >
 MoveDataPtr (T &&value)
 
template<typename T >
Result< typename std::conditional< STD_IS_REPLACEMENT(void, T), void, typename std::conditional< STD_IS_REPLACEMENT(same, T, Data), Data, T && >::type >::typeGet ()
 
template<>
Result< DataGet ()
 
template<typename T >
Result< typename std::conditional< STD_IS_REPLACEMENT(same, T, Data)||(GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY), T, typename ByValueParam< T >::type >::typeGet () const
 
template<typename T >
ByValueParam< T >::type Get (const T &defaultValue) const
 
template<>
Result< void > Get () const
 
template<>
Result< DataGet () const
 
- Public Member Functions inherited from DataPtr
 DataPtr ()=default
 
 DataPtr (Data &value)
 
 DataPtr (const DataType &typeInfo, Generic *dataPtr)
 
template<typename T >
 DataPtr (T &value)
 
Generic * PrivateGetPtr () const
 
Generic * GetPtr (const DataType &type)
 
template<typename T >
T * GetPtr ()
 
template<typename T >
Result< typename std::conditional< STD_IS_REPLACEMENT(same, T, Data)||(GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY), T, T & >::typeGet ()
 
Result< void > MoveFrom (Data &&src)
 
Result< void > CopyFrom (const Data &src)
 
const Generic * GetPtr (const DataType &type) const
 
template<typename T >
const T * GetPtr () const
 
- Public Member Functions inherited from ConstDataPtr
 ConstDataPtr ()=default
 
 ConstDataPtr (const Data &value)
 
 ConstDataPtr (const DataType &typeInfo, const Generic *dataPtr)
 
template<typename T >
 ConstDataPtr (const T &value)
 
Bool IsEmpty () const
 
Bool IsPopulated () const
 
const DataTypeGetType () const
 
DataType && ResetType ()
 
const Generic * PrivateGetPtr () const
 
void Set (const DataType &typeInfo, const Generic *dataPtr)
 
template<typename T >
void Set (const T &value)
 
void Set (const Data &value)
 
void Set (Data &value)
 
void Set (Data &&value)
 
const Generic * GetPtr (const DataType &type) const
 
template<typename T >
const T * GetPtr () const
 
template<typename T >
Result< typename std::conditional< STD_IS_REPLACEMENT(same, T, Data)||(GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY), T, typename ByValueParam< T >::type >::typeGet () const
 
template<typename T >
ByValueParam< T >::type GetOrNull () const
 
template<typename T >
ByValueParam< T >::type Get (const T &defaultValue) const
 
COMPARERESULT Compare (const ConstDataPtr &c) const
 
COMPARERESULT Compare (const Data &c) const
 
HashInt GetHashCode () const
 
UniqueHash GetUniqueHashCode () const
 
Bool operator== (const ConstDataPtr &c) const
 
Bool operator!= (const ConstDataPtr &c) const
 
Bool operator< (const ConstDataPtr &c) const
 
Bool operator<= (const ConstDataPtr &c) const
 
Bool operator> (const ConstDataPtr &c) const
 
Bool operator>= (const ConstDataPtr &c) const
 
String ToString (const FormatStatement *formatStatement=nullptr) const
 
template<>
Result< void > Get () const
 
template<>
Result< DataGet () const
 

Static Public Member Functions

static MAXON_ATTRIBUTE_FORCE_INLINE const MoveDataPtrNullValue ()
 
- Static Public Member Functions inherited from DataPtr
static MAXON_ATTRIBUTE_FORCE_INLINE const DataPtrNullValue ()
 
- Static Public Member Functions inherited from ConstDataPtr
static MAXON_ATTRIBUTE_FORCE_INLINE const ConstDataPtrNullValue ()
 

Additional Inherited Members

- Protected Member Functions inherited from ConstDataPtr
template<typename T >
Result< typename ByValueParam< T >::typeGetImpl (OverloadRank0) const
 
template<typename T >
std::enable_if< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, Result< T > >::type GetImpl (OverloadRank1) const
 
- Protected Attributes inherited from ConstDataPtr
DataType _typeInfo
 
const Generic * _dataPtr
 

Constructor & Destructor Documentation

◆ MoveDataPtr() [1/4]

MoveDataPtr ( )
default

◆ MoveDataPtr() [2/4]

MoveDataPtr ( const DataType typeInfo,
Generic *  dataPtr 
)

◆ MoveDataPtr() [3/4]

MoveDataPtr ( Data &&  value)
explicit

◆ MoveDataPtr() [4/4]

MoveDataPtr ( T &&  value)
explicit

Member Function Documentation

◆ Get() [1/5]

Result<typename std::conditional<STD_IS_REPLACEMENT(void, T), void, typename std::conditional<STD_IS_REPLACEMENT(same, T, Data), Data, T&&>::type>::type> Get ( void  )

◆ NullValue()

static MAXON_ATTRIBUTE_FORCE_INLINE const MoveDataPtr& NullValue ( )
static

◆ Get() [2/5]

Result<typename std::conditional<STD_IS_REPLACEMENT(same, T, Data) || (GetCollectionKind<T>::value == COLLECTION_KIND::ARRAY), T, typename ByValueParam<T>::type>::type> Get ( typename T  )

Returns the value of type T of this Data. if <void> or <Data> is given the result value is not a reference.

Template Parameters
TThe expected type of the value.
Returns
The value stored in this Data, or an error if this Data doesn't store a value of type T.

◆ Get() [3/5]

ByValueParam<T>::type Get ( typename T  )

◆ Get() [4/5]

Result<void> Get ( void  )

◆ Get() [5/5]

Result<Data> Get ( void  )