AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
AJAVariant Class Reference

A simple Variant class. More...

#include <variant.h>

Public Member Functions

 AJAVariant ()
 
 AJAVariant (AJAVariantType type)
 
 AJAVariant (bool value)
 
 AJAVariant (float value)
 
 AJAVariant (double value)
 
 AJAVariant (int8_t value)
 
 AJAVariant (uint8_t value)
 
 AJAVariant (int16_t value)
 
 AJAVariant (uint16_t value)
 
 AJAVariant (int32_t value)
 
 AJAVariant (uint32_t value)
 
 AJAVariant (int64_t value)
 
 AJAVariant (uint64_t value)
 
 AJAVariant (const char *value)
 
 AJAVariant (const char *value, size_t length)
 
 AJAVariant (const std::string &value)
 
 AJAVariant (const AJAVariant &other)
 
 ~AJAVariant ()
 
void operator= (const AJAVariant &other)
 
 operator bool () const
 
 operator float () const
 
 operator double () const
 
 operator int8_t () const
 
 operator uint8_t () const
 
 operator int16_t () const
 
 operator uint16_t () const
 
 operator int32_t () const
 
 operator uint32_t () const
 
 operator int64_t () const
 
 operator uint64_t () const
 
 operator std::string () const
 
AJAVariantType GetType () const
 
bool GetBool () const
 
float GetFloat () const
 
double GetDouble () const
 
int8_t GetInt8 () const
 
uint8_t GetUInt8 () const
 
int16_t GetInt16 () const
 
uint16_t GetUInt16 () const
 
int32_t GetInt32 () const
 
uint32_t GetUInt32 () const
 
int64_t GetInt64 () const
 
uint64_t GetUInt64 () const
 
const std::string & GetString () const
 
void SetBool (bool value)
 
void SetFloat (float value)
 
void SetDouble (double value)
 
void SetInt8 (int8_t value)
 
void SetUInt8 (uint8_t value)
 
void SetInt16 (int16_t value)
 
void SetUInt16 (uint16_t value)
 
void SetInt32 (int32_t value)
 
void SetUInt32 (uint32_t value)
 
void SetInt64 (int64_t value)
 
void SetUInt64 (uint64_t value)
 
void SetString (const char *value)
 
void SetString (const char *value, size_t length)
 
void SetString (const std::string &value)
 
bool AsBool () const
 
float AsFloat () const
 
double AsDouble () const
 
int8_t AsInt8 () const
 
uint8_t AsUInt8 () const
 
int16_t AsInt16 () const
 
uint16_t AsUInt16 () const
 
int32_t AsInt32 () const
 
uint32_t AsUInt32 () const
 
int64_t AsInt64 () const
 
uint64_t AsUInt64 () const
 
std::string AsString () const
 

Detailed Description

A simple Variant class.

Definition at line 34 of file variant.h.

Constructor & Destructor Documentation

◆ AJAVariant() [1/17]

AJAVariant::AJAVariant ( )

Definition at line 17 of file variant.cpp.

◆ AJAVariant() [2/17]

AJAVariant::AJAVariant ( AJAVariantType  type)
explicit

Definition at line 22 of file variant.cpp.

◆ AJAVariant() [3/17]

AJAVariant::AJAVariant ( bool  value)
explicit

Definition at line 73 of file variant.cpp.

◆ AJAVariant() [4/17]

AJAVariant::AJAVariant ( float  value)
explicit

Definition at line 75 of file variant.cpp.

◆ AJAVariant() [5/17]

AJAVariant::AJAVariant ( double  value)
explicit

Definition at line 77 of file variant.cpp.

◆ AJAVariant() [6/17]

AJAVariant::AJAVariant ( int8_t  value)
explicit

Definition at line 79 of file variant.cpp.

◆ AJAVariant() [7/17]

AJAVariant::AJAVariant ( uint8_t  value)
explicit

Definition at line 81 of file variant.cpp.

◆ AJAVariant() [8/17]

AJAVariant::AJAVariant ( int16_t  value)
explicit

Definition at line 83 of file variant.cpp.

◆ AJAVariant() [9/17]

AJAVariant::AJAVariant ( uint16_t  value)
explicit

Definition at line 85 of file variant.cpp.

◆ AJAVariant() [10/17]

AJAVariant::AJAVariant ( int32_t  value)
explicit

Definition at line 87 of file variant.cpp.

◆ AJAVariant() [11/17]

AJAVariant::AJAVariant ( uint32_t  value)
explicit

Definition at line 89 of file variant.cpp.

◆ AJAVariant() [12/17]

AJAVariant::AJAVariant ( int64_t  value)
explicit

Definition at line 91 of file variant.cpp.

◆ AJAVariant() [13/17]

AJAVariant::AJAVariant ( uint64_t  value)
explicit

