|
|
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 >, T > | get () 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 >, T > | get () 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... | |
| Variant & | operator= (bool b) |
| Variant & | operator= (const std::string &s) |
| Variant & | operator= (const Variant &prototype) |
| Variant & | operator= (const VariantDataClass &prototype) |
| Variant & | operator= (const VariantDataClassPtr &prototype) |
| Variant & | operator= (double d) |
| Variant & | operator= (float f) |
| Variant & | operator= (int n) |
| Variant & | operator= (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) |
| Variant | ( | ) |
|
inline |
|
inline |
Construct a Variant from a reference to a VariantDataClass instance.
The VariantDataClass is cloned!
| T | The desired type of the Variant |
| var | The initialization value as a T-instance |
| t | For type checking only: Do not use. |
Definition at line 264 of file Variant.h.
Here is the call graph for this function:
|
inline |
Construct a Variant from an IceHandle to a VariantDataClass instance.
This is a float pointer copy.
| T | The desired type of the Variant |
| var | The initialization value as a handle to a T-instance |
| t | For type checking only: Do not use. |
Definition at line 279 of file Variant.h.
Here is the call graph for this function:
|
inline |
Construct a Variant from a pointer to a VariantDataClass instance.
The VariantDataClass is cloned!
| T | The desired type of the Variant |
| var | The initialization value as a pointer to a T-instance |
| t | For type checking only: Do not use. |
Definition at line 294 of file Variant.h.
Here is the call graph for this function:| Variant | ( | const std::int8_t & | var, |
| void * | |||
| ) |
Definition at line 41 of file Variant.cpp.
| Variant | ( | const std::int16_t & | var, |
| void * | |||
| ) |
Definition at line 63 of file Variant.cpp.
| Variant | ( | const std::int32_t & | var, |
| void * | |||
| ) |
Definition at line 85 of file Variant.cpp.
| Variant | ( | const std::int64_t & | var, |
| void * | |||
| ) |
Definition at line 110 of file Variant.cpp.
| Variant | ( | const std::uint8_t & | var, |
| void * | |||
| ) |
Definition at line 133 of file Variant.cpp.
| Variant | ( | const std::uint16_t & | var, |
| void * | |||
| ) |
Definition at line 155 of file Variant.cpp.
| Variant | ( | const std::uint32_t & | var, |
| void * | |||
| ) |
| Variant | ( | const std::uint64_t & | var, |
| void * | |||
| ) |
Definition at line 230 of file Variant.cpp.
| Variant | ( | const double & | var, |
| void * | |||
| ) |
Definition at line 238 of file Variant.cpp.
| Variant | ( | const bool & | var, |
| void * | |||
| ) |
Definition at line 246 of file Variant.cpp.
| Variant | ( | const std::string & | var, |
| void * | |||
| ) |
Definition at line 254 of file Variant.cpp.
|
static |
Register a new type for the use in a Variant.
| LocalException | if an already registered type has the same hash value as typeName. |
Definition at line 869 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Returns a copy of the Variant.
Definition at line 333 of file Variant.cpp.
Here is the call graph for this function:| bool get | ( | ) | const |
| float get | ( | ) | const |
| double get | ( | ) | const |
|
inline |
Template-based getter for the Variant's value.
| T | Type of the desired value, that inherits from VariantDataClass (e.g: Vector3, LinkedPose, ChannelRef). |
| NotInitializedException | if the Variant has not been initialized yet |
| InvalidTypeException | if T is not compatible with the Variant's internal type |
|
inline |
|
inline |
This getter is only called if a wrong template parameter is given (i.e: the type does not inherit from VariantDataClass).
| InvalidTypeException |
| std::int8_t get | ( | ) | const |
| std::int16_t get | ( | ) | const |
| std::int32_t get | ( | ) | const |
| std::int64_t get | ( | ) | const |
| std::uint8_t get | ( | ) | const |
| std::uint8_t get | ( | ) | const |
| std::uint16_t get | ( | ) | const |
| std::uint32_t get | ( | ) | const |
| std::uint64_t get | ( | ) | const |
| bool get | ( | ) | const |
| float get | ( | ) | const |
| double get | ( | ) | const |
| template std::string get< std::string > | ( | ) | const |
|
override |
Return the Variant's value as bool.
| InvalidTypeException | if the Variant's type is not VariantType::Bool |
| NotInitializedException | if the Variant is uninitialized |
Inherited from VariantBase Ice interface.
Definition at line 589 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Return the Variant's value as TVariantDataClass.
| TVariantDataClass | The type for returning the data |
| InvalidTypeException | if the Variant's type is not compatible to TVariantDataClass |
| NotInitializedException | if the Variant is uninitialized |
Definition at line 470 of file Variant.h.
Here is the call graph for this function:
|
override |
Return the Variant's value as double.
| InvalidTypeException | if the Variant's type is not VariantType::Double |
| NotInitializedException | if the Variant is uninitialized |
Inherited from VariantBase Ice interface.
Definition at line 551 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Return the Variant's value as float.
| InvalidTypeException | if the Variant's type is not VariantType::Float |
| NotInitializedException | if the Variant is uninitialized |
Inherited from VariantBase Ice interface.
Definition at line 532 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Tells if the Variant is properly initialized.
Definition at line 698 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Return the Variant's value as int.
| InvalidTypeException | if the Variant's type is not VariantType::Int |
| NotInitializedException | if the Variant is uninitialized |
Inherited from VariantBase Ice interface.
Definition at line 495 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Return the Variant's value as long.
| InvalidTypeException | if the Variant's type is not VariantType::Long |
| NotInitializedException | if the Variant is uninitialized |
Inherited from VariantBase Ice interface.
Definition at line 513 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
virtual |
Returns the formatted content of the Variant as a string.
Reimplemented in TimedVariant.
Definition at line 608 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Return the Variant's value as string.
| InvalidTypeException | if the Variant's type is not VariantType::String |
| NotInitializedException | if the Variant is uninitialized |
Inherited from VariantBase Ice interface.
Definition at line 570 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
|
override |
Return the Variant's internal type.
Definition at line 679 of file Variant.cpp.
Here is the caller graph for this function:
|
override |
Return the Variant's internal type.
Definition at line 685 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Returns the mapping of currently registered types.
Definition at line 863 of file Variant.cpp.
Here is the caller graph for this function:
|
static |
Compute and return a hash value for a given type name.
Definition at line 813 of file Variant.cpp.
Here is the caller graph for this function:
|
inline |
|
inline |
| Variant & operator= | ( | const VariantDataClass & | prototype | ) |
| Variant & operator= | ( | const VariantDataClassPtr & | prototype | ) |
|
inline |
|
inline |
|
inline |
|
protected |
Outputs a formatted representation of the Variant to stream.
Definition at line 782 of file Variant.cpp.
Here is the call graph for this function:| void set | ( | const bool & | value | ) |
| template void set< bool > | ( | const bool & | value | ) |
| void set | ( | const double & | value | ) |
| template void set< double > | ( | const double & | value | ) |
| void set | ( | const float & | value | ) |
| template void set< std::int16_t > | ( | const std::int16_t & | value | ) |
| template void set< std::int32_t > | ( | const std::int32_t & | value | ) |
| template void set< std::int64_t > | ( | const std::int64_t & | value | ) |
| template void set< std::int8_t > | ( | const std::int8_t & | value | ) |
| template void set< std::string > | ( | const std::string & | value | ) |
| template void set< std::uint16_t > | ( | const std::uint16_t & | value | ) |
| template void set< std::uint32_t > | ( | const std::uint32_t & | value | ) |
| template void set< std::uint64_t > | ( | const std::uint64_t & | value | ) |
| void set | ( | const std::uint8_t & | value | ) |
| template void set< std::uint8_t > | ( | const std::uint8_t & | value | ) |
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.
| T | The desired type of the Variant |
| InvalidTypeException |
Definition at line 521 of file Variant.h.
Here is the call graph for this function:
|
inline |
Template-based setter for the Variant's value for VariantDataClass-instances.
| T | The desired type of the Variant |
| InvalidTypeException | if a type other than T has already been set. |
Definition at line 504 of file Variant.h.
Here is the call graph for this function:
|
override |
Sets the Variant's value to b.
The Variant's type is fixed to VariantType::Bool.
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 447 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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!
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 479 of file Variant.cpp.
Here is the call graph for this function:| 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!
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 466 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Sets the Variant's value to d.
The Variant's type is fixed to VariantType::Double.
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 409 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Sets the Variant's value to f.
The Variant's type is fixed to VariantType::Float.
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 390 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Sets the Variant's value to n.
The Variant's type is fixed to VariantType::Int.
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 355 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Sets the Variant's value to n.
The Variant's type is fixed to VariantType::Long.
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 372 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Sets the Variant's value to s.
The Variant's type is fixed to VariantType::String.
| InvalidTypeException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 428 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
override |
Sets the Variant's type to typeId.
A Variant's type can not be changed after it has been set.
| LocalException | if a different type has already been set. |
Inherited from VariantBase Ice interface.
Definition at line 343 of file Variant.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
Return the name of the registered type typeId.
| UnknownTypeException | if typeId is not registered yet. |
Definition at line 848 of file Variant.cpp.
Here is the caller graph for this function:
|
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 708 of file Variant.cpp.
Here is the call graph for this function:
|
friend |
|
friend |