A simple Variant class.
More...
#include <variant.h>
A simple Variant class.
Definition at line 37 of file variant.h.
◆ AJAVariant() [1/16]
◆ AJAVariant() [2/16]
AJAVariant::AJAVariant |
( |
const bool |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [3/16]
AJAVariant::AJAVariant |
( |
const float |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [4/16]
AJAVariant::AJAVariant |
( |
const double |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [5/16]
AJAVariant::AJAVariant |
( |
const int8_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [6/16]
AJAVariant::AJAVariant |
( |
const uint8_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [7/16]
AJAVariant::AJAVariant |
( |
const int16_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [8/16]
AJAVariant::AJAVariant |
( |
const uint16_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [9/16]
AJAVariant::AJAVariant |
( |
const int32_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [10/16]
AJAVariant::AJAVariant |
( |
const uint32_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [11/16]
AJAVariant::AJAVariant |
( |
const int64_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [12/16]
AJAVariant::AJAVariant |
( |
const uint64_t |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [13/16]
AJAVariant::AJAVariant |
( |
const char * |
pStr | ) |
|
|
inlineexplicit |
◆ AJAVariant() [14/16]
AJAVariant::AJAVariant |
( |
const char * |
pStr, |
|
|
size_t |
len |
|
) |
| |
|
inlineexplicit |
◆ AJAVariant() [15/16]
AJAVariant::AJAVariant |
( |
const std::string & |
value | ) |
|
|
inlineexplicit |
◆ AJAVariant() [16/16]
AJAVariant::AJAVariant |
( |
const AJAVariant & |
other | ) |
|
|
inline |
◆ ~AJAVariant()
AJAVariant::~AJAVariant |
( |
| ) |
|
|
inline |
◆ AsBool()
bool AJAVariant::AsBool |
( |
| ) |
const |
Get the value of this variant as bool.
- Returns
- The bool value of this variant, if the type is AJA_VARIANT_BOOL, otherwise type-convert and return the current type as bool.
Definition at line 71 of file variant.cpp.
◆ AsDouble()
double AJAVariant::AsDouble |
( |
| ) |
const |
Get the value of this variant as double.
- Returns
- The double value of this variant, if the type is AJA_VARIANT_DOUBLE, otherwise type-convert and return the current type as double.
Definition at line 129 of file variant.cpp.
◆ AsFloat()
float AJAVariant::AsFloat |
( |
| ) |
const |
Get the value of this variant as float.
- Returns
- The float value of this variant, if the type is AJA_VARIANT_FLOAT, otherwise type-convert and return the current type as float.
Definition at line 102 of file variant.cpp.
◆ AsInt16()
int16_t AJAVariant::AsInt16 |
( |
| ) |
const |
Get the value of this variant as int16_t.
- Returns
- The int16_t value of this variant, if the type is AJA_VARIANT_INT16, otherwise type-convert and return the current type as int16_t.
Definition at line 195 of file variant.cpp.
◆ AsInt32()
int32_t AJAVariant::AsInt32 |
( |
| ) |
const |
Get the value of this variant as int32_t.
- Returns
- The int32_t value of this variant, if the type is AJA_VARIANT_INT32, otherwise type-convert and return the current type as int32_t.
Definition at line 239 of file variant.cpp.
◆ AsInt64()
int64_t AJAVariant::AsInt64 |
( |
| ) |
const |
Get the value of this variant as int64_t.
- Returns
- The int64_t value of this variant, if the type is AJA_VARIANT_INT64, otherwise type-convert and return the current type as int64_t.
Definition at line 283 of file variant.cpp.
◆ AsInt8()
int8_t AJAVariant::AsInt8 |
( |
| ) |
const |
Get the value of this variant as int8_t.
- Returns
- The int8_t value of this variant, if the type is AJA_VARIANT_INT8, otherwise type-convert and return the current type as int8_t.
Definition at line 151 of file variant.cpp.
◆ AsString()
std::string AJAVariant::AsString |
( |
| ) |
const |
Get the value of this variant as std::string.
- Returns
- The std::string value of this variant, if the type is AJA_VARIANT_STRING, otherwise type-convert and return the current type as std::string.
Definition at line 350 of file variant.cpp.
◆ AsUInt16()
uint16_t AJAVariant::AsUInt16 |
( |
| ) |
const |
Get the value of this variant as uint16_t.
- Returns
- The uint16_t value of this variant, if the type is AJA_VARIANT_UINT16, otherwise type-convert and return the current type as uint16_t.
Definition at line 217 of file variant.cpp.
◆ AsUInt32()
uint32_t AJAVariant::AsUInt32 |
( |
| ) |
const |
Get the value of this variant as uint32_t.
- Returns
- The uint32_t value of this variant, if the type is AJA_VARIANT_UINT32, otherwise type-convert and return the current type as uint32_t.
Definition at line 261 of file variant.cpp.
◆ AsUInt64()
uint64_t AJAVariant::AsUInt64 |
( |
| ) |
const |
Get the value of this variant as uint64_t.
- Returns
- The uint64_t value of this variant, if the type is AJA_VARIANT_UINT64, otherwise type-convert and return the current type as uint64_t.
Definition at line 310 of file variant.cpp.
◆ AsUInt8()
uint8_t AJAVariant::AsUInt8 |
( |
| ) |
const |
Get the value of this variant as uint8_t.
- Returns
- The uint8_t value of this variant, if the type is AJA_VARIANT_UINT8, otherwise type-convert and return the current type as uint8_t.
Definition at line 173 of file variant.cpp.
◆ GetBool()
bool AJAVariant::GetBool |
( |
| ) |
const |
|
inline |
Get the bool value from this variant.
- Returns
- My bool value.
Definition at line 105 of file variant.h.
◆ GetDouble()
double AJAVariant::GetDouble |
( |
| ) |
const |
|
inline |
Get the double value from this variant.
- Returns
- My double value.
Definition at line 117 of file variant.h.
◆ GetFloat()
float AJAVariant::GetFloat |
( |
| ) |
const |
|
inline |
Get the float value from this variant.
- Returns
- My float value.
Definition at line 111 of file variant.h.
◆ GetInt16()
int16_t AJAVariant::GetInt16 |
( |
| ) |
const |
|
inline |
Get the int16_t value from this variant.
- Returns
- My int16_t value.
Definition at line 135 of file variant.h.
◆ GetInt32()
int32_t AJAVariant::GetInt32 |
( |
| ) |
const |
|
inline |
Get the int32_t value from this variant.
- Returns
- My int32_t value.
Definition at line 147 of file variant.h.
◆ GetInt64()
int64_t AJAVariant::GetInt64 |
( |
| ) |
const |
|
inline |
Get the int64_t value from this variant.
- Returns
- My int64_t value.
Definition at line 159 of file variant.h.
◆ GetInt8()
int8_t AJAVariant::GetInt8 |
( |
| ) |
const |
|
inline |
Get the int8_t value from this variant.
- Returns
- My int8_t value.
Definition at line 123 of file variant.h.
◆ GetString()
const std::string& AJAVariant::GetString |
( |
| ) |
const |
|
inline |
Get the std::string value from this variant.
- Returns
- My std::string value.
Definition at line 171 of file variant.h.
◆ GetUInt16()
uint16_t AJAVariant::GetUInt16 |
( |
| ) |
const |
|
inline |
Get the uint16_t value from this variant.
- Returns
- My uint16_t value.
Definition at line 141 of file variant.h.
◆ GetUInt32()
uint32_t AJAVariant::GetUInt32 |
( |
| ) |
const |
|
inline |
Get the uint32_t value from this variant.
- Returns
- My uint32_t value.
Definition at line 153 of file variant.h.
◆ GetUInt64()
uint64_t AJAVariant::GetUInt64 |
( |
| ) |
const |
|
inline |
Get the uint64_t value from this variant.
- Returns
- My uint64_t value.
Definition at line 165 of file variant.h.
◆ GetUInt8()
uint8_t AJAVariant::GetUInt8 |
( |
| ) |
const |
|
inline |
Get the uint8_t value from this variant.
- Returns
- My uint8_t value.
Definition at line 129 of file variant.h.
◆ IsNumeric()
bool AJAVariant::IsNumeric |
( |
| ) |
const |
- Returns
- True if I have a numeric type
Definition at line 372 of file variant.cpp.
◆ IsSigned()
bool AJAVariant::IsSigned |
( |
| ) |
const |
- Returns
- True if I have a signed numeric type
Definition at line 408 of file variant.cpp.
◆ IsUnsigned()
bool AJAVariant::IsUnsigned |
( |
| ) |
const |
- Returns
- True if I have an unsigned numeric type;
Definition at line 393 of file variant.cpp.
◆ operator bool()
AJAVariant::operator bool |
( |
| ) |
const |
|
inline |
◆ operator double()
AJAVariant::operator double |
( |
| ) |
const |
|
inline |
◆ operator float()
AJAVariant::operator float |
( |
| ) |
const |
|
inline |
◆ operator int16_t()
AJAVariant::operator int16_t |
( |
| ) |
const |
|
inline |
◆ operator int32_t()
AJAVariant::operator int32_t |
( |
| ) |
const |
|
inline |
◆ operator int64_t()
AJAVariant::operator int64_t |
( |
| ) |
const |
|
inline |
◆ operator int8_t()
AJAVariant::operator int8_t |
( |
| ) |
const |
|
inline |
◆ operator std::string()
AJAVariant::operator std::string |
( |
| ) |
const |
|
inline |
◆ operator uint16_t()
AJAVariant::operator uint16_t |
( |
| ) |
const |
|
inline |
◆ operator uint32_t()
AJAVariant::operator uint32_t |
( |
| ) |
const |
|
inline |
◆ operator uint64_t()
AJAVariant::operator uint64_t |
( |
| ) |
const |
|
inline |
◆ operator uint8_t()
AJAVariant::operator uint8_t |
( |
| ) |
const |
|
inline |
◆ operator=() [1/2]
Assigns the value and type of another AJAVariant to me.
- Parameters
-
- Returns
- A non-const reference to me.
Definition at line 44 of file variant.cpp.
◆ operator=() [2/2]
template<typename T >
AJAVariant& AJAVariant::operator= |
( |
const T |
inRHS | ) |
|
|
inline |
Assigns a scalar value of any type to me.
- Parameters
-
[in] | inRHS | The scalar value to assign to me. |
- Returns
- A non-const reference to me.
Definition at line 72 of file variant.h.
◆ SetBool()
void AJAVariant::SetBool |
( |
bool |
value | ) |
|
|
inline |
Sets my value from the specified bool.
- Parameters
-
[in] | value | The bool value to set. |
Definition at line 177 of file variant.h.
◆ SetDouble()
void AJAVariant::SetDouble |
( |
double |
value | ) |
|
|
inline |
Sets my value from the specified double.
- Parameters
-
[in] | value | The double value to set. |
Definition at line 187 of file variant.h.
◆ SetFloat()
void AJAVariant::SetFloat |
( |
float |
value | ) |
|
|
inline |
Sets my value from the specified float.
- Parameters
-
[in] | value | The float value to set. |
Definition at line 182 of file variant.h.
◆ SetInt16()
void AJAVariant::SetInt16 |
( |
int16_t |
value | ) |
|
|
inline |
Sets my value from the specified int16_t.
- Parameters
-
[in] | value | The int16_t value to set. |
Definition at line 202 of file variant.h.
◆ SetInt32()
void AJAVariant::SetInt32 |
( |
int32_t |
value | ) |
|
|
inline |
Sets my value from the specified int32_t.
- Parameters
-
[in] | value | The int32_t value to set. |
Definition at line 212 of file variant.h.
◆ SetInt64()
void AJAVariant::SetInt64 |
( |
int64_t |
value | ) |
|
|
inline |
Sets my value from the specified int64_t.
- Parameters
-
[in] | value | The int64_t value to set. |
Definition at line 222 of file variant.h.
◆ SetInt8()
void AJAVariant::SetInt8 |
( |
int8_t |
value | ) |
|
|
inline |
Sets my value from the specified int8_t.
- Parameters
-
[in] | value | The int8_t value to set. |
Definition at line 192 of file variant.h.
◆ SetString() [1/3]
void AJAVariant::SetString |
( |
const char * |
pStr, |
|
|
const size_t |
len |
|
) |
| |
|
inline |
Sets my value from the given c-style string.
- Parameters
-
[in] | pStr | Points to the character buffer to copy from. Cannot be nullptr. |
[in] | len | The number of bytes to copy from the string value. |
Definition at line 238 of file variant.h.
◆ SetString() [2/3]
void AJAVariant::SetString |
( |
const char * |
value | ) |
|
|
inline |
Sets my value from the specified c-string.
- Parameters
-
[in] | value | The c-string value to set. |
Definition at line 232 of file variant.h.
◆ SetString() [3/3]
void AJAVariant::SetString |
( |
const std::string & |
value | ) |
|
|
inline |
Sets my value from the given std::string.
- Parameters
-
[in] | value | The std::string value to set. |
Definition at line 243 of file variant.h.
◆ SetUInt16()
void AJAVariant::SetUInt16 |
( |
uint16_t |
value | ) |
|
|
inline |
Sets my value from the specified uint16_t.
- Parameters
-
[in] | value | The uint16_t value to set. |
Definition at line 207 of file variant.h.
◆ SetUInt32()
void AJAVariant::SetUInt32 |
( |
uint32_t |
value | ) |
|
|
inline |
Sets my value from the specified uint32_t.
- Parameters
-
[in] | value | The uint32_t value to set. |
Definition at line 217 of file variant.h.
◆ SetUInt64()
void AJAVariant::SetUInt64 |
( |
uint64_t |
value | ) |
|
|
inline |
Sets my value from the specified uint64_t.
- Parameters
-
[in] | value | The uint64_t value to set. |
Definition at line 227 of file variant.h.
◆ SetUInt8()
void AJAVariant::SetUInt8 |
( |
uint8_t |
value | ) |
|
|
inline |
Sets my value from the specified uint8_t.
- Parameters
-
[in] | value | The uint8_t value to set. |
Definition at line 197 of file variant.h.
◆ mBooleanValue
bool AJAVariant::mBooleanValue |
◆ mDoubleValue
double AJAVariant::mDoubleValue |
◆ mFloatValue
float AJAVariant::mFloatValue |
◆ mInt16Value
int16_t AJAVariant::mInt16Value |
◆ mInt32Value
int32_t AJAVariant::mInt32Value |
◆ mInt64Value
int64_t AJAVariant::mInt64Value |
◆ mInt8Value
int8_t AJAVariant::mInt8Value |
◆ mUInt16Value
uint16_t AJAVariant::mUInt16Value |
◆ mUInt32Value
uint32_t AJAVariant::mUInt32Value |
◆ mUInt64Value
uint64_t AJAVariant::mUInt64Value |
◆ mUInt8Value
uint8_t AJAVariant::mUInt8Value |
The documentation for this class was generated from the following files:
- /home/tcbuilder/buildAgent/work/df8e8cce5bebfd58/libajantv2/ajabase/common/variant.h
- /home/tcbuilder/buildAgent/work/df8e8cce5bebfd58/libajantv2/ajabase/common/variant.cpp