Base Framework
Public Types | Public Member Functions | Static Public Member Functions | List of all members
AnyValue Class Reference

Any value. More...

#include <base/AnyValue.h>

Inherits ReferenceCountedObject.

Public Types

enum  Representation {
  VOID, TYPE, POINTER, CHARACTER,
  WIDE_CHARACTER, BOOLEAN, SHORT_INTEGER, UNSIGNED_SHORT_INTEGER,
  INTEGER, UNSIGNED_INTEGER, LONG_INTEGER, UNSIGNED_LONG_INTEGER,
  LONG_LONG_INTEGER, UNSIGNED_LONG_LONG_INTEGER, FLOAT, DOUBLE,
  LONG_DOUBLE, STRING, WIDE_STRING, REFERENCE
}
 

Public Member Functions

 AnyValue () noexcept
 
 AnyValue (const AnyValue &copy) noexcept
 
 AnyValue (AnyValue &&move) noexcept
 
AnyValueoperator= (const AnyValue &assign) noexcept
 
AnyValueoperator= (AnyValue &&assign) noexcept
 
Representation getRepresentation () const noexcept
 
Type getRepresentationType () const noexcept
 
bool isInteger () const noexcept
 
bool isUnsigned () const noexcept
 
bool isFloatingPoint () const noexcept
 
bool isText () const noexcept
 
 AnyValue (NullPtr) noexcept
 
 AnyValue (const Type &value) noexcept
 
 AnyValue (void *value) noexcept
 
 AnyValue (const char *value) noexcept
 
 AnyValue (const wchar *value) noexcept
 
 AnyValue (char value) noexcept
 
 AnyValue (wchar value) noexcept
 
 AnyValue (bool value) noexcept
 
 AnyValue (short value) noexcept
 
 AnyValue (unsigned short value) noexcept
 
 AnyValue (int value) noexcept
 
 AnyValue (unsigned int value) noexcept
 
 AnyValue (long value) noexcept
 
 AnyValue (unsigned long value) noexcept
 
 AnyValue (long long value) noexcept
 
 AnyValue (unsigned long long value) noexcept
 
 AnyValue (float value) noexcept
 
 AnyValue (double value) noexcept
 
 AnyValue (long double value) noexcept
 
 AnyValue (const String &value) noexcept
 
 AnyValue (const Literal &value) noexcept
 
 AnyValue (const WideString &value) noexcept
 
 AnyValue (const WideLiteral &value) noexcept
 
 AnyValue (const AnyReference &value) noexcept
 
AnyValueoperator= (NullPtr) noexcept
 
AnyValueoperator= (const Type &value) noexcept
 
AnyValueoperator= (void *value) noexcept
 
AnyValueoperator= (char value) noexcept
 
AnyValueoperator= (wchar value) noexcept
 
AnyValueoperator= (bool value) noexcept
 
AnyValueoperator= (short value) noexcept
 
AnyValueoperator= (unsigned short value) noexcept
 
AnyValueoperator= (int value) noexcept
 
AnyValueoperator= (unsigned int value) noexcept
 
AnyValueoperator= (long value) noexcept
 
AnyValueoperator= (unsigned long value) noexcept
 
AnyValueoperator= (long long value) noexcept
 
AnyValueoperator= (unsigned long long value) noexcept
 
AnyValueoperator= (float value) noexcept
 
AnyValueoperator= (double value) noexcept
 
AnyValueoperator= (long double value) noexcept
 
AnyValueoperator= (const char *value) noexcept
 
AnyValueoperator= (const wchar *value) noexcept
 
AnyValueoperator= (const String &value) noexcept
 
AnyValueoperator= (const WideString &value) noexcept
 
AnyValueoperator= (const AnyReference &value) noexcept
 
Type getType () const noexcept
 
void * getPointer () const noexcept
 
char getChar () const noexcept
 
wchar getWideChar () const noexcept
 
bool getBoolean () const noexcept
 
short getShortInteger () const noexcept
 
unsigned short getUnsignedShortInteger () const noexcept
 
