Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
variant_topic_tools::MessageHeader Class Reference

Variant message header. More...

#include <MessageHeader.h>

Public Member Functions

const std::string & getField (const std::string &name) const
 Retrieve a field of the message header. More...
 
const std::string & getPublisher () const
 Retrieve the name of the publishing node. More...
 
const std::string & getTopic () const
 Retrieve the message publishing topic. More...
 
bool hasField (const std::string &name) const
 True, if the message header contains a field with the specified name. More...
 
bool isLatched () const
 True, if the message publication is latched. More...
 
 MessageHeader ()
 Default constructor. More...
 
 MessageHeader (const MessageHeader &src)
 Copy constructor. More...
 
std::string & operator[] (const std::string &name)
 Operator for retrieving a field of the message header (non-const version) More...
 
const std::string & operator[] (const std::string &name) const
 Operator for retrieving a field of the message header (const version) More...
 
void setField (const std::string &name, const std::string &value)
 Set a field of the message header. More...
 
void setLatched (bool latched)
 Set to true to indicate that the message publication is latched. More...
 
void setPublisher (const std::string &publisher)
 Set the name of the publishing node. More...
 
void setTopic (const std::string &topic)
 Set the message publishing topic. More...
 
 ~MessageHeader ()
 Destructor. More...
 

Protected Types

typedef std::map< std::string, std::string > Fields
 Definition of the fields type. More...
 
typedef boost::shared_ptr< std::map< std::string, std::string > > FieldsPtr
 Definition of the fields pointer type. More...
 

Protected Member Functions

 MessageHeader (const FieldsPtr &fields)
 Constructor (overloaded version taking a fields pointer) More...
 

Protected Attributes

FieldsPtr fields
 The fields of the message header. More...
 

Friends

class Message
 
class ros::serialization::PreDeserialize< Message >
 

Detailed Description

Variant message header.

Definition at line 33 of file MessageHeader.h.

Member Typedef Documentation

typedef std::map<std::string, std::string> variant_topic_tools::MessageHeader::Fields
protected

Definition of the fields type.

Definition at line 100 of file MessageHeader.h.

typedef boost::shared_ptr<std::map<std::string, std::string> > variant_topic_tools::MessageHeader::FieldsPtr
protected

Definition of the fields pointer type.

Definition at line 104 of file MessageHeader.h.

Constructor & Destructor Documentation

variant_topic_tools::MessageHeader::MessageHeader ( )

Default constructor.

Definition at line 27 of file MessageHeader.cpp.

variant_topic_tools::MessageHeader::MessageHeader ( const MessageHeader src)

Copy constructor.

Definition at line 35 of file MessageHeader.cpp.

variant_topic_tools::MessageHeader::~MessageHeader ( )

Destructor.

Definition at line 39 of file MessageHeader.cpp.

variant_topic_tools::MessageHeader::MessageHeader ( const FieldsPtr fields)
protected

Constructor (overloaded version taking a fields pointer)

Definition at line 31 of file MessageHeader.cpp.

Member Function Documentation

const std::string & variant_topic_tools::MessageHeader::getField ( const std::string &  name) const

Retrieve a field of the message header.

Definition at line 51 of file MessageHeader.cpp.

const std::string & variant_topic_tools::MessageHeader::getPublisher ( ) const

Retrieve the name of the publishing node.

Definition at line 66 of file MessageHeader.cpp.

const std::string & variant_topic_tools::MessageHeader::getTopic ( ) const

Retrieve the message publishing topic.

Definition at line 74 of file MessageHeader.cpp.

bool variant_topic_tools::MessageHeader::hasField ( const std::string &  name) const

True, if the message header contains a field with the specified name.

Definition at line 86 of file MessageHeader.cpp.

bool variant_topic_tools::MessageHeader::isLatched ( ) const

True, if the message publication is latched.

Definition at line 82 of file MessageHeader.cpp.

std::string & variant_topic_tools::MessageHeader::operator[] ( const std::string &  name)

Operator for retrieving a field of the message header (non-const version)

Definition at line 94 of file MessageHeader.cpp.

const std::string & variant_topic_tools::MessageHeader::operator[] ( const std::string &  name) const

Operator for retrieving a field of the message header (const version)

Definition at line 98 of file MessageHeader.cpp.

void variant_topic_tools::MessageHeader::setField ( const std::string &  name,
const std::string &  value 
)

Set a field of the message header.

Definition at line 46 of file MessageHeader.cpp.

void variant_topic_tools::MessageHeader::setLatched ( bool  latched)

Set to true to indicate that the message publication is latched.

Definition at line 78 of file MessageHeader.cpp.

void variant_topic_tools::MessageHeader::setPublisher ( const std::string &  publisher)

Set the name of the publishing node.

Definition at line 62 of file MessageHeader.cpp.

void variant_topic_tools::MessageHeader::setTopic ( const std::string &  topic)

Set the message publishing topic.

Definition at line 70 of file MessageHeader.cpp.

Friends And Related Function Documentation

friend class Message
friend

Definition at line 34 of file MessageHeader.h.

Definition at line 35 of file MessageHeader.h.

Member Data Documentation

FieldsPtr variant_topic_tools::MessageHeader::fields
protected

The fields of the message header.

Definition at line 108 of file MessageHeader.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