Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
variant_topic_tools::MessageFieldCollection< T > Class Template Reference

Templated message field collection. More...

#include <MessageFieldCollection.h>

Inheritance diagram for variant_topic_tools::MessageFieldCollection< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

void appendField (const MessageField< T > &field)
 Append a field to the message field collection.
void appendField (const std::string &name, const T &value=T())
 Append a field to the message field collection (overloaded version taking a field name and a field value)
virtual void clear ()
 Clear the message field collection.
MessageField< T > & getField (int index)
 Retrieve a field of the message field collection by index (non-const version)
const MessageField< T > & getField (int index) const
 Retrieve a field of the message field collection by index (const version)
MessageField< T > & getField (const std::string &name)
 Retrieve a field of the message field collection by name (non-const version)
const MessageField< T > & getField (const std::string &name) const
 Retrieve a field of the message field collection by name (const version)
size_t getNumFields () const
 Retrieve the number of fields of the message field collection.
bool hasField (const std::string &name) const
 True, if the message field collection contains the field with the specified name.
bool isEmpty () const
 True, if the message field collections is empty.
void merge (const MessageFieldCollection< T > &collection)
 Merge this message field collection with another message field collection.
 MessageFieldCollection ()
 Default constructor.
 MessageFieldCollection (const MessageFieldCollection< T > &src)
 Copy constructor.
bool operator!= (const MessageFieldCollection< T > &collection) const
 True, if this message field collection is not equal to another message field collection.
MessageFieldCollection< T > & operator+= (const MessageField< T > &field)
 Operator for appending a field to the message field collection.
bool operator== (const MessageFieldCollection< T > &collection) const
 True, if this message field collection is equal to another message field collection.
MessageField< T > & operator[] (int index)
 Operator for retrieving the fields of the message field collection by index (non-const version)
const MessageField< T > & operator[] (int index) const
 Operator for retrieving the fields of the message field collection by index (const version)
MessageField< T > & operator[] (const std::string &name)
 Operator for retrieving the fields of the message field collection by name (non-const version)
const MessageField< T > & operator[] (const std::string &name) const
 Operator for retrieving the fields of the message field collection by name (const version)
virtual void write (std::ostream &stream, const std::string &indent=std::string()) const
 Write the message field collection to a stream.
virtual ~MessageFieldCollection ()
 Destructor.

Protected Types

typedef boost::shared_ptr
< MessageField< T > > 
MessageFieldPtr
 Declaration of the message field pointer type.
typedef boost::weak_ptr
< MessageField< T > > 
MessageFieldWPtr
 Declaration of the message field weak pointer type.

Protected Member Functions

MessageField< T > & getField (const std::string &name, size_t pos) const
 Recursively retrieve a field of the message field collection by name.
bool hasField (const std::string &name, size_t pos) const
 True, if the message field collection or any of its fields contains the field with the specified name.

Protected Attributes

boost::unordered_map
< std::string, MessageFieldPtr
fieldsByName
 The message fields of the collection by name.
std::vector< MessageFieldPtrfieldsInOrder
 The message fields of the collection in order.

Detailed Description

template<typename T>
class variant_topic_tools::MessageFieldCollection< T >

Templated message field collection.

Definition at line 37 of file MessageFieldCollection.h.


Member Typedef Documentation

template<typename T>
typedef boost::shared_ptr<MessageField<T> > variant_topic_tools::MessageFieldCollection< T >::MessageFieldPtr [protected]

Declaration of the message field pointer type.

Definition at line 144 of file MessageFieldCollection.h.

template<typename T>
typedef boost::weak_ptr<MessageField<T> > variant_topic_tools::MessageFieldCollection< T >::MessageFieldWPtr [protected]

Declaration of the message field weak pointer type.

Definition at line 148 of file MessageFieldCollection.h.


Constructor & Destructor Documentation

Default constructor.

Copy constructor.

template<typename T>
virtual variant_topic_tools::MessageFieldCollection< T >::~MessageFieldCollection ( ) [virtual]

Destructor.