int getInteger () const noexcept
 
unsigned int getUnsignedInteger () const noexcept
 
long getLongInteger () const noexcept
 
unsigned long getUnsignedLongInteger () const noexcept
 
long long getLongLongInteger () const noexcept
 
unsigned long long getUnsignedLongLongInteger () const noexcept
 
float getFloat () const noexcept
 
double getDouble () const noexcept
 
long double getLongDouble () const noexcept
 
String getString () const noexcept
 
WideString getWideString () const noexcept
 
AnyReference getReference () noexcept
 
void setType (const Type &value) noexcept
 
void setPointer (void *value) noexcept
 
void setChar (char value) noexcept
 
void setWideChar (wchar value) noexcept
 
void setBoolean (bool value) noexcept
 
void setShortInteger (short value) noexcept
 
void setUnsignedShortInteger (unsigned short value) noexcept
 
void setInteger (int value) noexcept
 
void setUnsignedInteger (unsigned int value) noexcept
 
void setLongInteger (long value) noexcept
 
void setUnsignedLongInteger (unsigned long value) noexcept
 
void setLongLongInteger (long long value) noexcept
 
void setUnsignedLongLongInteger (unsigned long long value) noexcept
 
void setString (const String &value) noexcept
 
void setWideString (const WideString &value) noexcept
 
void setReference (const AnyReference &value) noexcept
 
template<typename TYPE >
TYPE getValue () const
 
template<>
void getValue () const
 
template<>
char getValue () const
 
template<>
short getValue () const
 
template<>
unsigned short getValue () const
 
template<>
int getValue () const
 
template<>
unsigned int getValue () const
 
template<>
int64 getValue () const
 
template<>
uint64 getValue () const
 
template<>
float getValue () const
 
template<>
double getValue () const
 
template<>
long double getValue () const
 
template<>
String getValue () const
 
template<>
WideString getValue () const
 
- Public Member Functions inherited from ReferenceCountedObject
 ReferenceCountedObject () noexcept
 
 ReferenceCountedObject (const ReferenceCountedObject &copy) noexcept
 
 ReferenceCountedObject (ReferenceCountedObject &&move) noexcept
 
ReferenceCountedObjectoperator= (const ReferenceCountedObject &copy) noexcept
 
ReferenceCountedObjectoperator= (ReferenceCountedObject &&move) noexcept
 
MemorySize getNumberOfReferences_INTERNAL () const noexcept
 
virtual bool useGarbageCollector () const noexcept
 
- Public Member Functions inherited from DynamicObject
 DynamicObject () noexcept
 
bool isValidObject () const noexcept
 
virtual ~DynamicObject () noexcept(false)
 
 _COM_AZURE_DEV__BASE__OVERRIDE_ALLOC ()
 

Static Public Member Functions

static const char * getTypeAsId (Representation representation)
 

Detailed Description

Any value.

Any value. Containers to commonly used types.

Version
1.0

Member Enumeration Documentation

◆ Representation

The supported types.

Enumerator
VOID 

Void.

TYPE 

Type.

POINTER 

Pointer.

CHARACTER 

Character primitive.

WIDE_CHARACTER 

Wide character primitive.

BOOLEAN 

Boolean primitive.

SHORT_INTEGER 

Short integer primitive.

UNSIGNED_SHORT_INTEGER 

Unsigned short integer primitive.

INTEGER 

Integer primitive.

UNSIGNED_INTEGER 

Unsigned integer primitive.

LONG_INTEGER 

Long integer primitive.

UNSIGNED_LONG_INTEGER 

Unsigned long integer primitive.

LONG_LONG_INTEGER 

Long long integer primitive.

UNSIGNED_LONG_LONG_INTEGER 

Unsigned long long integer primitive.

FLOAT 

Float primitive.

DOUBLE 

Double primitive.

LONG_DOUBLE 

Long double primitive.

STRING 

Sting.

WIDE_STRING 

Wide string.

REFERENCE 

Reference counted object.

Constructor & Destructor Documentation

◆ AnyValue() [1/27]

