Collection variant value (abstract base) More...
#include <CollectionVariant.h>
Public Member Functions | |
virtual Variant | getMember (int index) const =0 |
Retrieve a member of the collection by index (abstract declaration) | |
virtual Variant | getMember (const std::string &name) const =0 |
Retrieve a member of the collection by name (abstract declaration) | |
Variant | getMember (const std::string &name, size_t pos) const |
Recursively retrieve a member of the collection by name. | |
virtual size_t | getNumMembers () const =0 |
Retrieve the number of members of the collection (abstract declaration) | |
virtual bool | hasMember (const std::string &name) const =0 |
True, if the collection contains the member with the specified name (abstract declaration) | |
bool | hasMember (const std::string &name, size_t pos) const |
True, if the collection or any of its members contains the member with the specified name. | |
bool | isEqual (const Variant::Value &value) const |
True, if this variant value equals another variant value (implementation) | |
void | read (std::istream &stream) |
Read the variant from a stream (implementation) | |
virtual void | setMember (int index, const Variant &member)=0 |
Set a member of the collection by index (abstract declaration) | |
virtual void | setMember (const std::string &name, const Variant &member)=0 |
Set a member of the collection by name (abstract declaration) | |
void | setMember (const std::string &name, const Variant &member, size_t pos) |
Recursively set a member of the collection by name. | |
Value () | |
Default constructor. | |
void | write (std::ostream &stream) const |
Write this variant value to a stream (implementation) | |
virtual void | writeMember (std::ostream &stream, int index) const =0 |
Write the collection member with the specified index to a stream (abstract declaration) | |
virtual | ~Value () |
Destructor. |
Collection variant value (abstract base)
Definition at line 115 of file CollectionVariant.h.
Default constructor.
Reimplemented from variant_topic_tools::Variant::Value.
Reimplemented in variant_topic_tools::ArrayVariant::Value, and variant_topic_tools::MessageVariant::Value.
Definition at line 50 of file CollectionVariant.cpp.
variant_topic_tools::CollectionVariant::Value::~Value | ( | ) | [virtual] |
Destructor.
Reimplemented from variant_topic_tools::Variant::Value.
Reimplemented in variant_topic_tools::ArrayVariant::Value, and variant_topic_tools::MessageVariant::Value.
Definition at line 53 of file CollectionVariant.cpp.
virtual Variant variant_topic_tools::CollectionVariant::Value::getMember | ( | int | index | ) | const [pure virtual] |
Retrieve a member of the collection by index (abstract declaration)
Implemented in variant_topic_tools::ArrayVariant::ValueImplT< T >, variant_topic_tools::MessageVariant::ValueImplT< T >, variant_topic_tools::ArrayVariant::ValueImplV, and variant_topic_tools::MessageVariant::ValueImplV.
virtual Variant variant_topic_tools::CollectionVariant::Value::getMember | ( | const std::string & | name | ) | const [pure virtual] |
Retrieve a member of the collection by name (abstract declaration)
Implemented in variant_topic_tools::MessageVariant::ValueImplT< T >, variant_topic_tools::MessageVariant::ValueImplV, and variant_topic_tools::ArrayVariant::Value.
Variant variant_topic_tools::CollectionVariant::Value::getMember | ( | const std::string & | name, |
size_t | pos | ||
) | const |
Recursively retrieve a member of the collection by name.
Definition at line 136 of file CollectionVariant.cpp.
virtual size_t variant_topic_tools::CollectionVariant::Value::getNumMembers | ( | ) | const [pure virtual] |
Retrieve the number of members of the collection (abstract declaration)
Implemented in variant_topic_tools::ArrayVariant::ValueImplT< T >, variant_topic_tools::MessageVariant::ValueImplT< T >, variant_topic_tools::ArrayVariant::ValueImplV, and variant_topic_tools::MessageVariant::ValueImplV.
virtual bool variant_topic_tools::CollectionVariant::Value::hasMember | ( | const std::string & | name | ) | const [pure virtual] |
True, if the collection contains the member with the specified name (abstract declaration)
Implemented in variant_topic_tools::MessageVariant::ValueImplT< T >, variant_topic_tools::MessageVariant::ValueImplV, and variant_topic_tools::ArrayVariant::Value.
bool variant_topic_tools::CollectionVariant::Value::hasMember | ( | const std::string & | name, |
size_t | pos | ||
) | const |
True, if the collection or any of its members contains the member with the specified name.
Definition at line 158 of file CollectionVariant.cpp.
bool variant_topic_tools::CollectionVariant::Value::isEqual | ( | const Variant::Value & | value | ) | const [virtual] |
True, if this variant value equals another variant value (implementation)
Implements variant_topic_tools::Variant::Value.
Definition at line 180 of file CollectionVariant.cpp.
void variant_topic_tools::CollectionVariant::Value::read | ( | std::istream & | stream | ) | [virtual] |
Read the variant from a stream (implementation)
Implements variant_topic_tools::Variant::Value.
Definition at line 198 of file CollectionVariant.cpp.
virtual void variant_topic_tools::CollectionVariant::Value::setMember | ( | int | index, |
const Variant & | member | ||
) | [pure virtual] |
Set a member of the collection by index (abstract declaration)
Implemented in variant_topic_tools::ArrayVariant::ValueImplT< T >, variant_topic_tools::MessageVariant::ValueImplT< T >, variant_topic_tools::ArrayVariant::ValueImplV, and variant_topic_tools::MessageVariant::ValueImplV.
virtual void variant_topic_tools::CollectionVariant::Value::setMember | ( | const std::string & | name, |
const Variant & | member | ||
) | [pure virtual] |
Set a member of the collection by name (abstract declaration)
Implemented in variant_topic_tools::MessageVariant::ValueImplT< T >, variant_topic_tools::MessageVariant::ValueImplV, and variant_topic_tools::ArrayVariant::Value.
void variant_topic_tools::CollectionVariant::Value::setMember | ( | const std::string & | name, |
const Variant & | member, | ||
size_t | pos | ||
) |
Recursively set a member of the collection by name.
Definition at line 110 of file CollectionVariant.cpp.
void variant_topic_tools::CollectionVariant::Value::write | ( | std::ostream & | stream | ) | const [virtual] |
Write this variant value to a stream (implementation)
Implements variant_topic_tools::Variant::Value.
Definition at line 202 of file CollectionVariant.cpp.
virtual void variant_topic_tools::CollectionVariant::Value::writeMember | ( | std::ostream & | stream, |
int | index | ||
) | const [pure virtual] |
Write the collection member with the specified index to a stream (abstract declaration)
Implemented in variant_topic_tools::ArrayVariant::Value, and variant_topic_tools::MessageVariant::Value.