Class any_t#

Class Documentation#

class any_t#

The ‘any’ class implementation.

Unnamed Group

explicit any_t(const string &rssVal)#

SDV string constructors.

Parameters:

rssVal[in] Reference to the string object.

explicit any_t(const u8string &rssVal)#

SDV string constructors.

Parameters:

rssVal[in] Reference to the string object.

explicit any_t(const u16string &rssVal)#

SDV string constructors.

Parameters:

rssVal[in] Reference to the string object.

explicit any_t(const u32string &rssVal)#

SDV string constructors.

Parameters:

rssVal[in] Reference to the string object.

explicit any_t(const wstring &rssVal)#

SDV string constructors.

Parameters:

rssVal[in] Reference to the string object.

Unnamed Group

explicit any_t(const std::string &rssVal)#

STD string constructors.

Parameters:

rssVal[in] Reference to the string object.

explicit any_t(const std::u16string &rssVal)#

STD string constructors.

Parameters:

rssVal[in] Reference to the string object.

explicit any_t(const std::u32string &rssVal)#

STD string constructors.

Parameters:

rssVal[in] Reference to the string object.

explicit any_t(const std::wstring &rssVal)#

STD string constructors.

Parameters:

rssVal[in] Reference to the string object.

Unnamed Group

operator bool() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator int8_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator uint8_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator int16_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator uint16_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator int32_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator uint32_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator int64_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator uint64_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator char() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator char16_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator char32_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator wchar_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator float() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator double() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator long double() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator string() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator u8string() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator u16string() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator u32string() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator wstring() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator interface_t() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator std::string() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator std::u16string() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator std::u32string() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

operator std::wstring() const#

Cast operators (provides conversion if not identical to the original type).

Remark

The operators for ANSI string, interface id and exception id are rerpresented by u8string and uint64_t respectively and cannot be used to cast to automatically.

Returns:

The value stored.

Public Types

enum class EValType : uint32_t#

Value type enumeration.

Values:

enumerator val_type_empty#

Empty value.

enumerator val_type_bool#

Boolean value; bVal is used.

enumerator val_type_int8#

8-Bit signed value; i8Val is used.

enumerator val_type_uint8#

8-Bit unsigned value; ui8Val is used.

enumerator val_type_int16#

16-Bit signed value; i16Val is used.

enumerator val_type_uint16#

16-Bit unsigned value; ui16Val is used.

enumerator val_type_int32#

32-Bit signed value; i32Val is used.

enumerator val_type_uint32#

32-Bit unsigned value; ui32Val is used.

enumerator val_type_int64#

64-Bit signed value; i64Val is used.

enumerator val_type_uint64#

64-Bit unsigned value; ui64Val is used.

enumerator val_type_char#

ANSI Character value; cVal is used.

enumerator val_type_char16#

UTF-16 Character value; c16Val is used.

enumerator val_type_char32#

UTF-32 Character value; c32Val is used.

enumerator val_type_wchar#

Wide character value; cwVal is used.

enumerator val_type_float#

Singled precision floating point value; fVal is used.

enumerator val_type_double#

Double precision floating point value; dVal is used.

enumerator val_type_long_double#

Long double precision floating point value; ldVal is used.

enumerator val_type_fixed#

Fixed point value; fixValue is used.

enumerator val_type_string#

ANSI string value; ssVal is used.

enumerator val_type_u8string#

UTF-8 string value; ss8Val is used.

enumerator val_type_u16string#

UTF-16 string value; ss16Val is used.

enumerator val_type_u32string#

UTF-32 string value; ss32Val is used.

enumerator val_type_wstring#

Wide string value; sswVal is used.

enumerator val_type_interface#

Interface type value; ifcVal is used.

enumerator val_type_interface_id#

Interface id value; idIfcVal is used.

enumerator val_type_exception_id#

Exception id value; idExceptVal is used.

enum class ECompareType#

Comparison type.

Values:

enumerator compare_equal#
enumerator compare_inequal#
enumerator compare_smaller#
enumerator compare_smaller_equal#
enumerator compare_larger#
enumerator compare_larger_equal#

Public Functions

any_t()#