AnyValue::AnyValue ( )
noexcept

Initializes type as void.

◆ AnyValue() [2/27]

AnyValue::AnyValue ( const AnyValue copy)
noexcept

Initializes value as copy of other value.

◆ AnyValue() [3/27]

AnyValue::AnyValue ( AnyValue &&  move)
noexcept

Initializes value from other value.

◆ AnyValue() [4/27]

AnyValue::AnyValue ( NullPtr  )
noexcept

Initializes value as void pointer.

◆ AnyValue() [5/27]

AnyValue::AnyValue ( const Type value)
noexcept

Initializes value as type.

◆ AnyValue() [6/27]

AnyValue::AnyValue ( void *  value)
noexcept

Initializes value as character.

◆ AnyValue() [7/27]

AnyValue::AnyValue ( const char *  value)
noexcept

Initializes value as string.

◆ AnyValue() [8/27]

AnyValue::AnyValue ( const wchar *  value)
noexcept

Initializes value as wide string.

◆ AnyValue() [9/27]

AnyValue::AnyValue ( char  value)
noexcept

Initializes value as character.

◆ AnyValue() [10/27]

AnyValue::AnyValue ( wchar  value)
noexcept

Initializes value as wide character.

◆ AnyValue() [11/27]

AnyValue::AnyValue ( bool  value)
noexcept

Initializes value as boolean.

◆ AnyValue() [12/27]

AnyValue::AnyValue ( short  value)
noexcept

Initializes value as short integer.

◆ AnyValue() [13/27]

AnyValue::AnyValue ( unsigned short  value)
noexcept

Initializes value as unsigned short integer.

◆ AnyValue() [14/27]

AnyValue::AnyValue ( int  value)
noexcept

Initializes value as integer.

◆ AnyValue() [15/27]

AnyValue::AnyValue ( unsigned int  value)
noexcept

Initializes value as unsigned integer.

◆ AnyValue() [16/27]

AnyValue::AnyValue ( long  value)
noexcept

Initializes value as long integer.

◆ AnyValue() [17/27]

AnyValue::AnyValue ( unsigned long  value)
noexcept

Initializes value as unsigned long integer.

◆ AnyValue() [18/27]

AnyValue::AnyValue ( long long  value)
noexcept

Initializes value as long long integer.

◆ AnyValue() [19/27]

AnyValue::AnyValue ( unsigned long long  value)
noexcept

Initializes value as unsigned long long integer.

◆ AnyValue() [20/27]

AnyValue::AnyValue ( float  value)
noexcept

Initializes value as float.

◆ AnyValue() [21/27]

AnyValue::AnyValue ( double  value)
noexcept

Initializes value as double.

◆ AnyValue() [22/27]

AnyValue::AnyValue ( long double  value)
noexcept

Initializes value as long double.

◆ AnyValue() [23/27]

AnyValue::AnyValue ( const String value)
noexcept

Initializes value as string.

◆ AnyValue() [24/27]

AnyValue::AnyValue ( const Literal value)
noexcept

Initializes value as string.

◆ AnyValue() [25/27]

AnyValue::AnyValue ( const WideString value)
noexcept

Initializes value as wide string.

◆ AnyValue() [26/27]

AnyValue::AnyValue ( const WideLiteral value)
noexcept

Initializes value as wide string.

◆ AnyValue() [27/27]

AnyValue::AnyValue ( const AnyReference value)
noexcept

Initializes value as reference.

Member Function Documentation

◆ getBoolean()

bool AnyValue::getBoolean ( ) const
noexcept

Returns value as a boolean.

◆ getChar()

char AnyValue::getChar ( ) const
noexcept

Returns value as a character.

◆ getDouble()

double AnyValue::getDouble ( ) const
noexcept

Returns value as a double.

◆ getFloat()

float AnyValue::getFloat ( ) const
noexcept

Returns value as a float.

◆ getInteger()

int AnyValue::getInteger ( ) const
noexcept

Returns value as a integer.

◆ getLongDouble()

long double AnyValue::getLongDouble ( ) const
noexcept

