Orion
high-rate readout
Public Member Functions | Public Attributes | List of all members
itk::opc::Variant Class Reference

Public Member Functions

bool operator== (const Variant &var) const
 
bool operator!= (const Variant &var) const
 
template<typename T >
T & get ()
 template to get value More...
 
template<typename T >
void set (const T &value)
 template to set value More...
 
template<typename T >
bool is_type ()
 Template to check type of variant. More...
 
bool & get_bool ()
 List of getters for each variant type. More...
 
int8_t & get_int8 ()
 
int16_t & get_int16 ()
 
int32_t & get_int32 ()
 
int64_t & get_int64 ()
 
uint8_t & get_uint8 ()
 
uint16_t & get_uint16 ()
 
uint32_t & get_uint32 ()
 
uint64_t & get_uint64 ()
 
float & get_float ()
 
double & get_double ()
 
std::string & get_string ()
 
void set (bool value)
 List of setters for each variant type. More...
 
void set (int8_t value)
 
void set (int16_t value)
 
void set (int32_t value)
 
void set (int64_t value)
 
void set (uint8_t value)
 
void set (uint16_t value)
 
void set (uint32_t value)
 
void set (uint64_t value)
 
void set (float value)
 
void set (double value)
 
void set (const std::string &value)
 
bool undefined ()
 
bool is_bool ()
 
bool is_int8 ()
 
bool is_int16 ()
 
bool is_int32 ()
 
bool is_int64 ()
 
bool is_uint8 ()
 
bool is_uint16 ()
 
bool is_uint32 ()
 
bool is_uint64 ()
 
bool is_float ()
 
bool is_double ()
 
bool is_string ()
 
bool is_int ()
 Test if value is signed integer (int8, int16, int32, int64). More...
 
bool is_uint ()
 Test if value is unsigned integer (uint8, uint16, uint32, uint64). More...
 
bool is_real ()
 Test if value is real (float pr double). More...
 
int64_t as_int ()
 Getting signed value. More...
 
uint64_t as_uint ()
 Getting unsigned value. More...
 
double as_real ()
 Getting real value (float or double) More...
 

Public Attributes

std::variant< std::monostate, bool, int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float, double, std::string, std::vector< int8_t >, std::vector< uint8_t >, std::vector< int16_t >, std::vector< uint16_t >, std::vector< int32_t >, std::vector< uint32_t >, std::vector< int64_t >, std::vector< uint64_t > > val
 

Detailed Description

wrapper for UA_Variant

Member Function Documentation

◆ as_int()

int64_t itk::opc::Variant::as_int ( )
inline

Getting signed value.

Returns
value converted to int64

◆ as_real()

double itk::opc::Variant::as_real ( )
inline

Getting real value (float or double)

Returns
value converted to double

◆ as_uint()

uint64_t itk::opc::Variant::as_uint ( )
inline

Getting unsigned value.

Returns
value converted to uint64

◆ get()

template<typename T >
T& itk::opc::Variant::get ( )
inline

template to get value

Template Parameters
T- type of variant to get

◆ get_bool()

bool& itk::opc::Variant::get_bool ( )
inline

List of getters for each variant type.

Returns
value of variant, if does not contain this value, throws exception

◆ is_int()

bool itk::opc::Variant::is_int ( )
inline

Test if value is signed integer (int8, int16, int32, int64).

Returns
true if signed, otherwise false

◆ is_real()

bool itk::opc::Variant::is_real ( )
inline

Test if value is real (float pr double).

Returns
true if real, otherwise false

◆ is_type()

template<typename T >
bool itk::opc::Variant::is_type ( )
inline

Template to check type of variant.

Template Parameters
T- type of variant to test

◆ is_uint()

bool itk::opc::Variant::is_uint ( )
inline

Test if value is unsigned integer (uint8, uint16, uint32, uint64).

Returns
true if unsigned, otherwise false

◆ set() [1/2]

void itk::opc::Variant::set ( bool  value)
inline

List of setters for each variant type.

Parameters
value- value of variant to set

◆ set() [2/2]

template<typename T >
void itk::opc::Variant::set ( const T &  value)
inline

template to set value

Template Parameters
T- type of variant to set
Parameters
value- value to set

◆ undefined()

bool itk::opc::Variant::undefined ( )
inline

Check if variant is undefined.

Returns
true if variant is undefined, otherwise false

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