Variant Class Reference

The Variant class is described here: Variants. More...

#include <ArmarXCore/observers/variant/Variant.h>

+ Inheritance diagram for Variant:

Public Member Functions

virtual VariantPtr clone () const
 Returns a copy of the Variant. More...
 
template<>
bool get () const
 
template<>
float get () const
 
template<>
double get () const
 
template<typename T >
std::enable_if_t< std::is_base_of_v< VariantDataClass, T >, IceInternal::Handle< T > > get () const
 Template-based getter for the Variant's value. More...
 
template<typename T >
std::enable_if_t< std::is_base_of_v< VariantDataClass, typename T::element_type >, Tget () const
 
template<typename T >
std::enable_if_t<(std::is_standard_layout_v< T > &&std::is_trivial_v< T >)||std::is_same_v< std::string, T >, Tget () const
 This getter is only called if a wrong template parameter is given (i.e: the type does not inherit from VariantDataClass). More...
 
template<>
std::int8_t get () const
 
template<>
std::int16_t get () const
 
template<>
std::int32_t get () const
 
template<>
std::int64_t get () const
 
template<>
std::uint8_t get () const
 
template<>
std::uint8_t get () const
 
template<>
std::uint16_t get () const
 
template<>
std::uint32_t get () const
 
template<>
std::uint64_t get () const
 
template<>
bool get () const
 
template<>
float get () const
 
template<>
double get () const
 
template<>
std::string get () const
 
