|
|
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. | |
| 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. | |
| 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). | |
| template<> | |
| bool | get () const |
| template<> | |
| float | get () const |
| template<> | |
| double | get () const |
| bool | getBool (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's value as bool. | |
| template<class TVariantDataClass> | |
| IceInternal::Handle< TVariantDataClass > | getClass () const |
| Return the Variant's value as TVariantDataClass. | |
| double | getDouble (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's value as double. | |
| float | getFloat (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's value as float. | |
| bool | getInitialized (const Ice::Current &c=Ice::emptyCurrent) const override |
| Tells if the Variant is properly initialized. | |
| int | getInt (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's value as int. | |
| long | getLong (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's value as long. | |
| virtual std::string | getOutputValueOnly () const |
| Returns the formatted content of the Variant as a string. | |
| std::string | getString (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's value as string. | |
| VariantTypeId | getType (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's internal type. | |
| std::string | getTypeName (const Ice::Current &c=Ice::emptyCurrent) const override |
| Return the Variant's internal type. | |
| 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<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. | |
| 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. | |
| void | setBool (bool b, const Ice::Current &c=Ice::emptyCurrent) override |
| Sets the Variant's value to b. | |
| void | setClass (const VariantDataClass &variantDataClass) |
| Sets the Variant's value to variantDataClass. | |
| void | setClass (const VariantDataClassPtr &variantDataClass) |
| Sets the Variant's value to variantDataClass. | |
| void | setDouble (double d, const Ice::Current &c=Ice::emptyCurrent) override |
| Sets the Variant's value to d. | |
| void | setFloat (float f, const Ice::Current &c=Ice::emptyCurrent) override |
| Sets the Variant's value to f. | |
| void | setInt (int n, const Ice::Current &c=Ice::emptyCurrent) override |
| Sets the Variant's value to n. | |
| void | setLong (long n, const Ice::Current &c=Ice::emptyCurrent) override |
| Sets the Variant's value to n. | |
| void | setString (const std::string &s, const Ice::Current &c=Ice::emptyCurrent) override |
| Sets the Variant's value to s. | |
| void | setType (VariantTypeId typeId, const Ice::Current &c=Ice::emptyCurrent) override |
| Sets the Variant's type to typeId. | |
| 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. | |
| Variant () | |
| Variant (char const var[]) | |
| Construct a Variant from a string. | |
| template<> | |
| Variant (const bool &var, void *) | |
| template<> | |
| Variant (const bool &var, void *t) | |
| template<> | |
| Variant (const double &var, void *) | |
| template<> | |
| Variant (const double &var, void *t) | |
| template<> | |
| Variant (const float &var, void *) | |
| template<> | |
| Variant (const float &var, void *t) | |
| 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. | |
| template<> | |
| Variant (const std::int16_t &var, void *) | |
| template<> | |
| Variant (const std::int16_t &var, void *t) | |
| template<> | |
| Variant (const std::int32_t &var, void *) | |
| template<> | |
| Variant (const std::int32_t &var, void *t) | |
| template<> | |
| Variant (const std::int64_t &var, void *) | |
| template<> | |
| Variant (const std::int64_t &var, void *t) | |
| template<> | |
| Variant (const std::int8_t &var, void *) | |
| template<> | |
| Variant (const std::int8_t &var, void *t) | |
| template<> | |
| Variant (const std::string &var, void *) | |
| template<> | |
| Variant (const std::string &var, void *t) | |
| template<> | |
| Variant (const std::uint16_t &var, void *) | |
| template<> | |
| Variant (const std::uint16_t &var, void *t) | |
| template<> | |
| Variant (const std::uint32_t &var, void *) | |
| template<> | |
| Variant (const std::uint32_t &var, void *t) | |
| template<> | |
| Variant (const std::uint64_t &var, void *) | |
| template<> | |
| Variant (const std::uint64_t &var, void *t) | |
| template<> | |
| Variant (const std::uint8_t &var, void *) | |
| template<> | |
| Variant (const std::uint8_t &var, void *t) | |
| template<> | |
| Variant (const std::uint8_t &var, void *t) | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| template<typename Type> | |
| static std::string | GetType () |
| Template-based getter for a type name. | |
| static const std::map< VariantTypeId, std::string > & | getTypes () |
| Returns the mapping of currently registered types. | |
| static int | hashTypeName (const std::string &typeName) |
| Compute and return a hash value for a given type name. | |
| static std::string | typeToString (VariantTypeId typeId) |
| Return the name of the registered type typeId. | |
Protected Member Functions | |
| void | output (std::ostream &stream) const |
| Outputs a formatted representation of the Variant to stream. | |
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 |
Construct a Variant from a string.
| var | The initialization value |
|
inline |
| Variant | ( | const std::int8_t & | var, |
| void * | ) |
| Variant | ( | const std::int16_t & | var, |
| void * | ) |
| Variant | ( | const std::int32_t & | var, |
| void * | ) |
| Variant | ( | const std::int64_t & | var, |
| void * | ) |
| Variant | ( | const std::uint8_t & | var, |
| void * | ) |
| Variant | ( | const std::uint16_t & | var, |
| void * | ) |
| Variant | ( | const std::uint32_t & | var, |
| void * | ) |
| Variant | ( | const std::uint64_t & | var, |
| void * | ) |
| Variant | ( | const double & | var, |
| void * | ) |
| Variant | ( | const bool & | var, |
| void * | ) |
| Variant | ( | const std::string & | var, |
| void * | ) |
| template Variant | ( | const std::int8_t & | var, |
| void * | t ) |
| template Variant | ( | const std::int16_t & | var, |
| void * | t ) |
| template Variant | ( | const std::int32_t & | var, |
| void * | t ) |
| template Variant | ( | const std::int64_t & | var, |
| void * | t ) |
| Variant | ( | const std::uint8_t & | var, |
| void * | t ) |
| template Variant | ( | const std::uint8_t & | var, |
| void * | t ) |
| template Variant | ( | const std::uint16_t & | var, |
| void * | t ) |
| template Variant | ( | const std::uint32_t & | var, |
| void * | t ) |
| template Variant | ( | const std::uint64_t & | var, |
| void * | t ) |
| template Variant | ( | const double & | var, |
| void * | t ) |
| template Variant | ( | const bool & | var, |
| void * | t ) |
| template Variant | ( | const std::string & | var, |
| void * | t ) |
|
static |
Register a new type for the use in a Variant.
| LocalException | if an already registered type has the same hash value as typeName. |
|
virtual |
Returns a copy of the Variant.
| 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 |
| bool get | ( | ) | const |
| float 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.
|
inline |
|
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.
|
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.
|
override |
Tells if the Variant is properly initialized.
|
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.
|
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.
|
virtual |
Returns the formatted content of the Variant as a string.
Reimplemented in TimedVariant.
|
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.
|
inlinestatic |
Template-based getter for a type name.
|
override |
Return the Variant's internal type.
|
override |
|
static |
Returns the mapping of currently registered types.
|
static |
Compute and return a hash value for a given type name.
|
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.
| 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 | ) |
|
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.
| InvalidTypeException |
|
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.
| void setClass | ( | const VariantDataClass & | variantDataClass | ) |
| void setClass | ( | const VariantDataClassPtr & | variantDataClass | ) |
|
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.
|
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.
|
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.
|
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.
|
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.
|
override |
|
static |
Return the name of the registered type typeId.
| UnknownTypeException | if typeId is not registered yet. |
|
override |
|
friend |
|
friend |
|
mutableprotected |