Member Function Documentation

template<typename T>
void variant_topic_tools::MessageFieldCollection< T >::appendField ( const MessageField< T > &  field)

Append a field to the message field collection.

template<typename T>
void variant_topic_tools::MessageFieldCollection< T >::appendField ( const std::string &  name,
const T &  value = T() 
)

Append a field to the message field collection (overloaded version taking a field name and a field value)

template<typename T>
virtual void variant_topic_tools::MessageFieldCollection< T >::clear ( ) [virtual]

Clear the message field collection.

Reimplemented in variant_topic_tools::MessageDefinition, and variant_topic_tools::MessageField< T >.

template<typename T>
MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::getField ( int  index)

Retrieve a field of the message field collection by index (non-const version)

template<typename T>
const MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::getField ( int  index) const

Retrieve a field of the message field collection by index (const version)

template<typename T>
MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::getField ( const std::string &  name)

Retrieve a field of the message field collection by name (non-const version)

template<typename T>
const MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::getField ( const std::string &  name) const

Retrieve a field of the message field collection by name (const version)

template<typename T>
MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::getField ( const std::string &  name,
size_t  pos 
) const [protected]

Recursively retrieve a field of the message field collection by name.

template<typename T>
size_t variant_topic_tools::MessageFieldCollection< T >::getNumFields ( ) const

Retrieve the number of fields of the message field collection.

template<typename T>
bool variant_topic_tools::MessageFieldCollection< T >::hasField ( const std::string &  name) const

True, if the message field collection contains the field with the specified name.

template<typename T>
bool variant_topic_tools::MessageFieldCollection< T >::hasField ( const std::string &  name,
size_t  pos 
) const [protected]

True, if the message field collection or any of its fields contains the field with the specified name.

template<typename T>
bool variant_topic_tools::MessageFieldCollection< T >::isEmpty ( ) const

True, if the message field collections is empty.

template<typename T>
void variant_topic_tools::MessageFieldCollection< T >::merge ( const MessageFieldCollection< T > &  collection)

Merge this message field collection with another message field collection.

template<typename T>
bool variant_topic_tools::MessageFieldCollection< T >::operator!= ( const MessageFieldCollection< T > &  collection) const

True, if this message field collection is not equal to another message field collection.

template<typename T>
MessageFieldCollection<T>& variant_topic_tools::MessageFieldCollection< T >::operator+= ( const MessageField< T > &  field)

Operator for appending a field to the message field collection.

template<typename T>
bool variant_topic_tools::MessageFieldCollection< T >::operator== ( const MessageFieldCollection< T > &  collection) const

True, if this message field collection is equal to another message field collection.

template<typename T>
MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::operator[] ( int  index)

Operator for retrieving the fields of the message field collection by index (non-const version)

template<typename T>
const MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::operator[] ( int  index) const

Operator for retrieving the fields of the message field collection by index (const version)

template<typename T>
MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::operator[] ( const std::string &  name)

Operator for retrieving the fields of the message field collection by name (non-const version)

template<typename T>
const MessageField<T>& variant_topic_tools::MessageFieldCollection< T >::operator[] ( const std::string &  name) const

Operator for retrieving the fields of the message field collection by name (const version)

template<typename T>
virtual void variant_topic_tools::MessageFieldCollection< T >::write ( std::ostream &  stream,
const std::string &  indent = std::string() 
) const [virtual]

Write the message field collection to a stream.

Reimplemented in variant_topic_tools::MessageField< T >.


Member Data Documentation

template<typename T>
boost::unordered_map<std::string, MessageFieldPtr> variant_topic_tools::MessageFieldCollection< T >::fieldsByName [protected]

The message fields of the collection by name.

Definition at line 156 of file MessageFieldCollection.h.

template<typename T>
std::vector<MessageFieldPtr> variant_topic_tools::MessageFieldCollection< T >::fieldsInOrder [protected]

The message fields of the collection in order.

Definition at line 152 of file MessageFieldCollection.h.


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


variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Tue Jul 9 2019 03:18:42