Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends
variant_topic_tools::MessageDataType Class Reference

Message data type. More...

#include <MessageDataType.h>

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

List of all members.

Classes

class  Impl
 Message data type implementation. More...
class  ImplT
 Message data type implementation (templated strong-typed version) More...
class  ImplV
 Message data type implementation (variant-typed version) More...

Public Member Functions

void addConstantMember (const MessageConstant &member)
 Add a constant member to this message data type (overloaded version taking a message constant)
MessageConstant addConstantMember (const std::string &name, const Variant &value)
 Add a constant member to this message data type (overloaded version taking a name and a variant value)
template<typename T >
MessageConstant addConstantMember (const std::string &name, const T &value)
 Add a constant member to this message data type (version templated on the value type)
void addVariableMember (const MessageVariable &member)
 Add a variable member to this message data type (overloaded version taking a message variable)
MessageVariable addVariableMember (const std::string &name, const DataType &type)
 Add a variable member to this message data type (overloaded version taking a name and a data type)
template<typename T >
MessageVariable addVariableMember (const std::string &name)
 Add a variable member to this message data type (version templated on the variable type)
const MessageConstantgetConstantMember (const std::string &name) const
 Access a constant member of the message data type by name.
const MessageConstantgetConstantMember (int index) const
 Access a constant member of the message data type by index.
const std::string & getDefinition () const
 Retrieve the definition this message data type.
std::string getMD5Sum () const
 Retrieve the MD5 sum of this message data type.
const MessageMembergetMember (const std::string &name) const
 Access a member of the message data type by name.
const MessageMembergetMember (int index) const
 Access a member of the message data type by index.
size_t getNumConstantMembers () const
 Retrieve the number of constant members of this message data type.
size_t getNumMembers () const
 Retrieve the number of members of this message data type.
size_t getNumVariableMembers () const
 Retrieve the number of variable members of this message data type.
const MessageVariablegetVariableMember (const std::string &name) const
 Access a variable member of the message data type by name.
const MessageVariablegetVariableMember (int index) const
 Access a variable member of the message data type by index.
bool hasConstantMember (const std::string &name) const
 True, if the message data type contains the constant member with the specified name.
bool hasHeader () const
 True, if this message data type has a header.
bool hasMember (const std::string &name) const
 True, if the message data type contains the member with the specified name.
bool hasVariableMember (const std::string &name) const
 True, if the message data type contains the variable member with the specified name.
 MessageDataType ()
 Default constructor.
 MessageDataType (const MessageDataType &src)
 Copy constructor.
 MessageDataType (const DataType &src)
 Copy constructor (overloaded version taking a data type)
MessageDataTypeoperator= (const DataType &src)
 Assignment operator.
const MessageMemberoperator[] (int index) const
 Operator for accessing the members of the message data type by index.
virtual ~MessageDataType ()
 Destructor.

Protected Member Functions

 MessageDataType (const std::string &identifier, const MessageFieldCollection< MessageConstant > &constantMembers, const MessageFieldCollection< MessageVariable > &variableMembers)
 Constructor (overloaded version taking an identifier, a sequence of constant members, and a sequence of variable members)
 MessageDataType (const std::string &identifier, const std::string &definition)
 Constructor (overloaded version taking an identifier and a definition)

Static Protected Member Functions

template<typename T , typename M >
static void addMember (MessageVariable &member, size_t offset, typename boost::enable_if< type_traits::IsArray< M > >::type *=0, typename boost::enable_if< typename type_traits::ArrayType< M >::IsDynamic >::type *=0)
 Add a variable message member (overloaded version for adding a dynamic array member)
template<typename T , typename M >
static void addMember (MessageVariable &member, size_t offset, typename boost::enable_if< type_traits::IsArray< M > >::type *=0, typename boost::disable_if< typename type_traits::ArrayType< M >::IsDynamic >::type *=0)
 Add a variable message member (overloaded version for adding a non-dynamic array member)
template<typename T , typename M >
static void addMember (MessageVariable &member, size_t offset, typename boost::disable_if< type_traits::IsArray< M > >::type *=0)
 Add a variable message member (overloaded version for adding a non-array member)
template<typename T >
static MessageDataType create ()
 Create a message data type (version templated on the message type)

Friends

class DataType
class DataTypeRegistry
class MessageVariant

Detailed Description

Message data type.

Definition at line 35 of file MessageDataType.h.


Constructor & Destructor Documentation

Default constructor.

Definition at line 37 of file MessageDataType.cpp.

Copy constructor.

Definition at line 53 of file MessageDataType.cpp.

Copy constructor (overloaded version taking a data type)

Definition at line 57 of file MessageDataType.cpp.

Destructor.

Definition at line 63 of file MessageDataType.cpp.

variant_topic_tools::MessageDataType::MessageDataType ( const std::string &  identifier,
const MessageFieldCollection< MessageConstant > &  constantMembers,
const MessageFieldCollection< MessageVariable > &  variableMembers 
) [protected]

Constructor (overloaded version taking an identifier, a sequence of constant members, and a sequence of variable members)

Definition at line 40 of file MessageDataType.cpp.

variant_topic_tools::MessageDataType::MessageDataType ( const std::string &  identifier,
const std::string &  definition 
) [protected]

Constructor (overloaded version taking an identifier and a definition)

Definition at line 47 of file MessageDataType.cpp.


Member Function Documentation

Add a constant member to this message data type (overloaded version taking a message constant)

Definition at line 354 of file MessageDataType.cpp.

MessageConstant variant_topic_tools::MessageDataType::addConstantMember ( const std::string &  name,
const Variant value 
)

Add a constant member to this message data type (overloaded version taking a name and a variant value)

Definition at line 361 of file MessageDataType.cpp.

template<typename T >
MessageConstant variant_topic_tools::MessageDataType::addConstantMember ( const std::string &  name,
const T &  value 
)

Add a constant member to this message data type (version templated on the value type)

template<typename T , typename M >
static void variant_topic_tools::MessageDataType::addMember ( MessageVariable member,
size_t  offset,
typename boost::enable_if< type_traits::IsArray< M > >::type *  = 0,
typename boost::enable_if< typename type_traits::ArrayType< M >::IsDynamic >::type *  = 0 
) [static, protected]

Add a variable message member (overloaded version for adding a dynamic array member)

template<typename T , typename M >
static void variant_topic_tools::MessageDataType::addMember ( MessageVariable member,
size_t  offset,
typename boost::enable_if< type_traits::IsArray< M > >::type *  = 0,
typename boost::disable_if< typename type_traits::ArrayType< M >::IsDynamic >::type *  = 0 
) [static, protected]

Add a variable message member (overloaded version for adding a non-dynamic array member)

template<typename T , typename M >
static void variant_topic_tools::MessageDataType::addMember ( MessageVariable member,
size_t  offset,
typename boost::disable_if< type_traits::IsArray< M > >::type *  = 0 
) [static, protected]

Add a variable message member (overloaded version for adding a non-array member)

Add a variable member to this message data type (overloaded version taking a message variable)

Definition at line 369 of file MessageDataType.cpp.

MessageVariable variant_topic_tools::MessageDataType::addVariableMember ( const std::string &  name,
const DataType type 
)

Add a variable member to this message data type (overloaded version taking a name and a data type)

Definition at line 376 of file MessageDataType.cpp.

template<typename T >
MessageVariable variant_topic_tools::MessageDataType::addVariableMember ( const std::string &  name)

Add a variable member to this message data type (version templated on the variable type)

template<typename T >
static MessageDataType variant_topic_tools::MessageDataType::create ( ) [static, protected]

Create a message data type (version templated on the message type)

const MessageConstant & variant_topic_tools::MessageDataType::getConstantMember ( const std::string &  name) const

Access a constant member of the message data type by name.

Definition at line 248 of file MessageDataType.cpp.

Access a constant member of the message data type by index.

Definition at line 257 of file MessageDataType.cpp.

Retrieve the definition this message data type.

Definition at line 194 of file MessageDataType.cpp.

Retrieve the MD5 sum of this message data type.

Definition at line 187 of file MessageDataType.cpp.

const MessageMember & variant_topic_tools::MessageDataType::getMember ( const std::string &  name) const

Access a member of the message data type by name.

Definition at line 223 of file MessageDataType.cpp.

Access a member of the message data type by index.

Definition at line 235 of file MessageDataType.cpp.

Retrieve the number of constant members of this message data type.

Definition at line 207 of file MessageDataType.cpp.

Retrieve the number of members of this message data type.

Definition at line 203 of file MessageDataType.cpp.

Retrieve the number of variable members of this message data type.

Definition at line 215 of file MessageDataType.cpp.

const MessageVariable & variant_topic_tools::MessageDataType::getVariableMember ( const std::string &  name) const

Access a variable member of the message data type by name.

Definition at line 265 of file MessageDataType.cpp.

Access a variable member of the message data type by index.

Definition at line 274 of file MessageDataType.cpp.

bool variant_topic_tools::MessageDataType::hasConstantMember ( const std::string &  name) const

True, if the message data type contains the constant member with the specified name.

Definition at line 286 of file MessageDataType.cpp.

True, if this message data type has a header.

Definition at line 302 of file MessageDataType.cpp.

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

True, if the message data type contains the member with the specified name.

Definition at line 282 of file MessageDataType.cpp.

bool variant_topic_tools::MessageDataType::hasVariableMember ( const std::string &  name) const

True, if the message data type contains the variable member with the specified name.

Definition at line 294 of file MessageDataType.cpp.

MessageDataType & variant_topic_tools::MessageDataType::operator= ( const DataType src) [virtual]

Assignment operator.

Reimplemented from variant_topic_tools::DataType.

Definition at line 473 of file MessageDataType.cpp.

const MessageMember & variant_topic_tools::MessageDataType::operator[] ( int  index) const

Operator for accessing the members of the message data type by index.

Definition at line 482 of file MessageDataType.cpp.


Friends And Related Function Documentation

friend class DataType [friend]

Definition at line 37 of file MessageDataType.h.

friend class DataTypeRegistry [friend]

Reimplemented from variant_topic_tools::DataType.

Definition at line 38 of file MessageDataType.h.

friend class MessageVariant [friend]

Definition at line 39 of file MessageDataType.h.


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


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