Returns value as a float.

◆ getLongInteger()

long AnyValue::getLongInteger ( ) const
noexcept

Returns value as a long integer.

◆ getLongLongInteger()

long long AnyValue::getLongLongInteger ( ) const
noexcept

Returns value as a long long integer.

◆ getPointer()

void* AnyValue::getPointer ( ) const
noexcept

Returns value as a pointer.

◆ getReference()

AnyReference AnyValue::getReference ( )
noexcept

Returns the reference.

◆ getRepresentation()

Representation AnyValue::getRepresentation ( ) const
inlinenoexcept

Returns the internal representation of the value.

◆ getRepresentationType()

Type AnyValue::getRepresentationType ( ) const
noexcept

Returns the type of the internal representation.

Returns
An uninitialized type object is returned if the representation is VOID.

◆ getShortInteger()

short AnyValue::getShortInteger ( ) const
noexcept

Returns value as a short integer.

◆ getString()

String AnyValue::getString ( ) const
noexcept

Returns value as a string.

◆ getType()

Type AnyValue::getType ( ) const
noexcept

Returns value as a type.

◆ getTypeAsId()

static const char* AnyValue::getTypeAsId ( Representation  representation)
static

Returns the literal for for given representation.

◆ getUnsignedInteger()

unsigned int AnyValue::getUnsignedInteger ( ) const
noexcept

Returns value as an unsiged integer.

◆ getUnsignedLongInteger()

unsigned long AnyValue::getUnsignedLongInteger ( ) const
noexcept

Returns value as an unsigned long integer.

◆ getUnsignedLongLongInteger()

unsigned long long AnyValue::getUnsignedLongLongInteger ( ) const
noexcept

Returns value as an unsigned long long integer.

◆ getUnsignedShortInteger()

unsigned short AnyValue::getUnsignedShortInteger ( ) const
noexcept

Returns value as an unsigned short integer.

◆ getValue()

template<typename TYPE >
TYPE AnyValue::getValue ( ) const

Returns value as given type.

◆ getWideChar()

wchar AnyValue::getWideChar ( ) const
noexcept

Returns value as a wide character.

◆ getWideString()

WideString AnyValue::getWideString ( ) const
noexcept

Returns the value as a wide string.

◆ isFloatingPoint()

bool AnyValue::isFloatingPoint ( ) const
noexcept

Returns true if the representation is a floating point type.

◆ isInteger()

bool AnyValue::isInteger ( ) const
noexcept

Returns true if the representation is an integer type.

◆ isText()

bool AnyValue::isText ( ) const
noexcept

Returns true if the value represented by character(s).

◆ isUnsigned()

bool AnyValue::isUnsigned ( ) const
noexcept

Returns true if the representation is an unsigned type.

◆ operator=() [1/24]

AnyValue& AnyValue::operator= ( AnyValue &&  assign)
noexcept

Assignment of object to object.

◆ operator=() [2/24]

AnyValue& AnyValue::operator= ( bool  value)
noexcept

Sets the value as a boolean.

◆ operator=() [3/24]

AnyValue& AnyValue::operator= ( char  value)
noexcept

Sets the value as a character.

◆ operator=() [4/24]

AnyValue& AnyValue::operator= ( const AnyReference value)
noexcept

Sets the value as a reference.

◆ operator=() [5/24]

AnyValue& AnyValue::operator= ( const AnyValue assign)
noexcept

Assignment of object to object.

◆ operator=() [6/24]

AnyValue& AnyValue::operator= ( const char *  value)
noexcept

Sets the value as a string.

◆ operator=() [7/24]

AnyValue& AnyValue::operator= ( const String value)
noexcept

Sets the value as a string.

◆ operator=() [8/24]

AnyValue& AnyValue::operator= ( const Type value)
noexcept

Sets the value as a type.

◆ operator=() [9/24]

AnyValue& AnyValue::operator= ( const wchar *  value)
noexcept

Sets the value as a wide string.

◆ operator=() [10/24]