Default constructor; construct an empty any.

~any_t()#

destructor

template<typename TType>
explicit any_t(TType tVal)#

Assignment constructor.

Parameters:

tVal[in] The value to assign.

any_t(const char *sz)#

C-style string constructors.

Parameters:

sz[in] Zero terminated string.

any_t(const char16_t *sz)#

C-style string constructors.

Parameters:

sz[in] Zero terminated string.

any_t(const char32_t *sz)#

C-style string constructors.

Parameters:

sz[in] Zero terminated string.

any_t(const wchar_t *sz)#

C-style string constructors.

Parameters:

sz[in] Zero terminated string.

template<typename TType>
any_t(TType tVal, EValType eValTypeParam)#

Assignment constructor.

Parameters:
  • tVal[in] The value to assign.

  • eValTypeParam[in] The target value type.

any_t(const any_t &rany)#

Copy constructor.

Parameters:

rany[in] Reference to any class to copy from.

any_t(any_t &&rany) noexcept#

Move constructor.

Parameters:

rany[in] Reference to any class to move from.

template<typename TType>
any_t &operator=(TType tVal)#

Assignment operator.

Parameters:

tVal[in] The value to assign.

Returns:

Reference to this class.

any_t &operator=(const any_t &rany)#

Copy assignment operator.

Parameters:

rany[in] Reference to any class to copy from.

Returns:

Reference to this class.

any_t &operator=(any_t &&rany) noexcept#

Move operator.

Parameters:

rany[in] Reference to any class to move from.

Returns:

Reference to this class.

bool empty() const#

Check for an empty any.

Returns:

Retrurns whether the any is empty.

void clear()#

Empty the any.

template<typename TType>
void set(TType tVal)#

Assign the value to the any. The any takes the value type based on the value.

Template Parameters:

TType – The type of the value to set.

Parameters:

tVal[in] The value to set.

template<typename TType>
void set(TType tVal, EValType eValTypeParam)#

Assign the value to the any. The value will be converted to the provided value type.

Template Parameters:

TType – The type of the value to set.

Parameters:
  • tVal[in] The valiue to set.

  • eValTypeParam[in] The value type of the any.

template<typename TType>
TType get() const#

Get the value converted to the provided type.

Template Parameters:

TType – The type of the value to get,

Returns:

The value to get.

template<typename TType, ECompareType eType>
bool Compare(const TType &rtVal) const#

Compare the provided value with the contained value.

Template Parameters:
  • TType – Type of the supplied value.

  • eType – Type of comparison to do.

Parameters:

rtVal[in] Reference to the value to use for comparison.

Returns:

The result of the comparison.

template<ECompareType eType>
bool Compare(const any_t &ranyVal) const#

Compare the provided value with the contained value.

Template Parameters:

eType – Type of comparison to do.

Parameters:

ranyVal[in] Reference to the value to use for comparison.

Returns:

The result of the comparison.

Public Members

enum sdv::any_t::EValType eValType = EValType::val_type_empty#

The value type.

bool bVal#

Boolean value.

int8_t i8Val#

8-Bit signed value

uint8_t ui8Val#

8-Bit unsigned value

int16_t i16Val#

16-Bit signed value

uint16_t ui16Val#

16-Bit unsigned value

int32_t i32Val#

32-Bit signed value

uint32_t ui32Val#

32-Bit unsigned value

int64_t i64Val#

64-Bit signed value

uint64_t ui64Val#

64-Bit unsigned value

char cVal#

ANSI Character value.

char16_t c16Val#

UTF-16 Character value.

char32_t c32Val#

UTF-32 Character value.

wchar_t cwVal#

Wide character value.

float fVal#

Singled precision floating point value.

double dVal#

Double precision floating point value.

long double ldVal#

Long double precision floating point value.

string ssVal#

ANSI string value.

u8string ss8Val#

UTF-8 string value.

u16string ss16Val#

UTF-16 string value.

u32string ss32Val#

UTF-32 string value.

wstring sswVal#

Wide string value.

interface_t ifcVal#

Interface type value.

interface_id idIfcVal#

Interface id value.

exception_id idExceptVal#

Exception id value.

union sdv::any_t

Anonymous union.