DataPtr Class Reference

#include <datatypebase.h>

Inheritance diagram for DataPtr:

Detailed Description

DataPtr contains type info and a pointer to an arbitrary generic non-const object. The type of the object is only known at run-time.

Public Member Functions

 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 ()
 
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
 
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 >::type > Get () 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
 
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 const DataPtrNullValue ()
 
- Static Public Member Functions inherited from ConstDataPtr
static const ConstDataPtrNullValue ()
 

Additional Inherited Members

- Protected Member Functions inherited from ConstDataPtr
template<typename T >
Result< typename ByValueParam< T >::type > GetImpl (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

◆ DataPtr() [1/4]

DataPtr ( )
default

◆ DataPtr() [2/4]

DataPtr ( Data value)
explicit

◆ DataPtr() [3/4]

DataPtr ( const DataType typeInfo,
Generic *  dataPtr 
)

◆ DataPtr() [4/4]

DataPtr ( T &  value)
explicit

Member Function Documentation

◆ PrivateGetPtr()

Generic* PrivateGetPtr ( ) const

◆ GetPtr() [1/4]

Generic* GetPtr ( const DataType type)

◆ GetPtr() [2/4]

T* GetPtr ( )

◆ NullValue()

static const DataPtr& NullValue ( )
static

◆ MoveFrom()

Result<void> MoveFrom ( Data &&  src)

Moves from another Data.

Parameters
[in]srcData to move from.
Returns
OK on success (will fail if this DataPtr has a non-matching type).

◆ CopyFrom()

Result<void> CopyFrom ( const Data src)

Copies from another Data.

Parameters
[in]srcData to copy from.
Returns
OK on success (will fail if this DataPtr has a non-matching type).

◆ GetPtr() [3/4]

const Generic* GetPtr

◆ GetPtr() [4/4]

const T* GetPtr ( typename T  )