Classes | Public Member Functions | Protected Member Functions | Friends
variant_topic_tools::CollectionVariant Class Reference

Collection variant type. More...

#include <CollectionVariant.h>

Inheritance diagram for variant_topic_tools::CollectionVariant:
Inheritance graph
[legend]

List of all members.

Classes

class  Value
 Collection variant value (abstract base) More...

Public Member Functions

 CollectionVariant ()
 Default constructor.
 CollectionVariant (const CollectionVariant &src)
 Copy constructor.
 CollectionVariant (const Variant &src)
 Copy constructor (overloaded version taking a variant)
Variant getMember (int index) const
 Retrieve a member of the collection by index.
Variant getMember (const std::string &name) const
 Retrieve a member of the collection by name.
size_t getNumMembers () const
 Retrieve the number of members of the collection.
template<typename T >
T & getValue (int index)
 Retrieve a member value of the collection by index (non-const version)
template<typename T >
const T & getValue (int index) const
 Retrieve a member value of the collection by index (const version)
template<typename T >
T & getValue (const std::string &name)
 Retrieve a member value of the collection by name (non-const version)
template<typename T >
const T & getValue (const std::string &name) const
 Retrieve a member value of the collection by name (const version)
bool hasMember (const std::string &name) const
 True, if the collection contains the member with the specified name.
bool isEmpty () const
 True, if the collection is empty.
Variant operator[] (int index) const
 Operator for retrieving the members of the collection by index.
Variant operator[] (const char *name) const
 Operator for retrieving the members of the collection by name (overloaded version taking a char array name)
void setMember (int index, const Variant &member)
 Set a member of the collection by index.
void setMember (const std::string &name, const Variant &member)
 Set a member of the collection by name.
 ~CollectionVariant ()
 Destructor.

Protected Member Functions

 CollectionVariant (const DataType &type)
 Constructor (overloaded version taking a data type)

Friends

class Variant

Detailed Description

Collection variant type.

Definition at line 31 of file CollectionVariant.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 30 of file CollectionVariant.cpp.

Copy constructor.

Definition at line 37 of file CollectionVariant.cpp.

Copy constructor (overloaded version taking a variant)

Definition at line 41 of file CollectionVariant.cpp.

Destructor.

Definition at line 47 of file CollectionVariant.cpp.

Constructor (overloaded version taking a data type)

Definition at line 33 of file CollectionVariant.cpp.


Member Function Documentation

Retrieve a member of the collection by index.

Definition at line 82 of file CollectionVariant.cpp.

Variant variant_topic_tools::CollectionVariant::getMember ( const std::string &  name) const

Retrieve a member of the collection by name.

Definition at line 89 of file CollectionVariant.cpp.

Retrieve the number of members of the collection.

Definition at line 60 of file CollectionVariant.cpp.

template<typename T >
T& variant_topic_tools::CollectionVariant::getValue ( int  index)

Retrieve a member value of the collection by index (non-const version)

template<typename T >
const T& variant_topic_tools::CollectionVariant::getValue ( int  index) const

Retrieve a member value of the collection by index (const version)

template<typename T >
T& variant_topic_tools::CollectionVariant::getValue ( const std::string &  name)

Retrieve a member value of the collection by name (non-const version)

template<typename T >
const T& variant_topic_tools::CollectionVariant::getValue ( const std::string &  name) const

Retrieve a member value of the collection by name (const version)

bool variant_topic_tools::CollectionVariant::hasMember ( const std::string &  name) const

True, if the collection contains the member with the specified name.

Definition at line 96 of file CollectionVariant.cpp.

True, if the collection is empty.

Reimplemented from variant_topic_tools::Variant.

Definition at line 103 of file CollectionVariant.cpp.

Variant variant_topic_tools::CollectionVariant::operator[] ( int  index) const

Operator for retrieving the members of the collection by index.

Definition at line 214 of file CollectionVariant.cpp.

Variant variant_topic_tools::CollectionVariant::operator[] ( const char *  name) const

Operator for retrieving the members of the collection by name (overloaded version taking a char array name)

Definition at line 218 of file CollectionVariant.cpp.

void variant_topic_tools::CollectionVariant::setMember ( int  index,
const Variant member 
)

Set a member of the collection by index.

Definition at line 67 of file CollectionVariant.cpp.

void variant_topic_tools::CollectionVariant::setMember ( const std::string &  name,
const Variant member 
)

Set a member of the collection by name.

Definition at line 74 of file CollectionVariant.cpp.


Friends And Related Function Documentation

friend class Variant [friend]

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


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Fri Aug 5 2016 06:06:27