ConstDataPtr Class Reference

#include <datatypebase.h>

Inheritance diagram for ConstDataPtr:

Detailed Description

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

Classes

class  Wrapper
 
class  Wrapper< T, typename std::enable_if< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY >::type >
 

Public Member Functions

 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_same< T, Data >::value||(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
 
UInt 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) const
 
template<>
Result< void > Get () const
 
template<>
Result< DataGet () const
 

Static Public Member Functions

static const ConstDataPtrNullValue ()
 

Protected Member Functions

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

DataType _typeInfo
 
const Generic * _dataPtr
 

Friends

struct ViewIteratorMember
 
class ContainerViewTypeImpl
 

Constructor & Destructor Documentation

◆ ConstDataPtr() [1/4]

ConstDataPtr ( )
default

◆ ConstDataPtr() [2/4]

ConstDataPtr ( const Data value)
explicit

◆ ConstDataPtr() [3/4]

ConstDataPtr ( const DataType typeInfo,
const Generic *  dataPtr 
)

◆ ConstDataPtr() [4/4]

ConstDataPtr ( const T &  value)
explicit

Member Function Documentation

◆ IsEmpty()

Bool IsEmpty ( ) const

◆ IsPopulated()

Bool IsPopulated ( void  ) const

◆ GetType()

const DataType& GetType ( void  ) const

◆ PrivateGetPtr()

const Generic* PrivateGetPtr ( ) const

◆ Set() [1/4]

void Set ( const DataType typeInfo,
const Generic *  dataPtr 
)

◆ Set() [2/4]

void Set ( const Data value)

◆ Set() [3/4]

void Set ( Data value)

◆ Set() [4/4]

void Set ( Data &&  value)

◆ GetPtr() [1/2]

const Generic* GetPtr ( const DataType type) const

◆ GetPtr() [2/2]

const T* GetPtr ( void  ) const

◆ Get() [1/3]

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

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.

◆ GetOrNull()

ByValueParam<T>::type GetOrNull ( ) const

◆ Get() [2/3]

ByValueParam<T>::type Get ( const T &  defaultValue) const

◆ Compare() [1/2]

COMPARERESULT Compare ( const ConstDataPtr c) const

Compares this object to a ConstDataPtr.

Parameters
[in]cOther object.
Returns
See COMPARERESULT.

◆ Compare() [2/2]

COMPARERESULT Compare ( const Data c) const

Compares this object to a Data.

Parameters
[in]cOther object.
Returns
See COMPARERESULT.

◆ GetHashCode()

UInt GetHashCode ( ) const

Returns the hash code of the data elements. If no hash code could be calculated the value is 0.

◆ operator==()

Bool operator== ( const ConstDataPtr c) const

◆ operator!=()

Bool operator!= ( const ConstDataPtr c) const

◆ operator<()

Bool operator< ( const ConstDataPtr c) const

◆ operator<=()

Bool operator<= ( const ConstDataPtr c) const

◆ operator>()

Bool operator> ( const ConstDataPtr c) const

◆ operator>=()

Bool operator>= ( const ConstDataPtr c) const

◆ NullValue()

static const ConstDataPtr& NullValue ( )
static

◆ ToString()

String ToString ( const FormatStatement formatStatement) const

◆ GetImpl() [1/2]

Result<typename ByValueParam<T>::type> GetImpl ( OverloadRank0  ) const
protected

◆ GetImpl() [2/2]

std::enable_if< GetCollectionKind< T >::value==COLLECTION_KIND::ARRAY, Result< T > >::type GetImpl ( OverloadRank1  ) const
protected

◆ Get() [3/3]

Result<Data> Get ( void  ) const

Friends And Related Function Documentation

◆ ViewIteratorMember

friend struct ViewIteratorMember
friend

◆ ContainerViewTypeImpl

friend class ContainerViewTypeImpl
friend

Member Data Documentation

◆ _typeInfo

DataType _typeInfo
protected

◆ _dataPtr

const Generic* _dataPtr
protected