#include <Variant.h>
Classes | |
class | Value |
Variant value (abstract base) More... | |
class | ValueT |
Variant value (templated abstract base) More... | |
Public Member Functions | |
ArrayVariant | asArray () const |
Retrieve this variant as array. More... | |
BuiltinVariant | asBuiltin () const |
Retrieve this variant as builtin. More... | |
CollectionVariant | asCollection () const |
Retrieve this variant as collection. More... | |
MessageVariant | asMessage () const |
Retrieve this variant as message. More... | |
void | clear () |
Clear the variant. More... | |
Serializer | createSerializer () const |
Create a serializer for this variant. More... | |
const DataType & | getType () const |
Retrieve the data type of this variant. More... | |
template<typename T > | |
type_traits::DataType< T >::ValueType & | getValue () |
Retrieve the variant's value (non-const version) More... | |
template<typename T > | |
const type_traits::DataType< T >::ValueType & | getValue () const |
Retrieve the variant's value (const version) More... | |
const std::type_info & | getValueTypeInfo () const |
Retrieve the value type information of this variant. More... | |
bool | hasType () const |
True, if the variant has a type. More... | |
bool | isArray () const |
True, if this variant represents an array. More... | |
bool | isBuiltin () const |
True, if this variant represents a built-in. More... | |
bool | isCollection () const |
True, if this variant represents a collection. More... | |
bool | isEmpty () const |
True, if the variant is empty, i.e., does not have a value assigned. More... | |
bool | isMessage () const |
True, if this variant represents a message. More... | |
template<typename T > | |
operator T () const | |
Conversion operator. More... | |
template<typename T > | |
bool | operator!= (const T &value) const |
True, if this variant's value does not equal another value. More... | |
template<typename T > | |
Variant & | operator= (const T &src) |
Assignment operator. More... | |
template<typename T > | |
bool | operator== (const T &value) const |
True, if this variant's value equals another value. More... | |
void | read (std::istream &stream) |
Read the variant from a stream. More... | |
template<typename T > | |
void | setValue (const T &value) |
Set the variant's value. More... | |
Variant () | |
Default constructor. More... | |
template<typename T > | |
Variant (const T &src) | |
Copy constructor. More... | |
void | write (std::ostream &stream) const |
Write the variant to a stream. More... | |
~Variant () | |
Destructor. More... | |
Protected Types | |
typedef boost::shared_ptr< Value > | ValuePtr |
Declaration of the variant value pointer type. More... | |
typedef boost::weak_ptr< Value > | ValueWPtr |
Declaration of the variant value weak pointer type. More... | |
Protected Member Functions | |
Variant (const DataType &type) | |
Constructor (overloaded version taking a data type) More... | |
Static Protected Member Functions | |
template<typename T > | |
static void | assign (Variant &dst, const T &src, typename boost::enable_if< boost::is_base_of< Variant, T > >::type *=0) |
Assign a variant (overloaded version taking a variant) More... | |
template<typename T > | |
static void | assign (Variant &dst, const T &src, typename boost::disable_if< boost::is_base_of< Variant, T > >::type *=0) |
Assign a variant (overloaded version taking a variant value) More... | |
template<typename T > | |
static bool | isEqual (const Variant &variant, const T &value, typename boost::enable_if< boost::is_base_of< Variant, T > >::type *=0) |
True, if a variant's value equals another value (overloaded version taking a variant) More... | |
template<typename T > | |
static bool | isEqual (const Variant &variant, const T &value, typename boost::disable_if< boost::is_base_of< Variant, T > >::type *=0) |
True, if a variant's value equals another value (overloaded version taking a variant value) More... | |
template<typename T > | |
static void | set (Variant &variant, const Pointer< typename type_traits::DataType< T >::ValueType > &value) |
Set a variant's value pointer. More... | |
template<typename T > | |
static void | setValue (Variant &dst, const T &value, typename boost::enable_if< boost::is_base_of< Variant, T > >::type *=0) |
Set a variant's value (overloaded version taking a variant) More... | |
template<typename T > | |
static void | setValue (Variant &dst, const T &value, typename boost::disable_if< boost::is_base_of< Variant, T > >::type *=0) |
Set a variant's value (overloaded version taking a variant value) More... | |
Protected Attributes | |
DataType | type |
The variant's data type. More... | |
ValuePtr | value |
The variant's data value. More... | |
Friends | |
class | MessageVariable |
|
protected |
|
protected |
variant_topic_tools::Variant::Variant | ( | ) |
Default constructor.
Definition at line 32 of file Variant.cpp.
variant_topic_tools::Variant::Variant | ( | const T & | src | ) |
Copy constructor.
variant_topic_tools::Variant::~Variant | ( | ) |
Destructor.
Definition at line 39 of file Variant.cpp.
|
protected |
Constructor (overloaded version taking a data type)
Definition at line 35 of file Variant.cpp.
ArrayVariant variant_topic_tools::Variant::asArray | ( | ) | const |
Retrieve this variant as array.
Definition at line 107 of file Variant.cpp.
BuiltinVariant variant_topic_tools::Variant::asBuiltin | ( | ) | const |
Retrieve this variant as builtin.
Definition at line 111 of file Variant.cpp.
CollectionVariant variant_topic_tools::Variant::asCollection | ( | ) | const |
Retrieve this variant as collection.
Definition at line 115 of file Variant.cpp.
MessageVariant variant_topic_tools::Variant::asMessage | ( | ) | const |
Retrieve this variant as message.
Definition at line 119 of file Variant.cpp.
|
staticprotected |
Assign a variant (overloaded version taking a variant)
|
staticprotected |
Assign a variant (overloaded version taking a variant value)
void variant_topic_tools::Variant::clear | ( | ) |
Clear the variant.
Definition at line 123 of file Variant.cpp.
Serializer variant_topic_tools::Variant::createSerializer | ( | ) | const |
Create a serializer for this variant.
Definition at line 138 of file Variant.cpp.
const DataType & variant_topic_tools::Variant::getType | ( | ) | const |
Retrieve the data type of this variant.
Definition at line 52 of file Variant.cpp.
type_traits::DataType<T>::ValueType& variant_topic_tools::Variant::getValue | ( | ) |
Retrieve the variant's value (non-const version)
const type_traits::DataType<T>::ValueType& variant_topic_tools::Variant::getValue | ( | ) | const |
Retrieve the variant's value (const version)
const std::type_info & variant_topic_tools::Variant::getValueTypeInfo | ( | ) | const |
Retrieve the value type information of this variant.
Definition at line 56 of file Variant.cpp.
bool variant_topic_tools::Variant::hasType | ( | ) | const |
True, if the variant has a type.
Definition at line 63 of file Variant.cpp.
bool variant_topic_tools::Variant::isArray | ( | ) | const |
True, if this variant represents an array.
Definition at line 67 of file Variant.cpp.
bool variant_topic_tools::Variant::isBuiltin | ( | ) | const |
True, if this variant represents a built-in.
Definition at line 74 of file Variant.cpp.
bool variant_topic_tools::Variant::isCollection | ( | ) | const |
True, if this variant represents a collection.
Definition at line 81 of file Variant.cpp.
bool variant_topic_tools::Variant::isEmpty | ( | ) | const |
True, if the variant is empty, i.e., does not have a value assigned.
Definition at line 95 of file Variant.cpp.
|
staticprotected |
True, if a variant's value equals another value (overloaded version taking a variant)
|
staticprotected |
True, if a variant's value equals another value (overloaded version taking a variant value)
bool variant_topic_tools::Variant::isMessage | ( | ) | const |
True, if this variant represents a message.
Definition at line 88 of file Variant.cpp.
variant_topic_tools::Variant::operator T | ( | ) | const |
Conversion operator.
bool variant_topic_tools::Variant::operator!= | ( | const T & | value | ) | const |
True, if this variant's value does not equal another value.
Variant& variant_topic_tools::Variant::operator= | ( | const T & | src | ) |
Assignment operator.
bool variant_topic_tools::Variant::operator== | ( | const T & | value | ) | const |
True, if this variant's value equals another value.
void variant_topic_tools::Variant::read | ( | std::istream & | stream | ) |
Read the variant from a stream.
Definition at line 128 of file Variant.cpp.
|
staticprotected |
Set a variant's value pointer.
void variant_topic_tools::Variant::setValue | ( | const T & | value | ) |
Set the variant's value.
|
staticprotected |
Set a variant's value (overloaded version taking a variant)
|
staticprotected |
Set a variant's value (overloaded version taking a variant value)
void variant_topic_tools::Variant::write | ( | std::ostream & | stream | ) | const |
Write the variant to a stream.
Definition at line 133 of file Variant.cpp.
|
friend |
|
protected |
|
protected |