Definition at line 93 of file variant.cpp.

◆ AJAVariant() [14/17]

AJAVariant::AJAVariant ( const char *  value)
explicit

Definition at line 95 of file variant.cpp.

◆ AJAVariant() [15/17]

AJAVariant::AJAVariant ( const char *  value,
size_t  length 
)
explicit

◆ AJAVariant() [16/17]

AJAVariant::AJAVariant ( const std::string &  value)
explicit

Definition at line 99 of file variant.cpp.

◆ AJAVariant() [17/17]

AJAVariant::AJAVariant ( const AJAVariant other)

Definition at line 103 of file variant.cpp.

◆ ~AJAVariant()

AJAVariant::~AJAVariant ( )
inline

Definition at line 54 of file variant.h.

Member Function Documentation

◆ 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 299 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 387 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 344 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 504 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 582 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 660 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 426 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 755 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 543 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 621 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 703 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 465 of file variant.cpp.

◆ GetBool()

bool AJAVariant::GetBool ( ) const

Get the bool value from this variant.

Returns
The internal union bool value.

Definition at line 203 of file variant.cpp.

◆ GetDouble()

double AJAVariant::GetDouble ( ) const

Get the double value from this variant.

Returns
The internal union double value.

Definition at line 209 of file variant.cpp.

◆ GetFloat()

float AJAVariant::GetFloat ( ) const

Get the float value from this variant.

Returns
The internal union float value.

Definition at line 206 of file variant.cpp.

◆ GetInt16()

int16_t AJAVariant::GetInt16 ( ) const

Get the int16_t value from this variant.

Returns
The internal union int16_t value.

Definition at line 218 of file variant.cpp.

◆ GetInt32()

int32_t AJAVariant::GetInt32 ( ) const

Get the int32_t value from this variant.

Returns
The internal union int32_t value.

Definition at line 224 of file variant.cpp.

◆ GetInt64()

int64_t AJAVariant::GetInt64 ( ) const

Get the int64_t value from this variant.

Returns
The internal union int64_t value.

Definition at line 230 of file variant.cpp.

◆ GetInt8()

int8_t AJAVariant::GetInt8 ( ) const

Get the int8_t value from this variant.

Returns
The internal union int8_t value.

Definition at line 212 of file variant.cpp.

◆ GetString()

const std::string & AJAVariant::GetString ( ) const

Get the std::string value from this variant.

Returns
The internal union std::string value.

Definition at line 236 of file variant.cpp.

◆ GetType()

AJAVariantType AJAVariant::GetType ( ) const
inline

Get the type of this variant.

Returns
The type of this variant.

Definition at line 76 of file variant.h.

◆ GetUInt16()

uint16_t AJAVariant::GetUInt16 ( ) const

Get the uint16_t value from this variant.

Returns
The internal union uint16_t value.

Definition at line 221 of file variant.cpp.

◆ GetUInt32()

uint32_t AJAVariant::GetUInt32 ( ) const

Get the uint32_t value from this variant.

Returns
The internal union uint32_t value.

Definition at line 227 of file variant.cpp.

◆ GetUInt64()

uint64_t AJAVariant::GetUInt64 ( ) const

Get the uint64_t value from this variant.

Returns
The internal union uint64_t value.

Definition at line 233 of file variant.cpp.

◆ GetUInt8()

uint8_t AJAVariant::GetUInt8 ( ) const

Get the uint8_t value from this variant.

Returns
The internal union uint8_t value.

Definition at line 215 of file variant.cpp.

◆ operator bool()

AJAVariant::operator bool ( ) const

Definition at line 153 of file variant.cpp.

◆ operator double()

AJAVariant::operator double ( ) const

Definition at line 161 of file variant.cpp.

◆ operator float()

AJAVariant::operator float ( ) const

Definition at line 157 of file variant.cpp.

◆ operator int16_t()

AJAVariant::operator int16_t ( ) const

Definition at line 173 of file variant.cpp.

◆ operator int32_t()

AJAVariant::operator int32_t ( ) const

Definition at line 181 of file variant.cpp.

◆ operator int64_t()

AJAVariant::operator int64_t ( ) const

Definition at line 189 of file variant.cpp.

◆ operator int8_t()

AJAVariant::operator int8_t ( ) const

Definition at line 165 of file variant.cpp.

◆ operator std::string()

AJAVariant::operator std::string ( ) const

Definition at line 197 of file variant.cpp.

◆ operator uint16_t()

AJAVariant::operator uint16_t ( ) const

Definition at line 177 of file variant.cpp.

◆ operator uint32_t()

AJAVariant::operator uint32_t ( ) const

Definition at line 185 of file variant.cpp.

◆ operator uint64_t()

AJAVariant::operator uint64_t ( ) const