bool getBool (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's value as bool. More...
 
template<class TVariantDataClass >
IceInternal::Handle< TVariantDataClass > getClass () const
 Return the Variant's value as TVariantDataClass. More...
 
double getDouble (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's value as double. More...
 
float getFloat (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's value as float. More...
 
bool getInitialized (const Ice::Current &c=Ice::emptyCurrent) const override
 Tells if the Variant is properly initialized. More...
 
int getInt (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's value as int. More...
 
long getLong (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's value as long. More...
 
virtual std::string getOutputValueOnly () const
 Returns the formatted content of the Variant as a string. More...
 
std::string getString (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's value as string. More...
 
VariantTypeId getType (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's internal type. More...
 
std::string getTypeName (const Ice::Current &c=Ice::emptyCurrent) const override
 Return the Variant's internal type. More...
 
Variantoperator= (bool b)
 
Variantoperator= (const std::string &s)
 
Variantoperator= (const Variant &prototype)
 
Variantoperator= (const VariantDataClass &prototype)
 
Variantoperator= (const VariantDataClassPtr &prototype)
 
Variantoperator= (double d)
 
Variantoperator= (float f)
 
Variantoperator= (int n)
 
Variantoperator= (long n)
 
template<>
void set (const bool &value)
 
template<>
void set (const bool &value)
 
template<>
void set (const double &value)
 
template<>
void set (const double &value)
 
template<>
void set (const float &value)
 
template<>
void set (const float &value)
 
template<>
void set (const std::int16_t &value)
 
template<>
void set (const std::int32_t &value)
 
template<>
void set (const std::int64_t &value)
 
template<>
void set (const std::int8_t &value)
 
template<>
void set (const std::string &value)
 
template<>
void set (const std::uint16_t &value)
 
template<>
void set (const std::uint32_t &value)
 
template<>
void set (const std::uint64_t &value)
 
template<>
void set (const std::uint8_t &value)
 
template<>
void set (const std::uint8_t &value)
 
template<typename T >
std::enable_if_t<!std::is_base_of_v< VariantDataClass, T > > set (const T &value)
 Template-based setter for the Variant's value for non-VariantDataClass-instances. More...
 
template<typename T >
std::enable_if_t< std::is_base_of_v< VariantDataClass, T > > set (const VariantDataClassPtr &variantDataClass)
 Template-based setter for the Variant's value for VariantDataClass-instances. More...
 
void setBool (bool b, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the Variant's value to b. More...
 
void setClass (const VariantDataClass &variantDataClass)
 Sets the Variant's value to variantDataClass. More...
 
void setClass (const VariantDataClassPtr &variantDataClass)
 Sets the Variant's value to variantDataClass. More...
 
void setDouble (double d, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the Variant's value to d. More...
 
void setFloat (float f, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the Variant's value to f. More...
 
void setInt (int n, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the Variant's value to n. More...
 
void setLong (long n, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the Variant's value to n. More...
 
void setString (const std::string &s, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the Variant's value to s. More...
 
void setType (VariantTypeId typeId, const Ice::Current &c=Ice::emptyCurrent) override
 Sets the Variant's type to typeId. More...
 
bool validate (const Ice::Current &c=Ice::emptyCurrent) const override
 Checks if the Variant is initialized and the stored value is valid with respect to the Variant's type. More...
 
 Variant ()
 
 Variant (char const var[])
 Construct a Variant from a string. More...
 
template<>
 Variant (const bool &var, void *)
 
template<>
 Variant (const double &var, void *)
 
template<>
 Variant (const float &var, void *)
 
template<class T >
 Variant (const IceInternal::Handle< T > &var, typename std::enable_if_t< std::is_base_of_v< VariantDataClass, T >> *t=nullptr)
 Construct a Variant from an IceHandle to a VariantDataClass instance. More...
 
template<>
 Variant (const std::int16_t &var, void *)
 
template<>
 Variant (const std::int32_t &var, void *)
 
template<>
 Variant (const std::int64_t &var, void *)
 
template<>
 Variant (const std::int8_t &var, void *)
 
template<>
 Variant (const std::string &var, void *)
 
template<>
 Variant (const std::uint16_t &var, void *)
 
template<>
 Variant (const std::uint32_t &var, void *)
 
template<>
 Variant (const std::uint64_t &var, void *)
 
template<>
 Variant (const std::uint8_t &var, void *)
 
template<class T >
 Variant (const T &var, typename std::enable_if_t< std::is_base_of_v< VariantDataClass, T >> *t=nullptr)
 Construct a Variant from a reference to a VariantDataClass instance. More...
 
template<class T >
 Variant (const T &var, typename std::enable_if_t<!(std::is_base_of_v< VariantDataClass, T >||std::is_pointer_v< T >)> *t=nullptr)
 Construct a Variant from a non-VariantDataClass instance, e.g. More...
 
template<class T >
 Variant (const T *var, typename std::enable_if_t< std::is_base_of_v< VariantDataClass, T >> *t=nullptr)
 Construct a Variant from a pointer to a VariantDataClass instance. More...
 
 Variant (const Variant &source)
 

Static Public Member Functions

static VariantTypeId addTypeName (const std::string &typeName)
 Register a new type for the use in a Variant. More...
 
template<typename Type >
static std::string GetType ()
 Template-based getter for a type name. More...
 
static const std::map< VariantTypeId, std::string > & getTypes ()
 Returns the mapping of currently registered types. More...
 
static int hashTypeName (const std::string &typeName)
 Compute and return a hash value for a given type name. More...
 
static std::string typeToString (VariantTypeId typeId)
 Return the name of the registered type typeId. More...
 

Protected Member Functions

void output (std::ostream &stream) const
 Outputs a formatted representation of the Variant to stream. More...
 

Protected Attributes

bool initialized
 

Friends

std::ostream & operator<< (std::ostream &stream, const Variant &rhs)
 
std::ostream & operator<< (std::ostream &stream, const VariantPtr &rhs)
 

Detailed Description

The Variant class is described here: Variants.

Definition at line 224 of file Variant.h.

Constructor & Destructor Documentation

◆ Variant() [1/19]

Variant ( )

Definition at line 235 of file Variant.cpp.

+ Here is the caller graph for this function:

◆ Variant() [2/19]

Variant ( const Variant source)

Definition at line 242 of file Variant.cpp.

+ Here is the call graph for this function:

◆ Variant() [3/19]

Variant ( const T var,
typename std::enable_if_t<!(std::is_base_of_v< VariantDataClass, T >||std::is_pointer_v< T >)> *  t = nullptr 
)
inline

Construct a Variant from a non-VariantDataClass instance, e.g.

from an int

Template Parameters
TThe desired type of the Variant
Parameters
varThe initialization value as a T-instance
tFor type checking only: Do not use

Definition at line 238 of file Variant.h.

◆ Variant() [4/19]

Variant ( char const  var[])
inline

Construct a Variant from a string.

Parameters
varThe initialization value

Definition at line 251 of file Variant.h.

+ Here is the call graph for this function:

◆ Variant() [5/19]

Variant ( const T var,
typename std::enable_if_t< std::is_base_of_v< VariantDataClass, T >> *  t = nullptr 
)
inline

Construct a Variant from a reference to a VariantDataClass instance.

The VariantDataClass is cloned!

Template Parameters
TThe desired type of the Variant
Parameters
varThe initialization value as a T-instance
tFor type checking only: Do not use.

Definition at line 265 of file Variant.h.

+ Here is the call graph for this function:

◆ Variant() [6/19]

Variant ( const IceInternal::Handle< T > &  var,
typename std::enable_if_t< std::is_base_of_v< VariantDataClass, T >> *  t = nullptr 
)
inline

Construct a Variant from an IceHandle to a VariantDataClass instance.

This is a float pointer copy.

Template Parameters
TThe desired type of the Variant
Parameters
varThe initialization value as a handle to a T-instance
tFor type checking only: Do not use.

Definition at line 280 of file Variant.h.

+ Here is the call graph for this function:

◆ Variant() [7/19]

Variant ( const T var,
typename std::enable_if_t< std::is_base_of_v< VariantDataClass, T >> *  t = nullptr 
)
inline

Construct a Variant from a pointer to a VariantDataClass instance.

The VariantDataClass is cloned!

Template Parameters
TThe desired type of the Variant
Parameters
varThe initialization value as a pointer to a T-instance
tFor type checking only: Do not use.

Definition at line 295 of file Variant.h.

+ Here is the call graph for this function:

◆ Variant() [8/19]

Variant ( const std::int8_t &  var,
void *   
)

Definition at line 40 of file Variant.cpp.

◆ Variant() [9/19]

Variant ( const std::int16_t &  var,
void *   
)

Definition at line 56 of file Variant.cpp.

◆ Variant() [10/19]

Variant ( const std::int32_t &  var,
void *   
)

Definition at line 72 of file Variant.cpp.

◆ Variant() [11/19]

Variant ( const std::int64_t &  var,
void *   
)

Definition at line 90 of file Variant.cpp.

◆ Variant() [12/19]

Variant ( const std::uint8_t &  var,
void *   
)

Definition at line 106 of file Variant.cpp.

◆ Variant() [13/19]

Variant ( const std::uint16_t &  var,
void *   
)

Definition at line 122 of file Variant.cpp.

◆ Variant() [14/19]

Variant ( const std::uint32_t &  var,
void *   
)

Definition at line 138 of file Variant.cpp.

+ Here is the call graph for this function:

◆ Variant() [15/19]

Variant ( const std::uint64_t &  var,
void *   
)

Definition at line 157 of file Variant.cpp.

+ Here is the call graph for this function:

◆ Variant() [16/19]

Variant ( const float var,
void *   
)

Definition at line 176 of file Variant.cpp.

◆ Variant() [17/19]

Variant ( const double &  var,
void *   
)

Definition at line 182 of file Variant.cpp.

◆ Variant() [18/19]

Variant ( const bool &  var,
void *   
)

Definition at line 188 of file Variant.cpp.

◆ Variant() [19/19]

Variant ( const std::string &  var,
void *   
)

Definition at line 194 of file Variant.cpp.

Member Function Documentation

◆ addTypeName()

VariantTypeId addTypeName ( const std::string &  typeName)
static

Register a new type for the use in a Variant.

Exceptions
LocalExceptionif an already registered type has the same hash value as typeName.

Definition at line 751 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clone()

VariantPtr clone ( ) const
virtual

Returns a copy of the Variant.

Definition at line 255 of file Variant.cpp.

+ Here is the call graph for this function:

◆ get() [1/19]

bool get ( ) const

Definition at line 201 of file Variant.cpp.

+ Here is the call graph for this function:

◆ get() [2/19]

float get ( ) const

Definition at line 205 of file Variant.cpp.

+ Here is the call graph for this function:

◆ get() [3/19]

double get ( ) const

Definition at line 209 of file Variant.cpp.

+ Here is the call graph for this function:

◆ get() [4/19]

std::enable_if_t<std::is_base_of_v<VariantDataClass, T>, IceInternal::Handle<T> > get ( ) const
inline

Template-based getter for the Variant's value.

Template Parameters
TType of the desired value, that inherits from VariantDataClass (e.g: Vector3, LinkedPose, ChannelRef).
Exceptions
NotInitializedExceptionif the Variant has not been initialized yet
InvalidTypeExceptionif T is not compatible with the Variant's internal type
Returns
a shared pointer to the desired data type (e.g: Vector3Ptr)

Definition at line 556 of file Variant.h.

◆ get() [5/19]

std::enable_if_t<std::is_base_of_v<VariantDataClass, typename T::element_type>, T> get ( ) const
inline

Definition at line 563 of file Variant.h.

◆ get() [6/19]

std::enable_if_t<(std::is_standard_layout_v<T> && std::is_trivial_v<T>) || std::is_same_v<std::string, T>, T> get ( ) const
inline

This getter is only called if a wrong template parameter is given (i.e: the type does not inherit from VariantDataClass).

Exceptions
InvalidTypeException
Returns
For type checking only: Do not use
Note
There exist specializations of this method that allow the basic types bool, int, float, double and std::string

Definition at line 581 of file Variant.h.

◆ get() [7/19]

std::int8_t get ( ) const

◆ get() [8/19]

std::int16_t get ( ) const

◆ get() [9/19]

std::int32_t get ( ) const

◆ get() [10/19]

std::int64_t get ( ) const

◆ get() [11/19]

std::uint8_t get ( ) const

◆ get() [12/19]

std::uint8_t get ( ) const

◆ get() [13/19]

std::uint16_t get ( ) const

◆ get() [14/19]

std::uint32_t get ( ) const

◆ get() [15/19]

std::uint64_t get ( ) const

◆ get() [16/19]

bool get ( ) const

◆ get() [17/19]

float get ( ) const

◆ get() [18/19]

double get ( ) const

◆ get() [19/19]

template std::string get< std::string > ( ) const

◆ getBool()

bool getBool ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's value as bool.

Exceptions
InvalidTypeExceptionif the Variant's type is not VariantType::Bool
NotInitializedExceptionif the Variant is uninitialized

Inherited from VariantBase Ice interface.

Definition at line 487 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getClass()

IceInternal::Handle<TVariantDataClass> getClass ( ) const
inline

Return the Variant's value as TVariantDataClass.

Template Parameters
TVariantDataClassThe type for returning the data
Exceptions
InvalidTypeExceptionif the Variant's type is not compatible to TVariantDataClass
NotInitializedExceptionif the Variant is uninitialized

Definition at line 472 of file Variant.h.

+ Here is the call graph for this function:

◆ getDouble()

double getDouble ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's value as double.

Exceptions
InvalidTypeExceptionif the Variant's type is not VariantType::Double
NotInitializedExceptionif the Variant is uninitialized

Inherited from VariantBase Ice interface.

Definition at line 452 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFloat()

float getFloat ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's value as float.

Exceptions
InvalidTypeExceptionif the Variant's type is not VariantType::Float
NotInitializedExceptionif the Variant is uninitialized

Inherited from VariantBase Ice interface.

Definition at line 434 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInitialized()

bool getInitialized ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Tells if the Variant is properly initialized.

Definition at line 591 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInt()

int getInt ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's value as int.

Exceptions
InvalidTypeExceptionif the Variant's type is not VariantType::Int
NotInitializedExceptionif the Variant is uninitialized

Inherited from VariantBase Ice interface.

Definition at line 400 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLong()

long getLong ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's value as long.

Exceptions
InvalidTypeExceptionif the Variant's type is not VariantType::Long
NotInitializedExceptionif the Variant is uninitialized

Inherited from VariantBase Ice interface.

Definition at line 417 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getOutputValueOnly()

std::string getOutputValueOnly ( ) const
virtual

Returns the formatted content of the Variant as a string.

Reimplemented in TimedVariant.

Definition at line 504 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getString()

std::string getString ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's value as string.

Exceptions
InvalidTypeExceptionif the Variant's type is not VariantType::String
NotInitializedExceptionif the Variant is uninitialized

Inherited from VariantBase Ice interface.

Definition at line 470 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetType()

static std::string GetType ( )
inlinestatic

Template-based getter for a type name.

Definition at line 704 of file Variant.h.

◆ getType()

VariantTypeId getType ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's internal type.

Returns
The Variant's type as a VariantTypeId

Definition at line 574 of file Variant.cpp.

+ Here is the caller graph for this function:

◆ getTypeName()

std::string getTypeName ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Return the Variant's internal type.

Returns
The Variant's type as a string

Definition at line 579 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTypes()

const std::map< VariantTypeId, std::string > & getTypes ( )
static

Returns the mapping of currently registered types.

Definition at line 746 of file Variant.cpp.

+ Here is the caller graph for this function:

◆ hashTypeName()

int hashTypeName ( const std::string &  typeName)
static

Compute and return a hash value for a given type name.

Definition at line 699 of file Variant.cpp.

+ Here is the caller graph for this function:

◆ operator=() [1/9]

Variant& operator= ( bool  b)
inline

Definition at line 643 of file Variant.h.

+ Here is the call graph for this function:

◆ operator=() [2/9]

Variant& operator= ( const std::string &  s)
inline

Definition at line 637 of file Variant.h.

+ Here is the call graph for this function:

◆ operator=() [3/9]

Variant & operator= ( const Variant prototype)

Definition at line 653 of file Variant.cpp.

+ Here is the call graph for this function:

◆ operator=() [4/9]

Variant & operator= ( const VariantDataClass &  prototype)

Definition at line 627 of file Variant.cpp.

+ Here is the call graph for this function:

◆ operator=() [5/9]

Variant & operator= ( const VariantDataClassPtr &  prototype)

Definition at line 640 of file Variant.cpp.

+ Here is the call graph for this function:

◆ operator=() [6/9]

Variant& operator= ( double  d)
inline

Definition at line 631 of file Variant.h.

+ Here is the call graph for this function:

◆ operator=() [7/9]

Variant& operator= ( float  f)
inline

Definition at line 625 of file Variant.h.

+ Here is the call graph for this function:

◆ operator=() [8/9]

Variant& operator= ( int  n)
inline

Definition at line 613 of file Variant.h.

+ Here is the call graph for this function:

◆ operator=() [9/9]

Variant& operator= ( long  n)
inline

Definition at line 619 of file Variant.h.

+ Here is the call graph for this function:

◆ output()

void output ( std::ostream &  stream) const
protected

Outputs a formatted representation of the Variant to stream.

Definition at line 669 of file Variant.cpp.

+ Here is the call graph for this function:

◆ set() [1/18]

void set ( const bool &  value)

Definition at line 218 of file Variant.cpp.

+ Here is the call graph for this function:

◆ set() [2/18]

template void set< bool > ( const bool &  value)

◆ set() [3/18]

void set ( const double &  value)

Definition at line 226 of file Variant.cpp.

+ Here is the call graph for this function:

◆ set() [4/18]

template void set< double > ( const double &  value)

◆ set() [5/18]

void set ( const float value)

Definition at line 222 of file Variant.cpp.

+ Here is the call graph for this function:

◆ set() [6/18]

template void set< float > ( const float value)

◆ set() [7/18]

template void set< std::int16_t > ( const std::int16_t &  value)

◆ set() [8/18]

template void set< std::int32_t > ( const std::int32_t &  value)

◆ set() [9/18]

template void set< std::int64_t > ( const std::int64_t &  value)

◆ set() [10/18]

template void set< std::int8_t > ( const std::int8_t &  value)

◆ set() [11/18]

template void set< std::string > ( const std::string &  value)

◆ set() [12/18]

template void set< std::uint16_t > ( const std::uint16_t &  value)

◆ set() [13/18]

template void set< std::uint32_t > ( const std::uint32_t &  value)

◆ set() [14/18]

template void set< std::uint64_t > ( const std::uint64_t &  value)

◆ set() [15/18]

void set ( const std::uint8_t &  value)

◆ set() [16/18]

template void set< std::uint8_t > ( const std::uint8_t &  value)

◆ set() [17/18]

std::enable_if_t<!std::is_base_of_v<VariantDataClass, T> > set ( const T value)
inline

Template-based setter for the Variant's value for non-VariantDataClass-instances.

Values not derived from VariantDataClass are not allowed, thus this method always throws an exception.

Template Parameters
TThe desired type of the Variant
Exceptions
InvalidTypeException
Returns
For type checking only: Do not use

Definition at line 524 of file Variant.h.

+ Here is the call graph for this function:

◆ set() [18/18]

std::enable_if_t<std::is_base_of_v<VariantDataClass, T> > set ( const VariantDataClassPtr &  variantDataClass)
inline

Template-based setter for the Variant's value for VariantDataClass-instances.

Template Parameters
TThe desired type of the Variant
Exceptions
InvalidTypeExceptionif a type other than T has already been set.
Returns
For type checking only: Do not use

Definition at line 507 of file Variant.h.

+ Here is the call graph for this function:

◆ setBool()

void setBool ( bool  b,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Sets the Variant's value to b.

The Variant's type is fixed to VariantType::Bool.

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 357 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setClass() [1/2]

void setClass ( const VariantDataClass &  variantDataClass)

Sets the Variant's value to variantDataClass.

The Variant's type is fixed to the type of variantDataClass. The data class is cloned!

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 385 of file Variant.cpp.

+ Here is the call graph for this function:

◆ setClass() [2/2]

void setClass ( const VariantDataClassPtr &  variantDataClass)

Sets the Variant's value to variantDataClass.

The Variant's type is fixed to the type of variantDataClass. Flat pointer copy!

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 374 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setDouble()

void setDouble ( double  d,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Sets the Variant's value to d.

The Variant's type is fixed to VariantType::Double.

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 323 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFloat()

void setFloat ( float  f,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Sets the Variant's value to f.

The Variant's type is fixed to VariantType::Float.

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 306 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setInt()

void setInt ( int  n,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Sets the Variant's value to n.

The Variant's type is fixed to VariantType::Int.

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 274 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLong()

void setLong ( long  n,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Sets the Variant's value to n.

The Variant's type is fixed to VariantType::Long.

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 290 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setString()

void setString ( const std::string &  s,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Sets the Variant's value to s.

The Variant's type is fixed to VariantType::String.

Exceptions
InvalidTypeExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 340 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setType()

void setType ( VariantTypeId  typeId,
const Ice::Current &  c = Ice::emptyCurrent 
)
override

Sets the Variant's type to typeId.

A Variant's type can not be changed after it has been set.

Exceptions
LocalExceptionif a different type has already been set.

Inherited from VariantBase Ice interface.

Definition at line 264 of file Variant.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ typeToString()

std::string typeToString ( VariantTypeId  typeId)
static

Return the name of the registered type typeId.

Exceptions
UnknownTypeExceptionif typeId is not registered yet.

Definition at line 732 of file Variant.cpp.

+ Here is the caller graph for this function:

◆ validate()

bool validate ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Checks if the Variant is initialized and the stored value is valid with respect to the Variant's type.

Inherited from VariantBase Ice interface.

Definition at line 601 of file Variant.cpp.

+ Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator<< [1/2]

std::ostream& operator<< ( std::ostream &  stream,
const Variant rhs 
)
friend

Definition at line 656 of file Variant.h.

◆ operator<< [2/2]

std::ostream& operator<< ( std::ostream &  stream,
const VariantPtr rhs 
)
friend

Definition at line 663 of file Variant.h.

Member Data Documentation

◆ initialized

bool initialized
mutableprotected

Definition at line 726 of file Variant.h.


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