TimedVariant Class Reference

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

+ Inheritance diagram for TimedVariant:

Public Member Functions

std::string getOutputValueOnly () const override
 Returns the formatted content of the Variant as a string. More...
 
IceUtil::Time getTime () const
 
Ice::Long getTimestamp (const Ice::Current &c=Ice::emptyCurrent) const override
 Timestamp in micro seconds. More...
 
Ice::ObjectPtr ice_clone () const override
 
void setMicroseconds (Ice::Long microseconds)
 
void setTime (const IceUtil::Time time)
 
 TimedVariant ()
 
 TimedVariant (char const var[], const IceUtil::Time &time)
 Construct a TimedVariant from a string. More...
 
template<class T >
 TimedVariant (const T &var, const IceUtil::Time &time, typename std::enable_if_t< !(std::is_base_of_v< VariantDataClass, T >||std::is_pointer_v< T >) >::type *t=0)
 Construct a TimedVariant from a non-VariantDataClass instance, e.g. More...
 
 TimedVariant (const TimedVariant &source)
 
template<class Var , class... Ts>
 TimedVariant (const Var &variant, std::chrono::duration< Ts... > duration)
 
template<class Var , class... Ts>
 TimedVariant (const Var &variant, std::chrono::time_point< Ts... > timepoint)
 
 TimedVariant (const Variant &variant, const IceUtil::Time &time)
 
 TimedVariant (const VariantPtr &variant, const IceUtil::Time &time)
 
 ~TimedVariant () override
 
- Public Member Functions inherited from Variant
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...
 
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)
 

Friends

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

Additional Inherited Members

- Static Public Member Functions inherited from Variant
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 inherited from Variant
void output (std::ostream &stream) const
 Outputs a formatted representation of the Variant to stream. More...
 
- Protected Attributes inherited from Variant
bool initialized
 

Detailed Description

Definition at line 40 of file TimedVariant.h.

Constructor & Destructor Documentation

◆ TimedVariant() [1/8]

Definition at line 32 of file TimedVariant.cpp.

+ Here is the caller graph for this function:

◆ TimedVariant() [2/8]

TimedVariant ( const TimedVariant source)

Definition at line 37 of file TimedVariant.cpp.

◆ TimedVariant() [3/8]

TimedVariant ( const Variant variant,
const IceUtil::Time &  time 
)

Definition at line 47 of file TimedVariant.cpp.

+ Here is the call graph for this function:

◆ TimedVariant() [4/8]

TimedVariant ( const VariantPtr variant,
const IceUtil::Time &  time 
)

Definition at line 59 of file TimedVariant.cpp.

◆ TimedVariant() [5/8]

TimedVariant ( const Var &  variant,
std::chrono::duration< Ts... >  duration 
)
inline

Definition at line 51 of file TimedVariant.h.

◆ TimedVariant() [6/8]

TimedVariant ( const Var &  variant,
std::chrono::time_point< Ts... >  timepoint 
)
inline

Definition at line 55 of file TimedVariant.h.

◆ TimedVariant() [7/8]

TimedVariant ( const T var,
const IceUtil::Time &  time,
typename std::enable_if_t< !(std::is_base_of_v< VariantDataClass, T >||std::is_pointer_v< T >) >::type *  t = 0 
)
inline

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

from an int

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

Definition at line 67 of file TimedVariant.h.

◆ TimedVariant() [8/8]

TimedVariant ( char const  var[],
const IceUtil::Time &  time 
)
inline

Construct a TimedVariant from a string.

Parameters
varThe initialization value

Definition at line 80 of file TimedVariant.h.

◆ ~TimedVariant()

~TimedVariant ( )
override

Definition at line 68 of file TimedVariant.cpp.

Member Function Documentation

◆ getOutputValueOnly()

std::string getOutputValueOnly ( ) const
overridevirtual

Returns the formatted content of the Variant as a string.

Reimplemented from Variant.

Definition at line 88 of file TimedVariant.cpp.

+ Here is the call graph for this function:

◆ getTime()

IceUtil::Time getTime ( ) const

Definition at line 73 of file TimedVariant.cpp.

◆ getTimestamp()

Ice::Long getTimestamp ( const Ice::Current &  c = Ice::emptyCurrent) const
override

Timestamp in micro seconds.

Definition at line 78 of file TimedVariant.cpp.

◆ ice_clone()

Ice::ObjectPtr ice_clone ( ) const
override

Definition at line 83 of file TimedVariant.cpp.

+ Here is the call graph for this function:

◆ setMicroseconds()

void setMicroseconds ( Ice::Long  microseconds)
inline

Definition at line 93 of file TimedVariant.h.

◆ setTime()

void setTime ( const IceUtil::Time  time)
inline

Definition at line 89 of file TimedVariant.h.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 105 of file TimedVariant.h.


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