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. | |
const std::string & | getPublisher () const |
Retrieve the name of the publishing node. | |
const std::string & | getTopic () const |
Retrieve the message publishing topic. | |
bool | hasField (const std::string &name) const |
True, if the message header contains a field with the specified name. | |
bool | isLatched () const |
True, if the message publication is latched. | |
MessageHeader () | |
Default constructor. | |
MessageHeader (const MessageHeader &src) | |
Copy constructor. | |
std::string & | operator[] (const std::string &name) |
Operator for retrieving a field of the message header (non-const version) | |
const std::string & | operator[] (const std::string &name) const |
Operator for retrieving a field of the message header (const version) | |
void | setField (const std::string &name, const std::string &value) |
Set a field of the message header. | |
void | setLatched (bool latched) |
Set to true to indicate that the message publication is latched. | |
void | setPublisher (const std::string &publisher) |
Set the name of the publishing node. | |
void | setTopic (const std::string &topic) |
Set the message publishing topic. | |
~MessageHeader () | |
Destructor. | |
Protected Types | |
typedef std::map< std::string, std::string > | Fields |
Definition of the fields type. | |
typedef boost::shared_ptr < std::map< std::string, std::string > > | FieldsPtr |
Definition of the fields pointer type. | |
Protected Member Functions | |
MessageHeader (const FieldsPtr &fields) | |
Constructor (overloaded version taking a fields pointer) | |
Protected Attributes | |
FieldsPtr | fields |
The fields of the message header. | |
Friends | |
class | Message |
class | ros::serialization::PreDeserialize< Message > |
Variant message header.
Definition at line 33 of file MessageHeader.h.
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.
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.
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.
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.
friend class Message [friend] |
Definition at line 34 of file MessageHeader.h.
friend class ros::serialization::PreDeserialize< Message > [friend] |
Definition at line 35 of file MessageHeader.h.
FieldsPtr variant_topic_tools::MessageHeader::fields [protected] |
The fields of the message header.
Definition at line 108 of file MessageHeader.h.