AnyValue& AnyValue::operator= ( const WideString value)
noexcept

Sets the value as a wide string.

◆ operator=() [11/24]

AnyValue& AnyValue::operator= ( double  value)
noexcept

Sets the value as a double.

◆ operator=() [12/24]

AnyValue& AnyValue::operator= ( float  value)
noexcept

Sets the value as a float.

◆ operator=() [13/24]

AnyValue& AnyValue::operator= ( int  value)
noexcept

Sets the value as a integer.

◆ operator=() [14/24]

AnyValue& AnyValue::operator= ( long double  value)
noexcept

Sets the value as a long double.

◆ operator=() [15/24]

AnyValue& AnyValue::operator= ( long long  value)
noexcept

Sets the value as a long long integer.

◆ operator=() [16/24]

AnyValue& AnyValue::operator= ( long  value)
noexcept

Sets the value as a long integer.

◆ operator=() [17/24]

AnyValue& AnyValue::operator= ( NullPtr  )
noexcept

Sets the value as void pointer.

◆ operator=() [18/24]

AnyValue& AnyValue::operator= ( short  value)
noexcept

Sets the value as a short integer.

◆ operator=() [19/24]

AnyValue& AnyValue::operator= ( unsigned int  value)
noexcept

Sets the value as an unsigned integer.

◆ operator=() [20/24]

AnyValue& AnyValue::operator= ( unsigned long long  value)
noexcept

Sets the value as an unsigned long long integer.

◆ operator=() [21/24]

AnyValue& AnyValue::operator= ( unsigned long  value)
noexcept

Sets the value as an unsigned long integer.

◆ operator=() [22/24]

AnyValue& AnyValue::operator= ( unsigned short  value)
noexcept

Sets the value as an unsigned short integer.

◆ operator=() [23/24]

AnyValue& AnyValue::operator= ( void *  value)
noexcept

Sets the value as a pointer.

◆ operator=() [24/24]

AnyValue& AnyValue::operator= ( wchar  value)
noexcept

Sets the value as a wide character.

◆ setBoolean()

void AnyValue::setBoolean ( bool  value)
noexcept

Sets the value as a boolean.

◆ setChar()

void AnyValue::setChar ( char  value)
noexcept

Sets the value as a character.

◆ setInteger()

void AnyValue::setInteger ( int  value)
noexcept

Sets the value as a integer.

◆ setLongInteger()

void AnyValue::setLongInteger ( long  value)
noexcept

Sets the value as a long integer.

◆ setLongLongInteger()

void AnyValue::setLongLongInteger ( long long  value)
noexcept

Sets the value as a long long integer.

◆ setPointer()

void AnyValue::setPointer ( void *  value)
noexcept

Sets the value as a pointer.

◆ setReference()

void AnyValue::setReference ( const AnyReference value)
noexcept

Sets the value as a reference.

◆ setShortInteger()

void AnyValue::setShortInteger ( short  value)
noexcept

Sets the value as a short integer.

◆ setString()

void AnyValue::setString ( const String value)
noexcept

Sets the value as a string.

◆ setType()

void AnyValue::setType ( const Type value)
noexcept

Sets the value as a type.

◆ setUnsignedInteger()

void AnyValue::setUnsignedInteger ( unsigned int  value)
noexcept

Sets the value as an unsigned integer.

◆ setUnsignedLongInteger()

void AnyValue::setUnsignedLongInteger ( unsigned long  value)
noexcept

Sets the value as an unsigned long integer.

◆ setUnsignedLongLongInteger()

void AnyValue::setUnsignedLongLongInteger ( unsigned long long  value)
noexcept

Sets the value as an unsigned long long integer.

◆ setUnsignedShortInteger()

void AnyValue::setUnsignedShortInteger ( unsigned short  value)
noexcept

Sets the value as an unsigned short integer.

◆ setWideChar()

void AnyValue::setWideChar ( wchar  value)
noexcept

Sets the value as a wide character.

◆ setWideString()

void AnyValue::setWideString ( const WideString value)
noexcept

Sets the value as a wide string.