Definition at line 193 of file variant.cpp.

◆ operator uint8_t()

AJAVariant::operator uint8_t ( ) const

Definition at line 169 of file variant.cpp.

◆ operator=()

void AJAVariant::operator= ( const AJAVariant other)

Definition at line 107 of file variant.cpp.

◆ SetBool()

void AJAVariant::SetBool ( bool  value)

Set the value of this variant from the specified bool.

Parameters
[in]valueThe bool value to set.

Definition at line 241 of file variant.cpp.

◆ SetDouble()

void AJAVariant::SetDouble ( double  value)

Set the value of this variant from the specified double.

Parameters
[in]valueThe double value to set.

Definition at line 249 of file variant.cpp.

◆ SetFloat()

void AJAVariant::SetFloat ( float  value)

Set the value of this variant from the specified float.

Parameters
[in]valueThe float value to set.

Definition at line 245 of file variant.cpp.

◆ SetInt16()

void AJAVariant::SetInt16 ( int16_t  value)

Set the value of this variant from the specified int16_t.

Parameters
[in]valueThe int16_t value to set.

Definition at line 261 of file variant.cpp.

◆ SetInt32()

void AJAVariant::SetInt32 ( int32_t  value)

Set the value of this variant from the specified int32_t.

Parameters
[in]valueThe int32_t value to set.

Definition at line 269 of file variant.cpp.

◆ SetInt64()

void AJAVariant::SetInt64 ( int64_t  value)

Set the value of this variant from the specified int64_t.

Parameters
[in]valueThe int64_t value to set.

Definition at line 277 of file variant.cpp.

◆ SetInt8()

void AJAVariant::SetInt8 ( int8_t  value)

Set the value of this variant from the specified int8_t.

Parameters
[in]valueThe int8_t value to set.

Definition at line 253 of file variant.cpp.

◆ SetString() [1/3]

void AJAVariant::SetString ( const char *  value)

Set the value of this variant from the specified c-string.

Parameters
[in]valueThe c-string value to set.

Definition at line 285 of file variant.cpp.

◆ SetString() [2/3]

void AJAVariant::SetString ( const char *  value,
size_t  length 
)

Set the value of this variant from the specified c-string.

Parameters
[in]valueThe c-string value to set.
[in]valueThe size of the string value.

◆ SetString() [3/3]

void AJAVariant::SetString ( const std::string &  value)

Set the value of this variant from the specified std::string.

Parameters
[in]valueThe std::string value to set.

Definition at line 293 of file variant.cpp.

◆ SetUInt16()

void AJAVariant::SetUInt16 ( uint16_t  value)

Set the value of this variant from the specified uint16_t.

Parameters
[in]valueThe uint16_t value to set.

Definition at line 265 of file variant.cpp.

◆ SetUInt32()

void AJAVariant::SetUInt32 ( uint32_t  value)

Set the value of this variant from the specified uint32_t.

Parameters
[in]valueThe uint32_t value to set.

Definition at line 273 of file variant.cpp.

◆ SetUInt64()

void AJAVariant::SetUInt64 ( uint64_t  value)

Set the value of this variant from the specified uint64_t.

Parameters
[in]valueThe uint64_t value to set.

Definition at line 281 of file variant.cpp.

◆ SetUInt8()

void AJAVariant::SetUInt8 ( uint8_t  value)

Set the value of this variant from the specified uint8_t.

Parameters
[in]valueThe uint8_t value to set.

Definition at line 257 of file variant.cpp.

Member Data Documentation

◆ mBooleanValue

bool AJAVariant::mBooleanValue

Definition at line 278 of file variant.h.

◆ mDoubleValue

double AJAVariant::mDoubleValue

Definition at line 280 of file variant.h.

◆ mFloatValue

float AJAVariant::mFloatValue

Definition at line 279 of file variant.h.

◆ mInt16Value

int16_t AJAVariant::mInt16Value

Definition at line 283 of file variant.h.

◆ mInt32Value

int32_t AJAVariant::mInt32Value

Definition at line 285 of file variant.h.

◆ mInt64Value

int64_t AJAVariant::mInt64Value

Definition at line 287 of file variant.h.

◆ mInt8Value

int8_t AJAVariant::mInt8Value

Definition at line 281 of file variant.h.

◆ mUInt16Value

uint16_t AJAVariant::mUInt16Value

Definition at line 284 of file variant.h.

◆ mUInt32Value

uint32_t AJAVariant::mUInt32Value

Definition at line 286 of file variant.h.

◆ mUInt64Value

uint64_t AJAVariant::mUInt64Value

Definition at line 288 of file variant.h.

◆ mUInt8Value

uint8_t AJAVariant::mUInt8Value

Definition at line 282 of file variant.h.


The documentation for this class was generated from the following files: