Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Friends | List of all members
variant_topic_tools::MessageDataType Class Reference

Message data type. More...

#include <MessageDataType.h>

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

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) More...
 
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) More...
 
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) More...
 
void addVariableMember (const MessageVariable &member)
 Add a variable member to this message data type (overloaded version taking a message variable) More...
 
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) More...
 
template<typename T >
MessageVariable addVariableMember (const std::string &name)
 Add a variable member to this message data type (version templated on the variable type) More...
 
const MessageConstantgetConstantMember (const std::string &name) const
 Access a constant member of the message data type by name. More...
 
const MessageConstantgetConstantMember (int index) const
 Access a constant member of the message data type by index. More...
 
const std::string & getDefinition () const
 Retrieve the definition this message data type. More...
 
std::string getMD5Sum () const
 Retrieve the MD5 sum of this message data type. More...
 
const MessageMembergetMember (const std::string &name) const
 Access a member of the message data type by name. More...
 
const MessageMembergetMember (int index) const
 Access a member of the message data type by index. More...
 
size_t getNumConstantMembers () const
 Retrieve the number of constant members of this message data type. More...
 
size_t getNumMembers () const
 Retrieve the number of members of this message data type. More...
 
size_t getNumVariableMembers () const
 Retrieve the number of variable members of this message data type. More...
 
const MessageVariablegetVariableMember (const std::string &name) const
 Access a variable member of the message data type by name. More...
 
const MessageVariablegetVariableMember (int index) const
 Access a variable member of the message data type by index. More...
 
bool hasConstantMember (const std::string &name) const
 True, if the message data type contains the constant member with the specified name. More...
 
bool hasHeader () const
 True, if this message data type has a header. More...
 
bool hasMember (const std::string &name) const
 True, if the message data type contains the member with the specified name. More...
 
bool hasVariableMember (const std::string &name) const
 True, if the message data type contains the variable member with the specified name. More...
 
 MessageDataType ()
 Default constructor. More...
 
 MessageDataType (const MessageDataType &src)
 Copy constructor. More...
 
 MessageDataType (const DataType &src)
 Copy constructor (overloaded version taking a data type) More...
 
MessageDataTypeoperator= (const DataType &src)
 Assignment operator. More...
 
const MessageMemberoperator[] (int index) const
 Operator for accessing the members of the message data type by index. More...
 
virtual ~MessageDataType ()
 Destructor. More...
 
- Public Member Functions inherited from variant_topic_tools::DataType
void clear ()
 Clear the data type. More...
 
Serializer createSerializer () const
 Create a serializer for this data type. More...
 
Variant createVariant () const
 Create a variant from this data type. More...
 
 DataType ()
 Default constructor. More...
 
 DataType (const char *identifier)
 Constructor (overloaded version taking an identifier) More...
 
 DataType (const std::string &identifier)
 Constructor (overloaded version taking a string identifier) More...
 
 DataType (const std::type_info &typeInfo)
 Constructor (overloaded version taking type information) More...
 
 DataType (const DataType &src)
 Copy constructor. More...
 
const std::string & getIdentifier () const
 Retrieve the identifier representing this data type. More...
 
size_t getSize () const
 Retrieve the size of the instances of this data type. More...
 
const std::type_info & getTypeInfo () const
 Retrieve the type information associated with this data type. More...
 
bool hasTypeInfo () const
 True, if this data type has type information. More...
 
bool isArray () const
 True, if this data type represents an array type. More...
 
bool isBuiltin () const
 True, if this data type represents a built-in type. More...
 
bool isFixedSize () const
 True, if this data type represents a fixed-size data type, as opposed to a variable-size data type. More...
 
bool isMessage () const
 True, if this data type represents a message type. More...
 
bool isSimple () const
 True, if this data type represents a simple data type, i.e., a data type such that an array of its instances can safely be shallow copied. More...
 
bool isValid () const
 True, if this data type is valid. More...
 
 operator void * () const
 Void pointer conversion. More...
 
bool operator!= (const DataType &dataType) const
 Inequality comparison operator. More...
 
bool operator== (const DataType &dataType) const
 Equality comparison operator. More...
 
void write (std::ostream &stream) const
 Write the data type to a stream. More...
 
virtual ~DataType ()
 Destructor. More...
 

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) More...
 
 MessageDataType (const std::string &identifier, const std::string &definition)
 Constructor (overloaded version taking an identifier and a definition) More...
 

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) More...
 
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) More...
 
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) More...
 
template<typename T >
static MessageDataType create ()
 Create a message data type (version templated on the message type) More...
 

Friends

class DataType
 
class DataTypeRegistry
 
class MessageVariant
 

Additional Inherited Members

- Protected Types inherited from variant_topic_tools::DataType
typedef boost::shared_ptr< boost::shared_ptr< Impl > > ImplPtr
 Declaration of the data type implementation pointer type. More...
 
typedef boost::shared_ptr< boost::weak_ptr< Impl > > ImplWPtr
 Declaration of the data type implementation weak pointer type. More...
 
- Protected Attributes inherited from variant_topic_tools::DataType
ImplPtr impl
 The data type's implementation adapter. More...
 

Detailed Description

Message data type.

Definition at line 35 of file MessageDataType.h.

Constructor & Destructor Documentation

variant_topic_tools::MessageDataType::MessageDataType ( )

Default constructor.

Definition at line 37 of file MessageDataType.cpp.

variant_topic_tools::MessageDataType::MessageDataType ( const MessageDataType src)

Copy constructor.

Definition at line 53 of file MessageDataType.cpp.

variant_topic_tools::MessageDataType::MessageDataType ( const DataType src)

Copy constructor (overloaded version taking a data type)

Definition at line 57 of file MessageDataType.cpp.

variant_topic_tools::MessageDataType::~MessageDataType ( )
virtual

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

void variant_topic_tools::MessageDataType::addConstantMember ( const MessageConstant member)

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 
)
staticprotected

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 
)
staticprotected

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 
)
staticprotected

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

void variant_topic_tools::MessageDataType::addVariableMember ( const MessageVariable 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 ( )
staticprotected

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.

const MessageConstant & variant_topic_tools::MessageDataType::getConstantMember ( int  index) const

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

Definition at line 257 of file MessageDataType.cpp.

const std::string & variant_topic_tools::MessageDataType::getDefinition ( ) const

Retrieve the definition this message data type.

Definition at line 194 of file MessageDataType.cpp.

std::string variant_topic_tools::MessageDataType::getMD5Sum ( ) const

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.

const MessageMember & variant_topic_tools::MessageDataType::getMember ( int  index) const

Access a member of the message data type by index.

Definition at line 235 of file MessageDataType.cpp.

size_t variant_topic_tools::MessageDataType::getNumConstantMembers ( ) const

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

Definition at line 207 of file MessageDataType.cpp.

size_t variant_topic_tools::MessageDataType::getNumMembers ( ) const

Retrieve the number of members of this message data type.

Definition at line 203 of file MessageDataType.cpp.

size_t variant_topic_tools::MessageDataType::getNumVariableMembers ( ) const

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.

const MessageVariable & variant_topic_tools::MessageDataType::getVariableMember ( int  index) const

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.

bool variant_topic_tools::MessageDataType::hasHeader ( ) const

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

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 Sat Jan 9 2021 03:56:50