Main Page
Namespaces
Classes
Files
File List
File Members
include
variant_topic_tools
MessageHeader.h
Go to the documentation of this file.
1
/******************************************************************************
2
* Copyright (C) 2014 by Ralf Kaestner *
3
* ralf.kaestner@gmail.com *
4
* *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the Lesser GNU General Public License as published by*
7
* the Free Software Foundation; either version 3 of the License, or *
8
* (at your option) any later version. *
9
* *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* Lesser GNU General Public License for more details. *
14
* *
15
* You should have received a copy of the Lesser GNU General Public License *
16
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
17
******************************************************************************/
18
23
#ifndef VARIANT_TOPIC_TOOLS_MESSAGE_HEADER_H
24
#define VARIANT_TOPIC_TOOLS_MESSAGE_HEADER_H
25
26
#include <
ros/ros.h
>
27
28
#include <
variant_topic_tools/Forwards.h
>
29
30
namespace
variant_topic_tools
{
33
class
MessageHeader
{
34
friend
class
Message
;
35
friend
class
ros::serialization::PreDeserialize
<
Message
>;
36
public
:
39
MessageHeader
();
40
43
MessageHeader
(
const
MessageHeader
& src);
44
47
~MessageHeader
();
48
51
void
setField
(
const
std::string& name,
const
std::string& value);
52
55
const
std::string&
getField
(
const
std::string& name)
const
;
56
59
void
setPublisher
(
const
std::string&
publisher
);
60
63
const
std::string&
getPublisher
()
const
;
64
67
void
setTopic
(
const
std::string& topic);
68
71
const
std::string&
getTopic
()
const
;
72
76
void
setLatched
(
bool
latched);
77
80
bool
isLatched
()
const
;
81
85
bool
hasField
(
const
std::string& name)
const
;
86
90
std::string&
operator[]
(
const
std::string& name);
91
95
const
std::string&
operator[]
(
const
std::string& name)
const
;
96
97
protected
:
100
typedef
std::map<std::string, std::string>
Fields
;
101
104
typedef
boost::shared_ptr<std::map<std::string, std::string>
>
FieldsPtr
;
105
108
FieldsPtr
fields
;
109
112
MessageHeader
(
const
FieldsPtr& fields);
113
};
114
};
115
116
#endif
variant_topic_tools::MessageHeader::FieldsPtr
boost::shared_ptr< std::map< std::string, std::string > > FieldsPtr
Definition of the fields pointer type.
Definition:
MessageHeader.h:104
variant_topic_tools
Definition:
ArrayDataType.h:29
variant_topic_tools::MessageHeader::Fields
std::map< std::string, std::string > Fields
Definition of the fields type.
Definition:
MessageHeader.h:100
variant_topic_tools::Message
Generic message type.
Definition:
Message.h:43
variant_topic_tools::MessageHeader::~MessageHeader
~MessageHeader()
Destructor.
Definition:
MessageHeader.cpp:39
variant_topic_tools::MessageHeader::isLatched
bool isLatched() const
True, if the message publication is latched.
Definition:
MessageHeader.cpp:82
Forwards.h
Header file providing forward declarations for the variant topic tools.
boost::shared_ptr
publisher
variant_topic_tools::Publisher publisher
Definition:
publish.cpp:25
variant_topic_tools::MessageHeader::getPublisher
const std::string & getPublisher() const
Retrieve the name of the publishing node.
Definition:
MessageHeader.cpp:66
variant_topic_tools::MessageHeader::getField
const std::string & getField(const std::string &name) const
Retrieve a field of the message header.
Definition:
MessageHeader.cpp:51
ros::serialization::PreDeserialize
variant_topic_tools::MessageHeader::setTopic
void setTopic(const std::string &topic)
Set the message publishing topic.
Definition:
MessageHeader.cpp:70
variant_topic_tools::MessageHeader::setPublisher
void setPublisher(const std::string &publisher)
Set the name of the publishing node.
Definition:
MessageHeader.cpp:62
variant_topic_tools::MessageHeader::setField
void setField(const std::string &name, const std::string &value)
Set a field of the message header.
Definition:
MessageHeader.cpp:46
variant_topic_tools::MessageHeader::operator[]
std::string & operator[](const std::string &name)
Operator for retrieving a field of the message header (non-const version)
Definition:
MessageHeader.cpp:94
ros.h
variant_topic_tools::MessageHeader::setLatched
void setLatched(bool latched)
Set to true to indicate that the message publication is latched.
Definition:
MessageHeader.cpp:78
variant_topic_tools::MessageHeader::getTopic
const std::string & getTopic() const
Retrieve the message publishing topic.
Definition:
MessageHeader.cpp:74
variant_topic_tools::MessageHeader::hasField
bool hasField(const std::string &name) const
True, if the message header contains a field with the specified name.
Definition:
MessageHeader.cpp:86
variant_topic_tools::MessageHeader
Variant message header.
Definition:
MessageHeader.h:33
variant_topic_tools::MessageHeader::fields
FieldsPtr fields
The fields of the message header.
Definition:
MessageHeader.h:108
variant_topic_tools::MessageHeader::MessageHeader
MessageHeader()
Default constructor.
Definition:
MessageHeader.cpp:27
variant_topic_tools
Author(s): Ralf Kaestner
autogenerated on Sat Jan 9 2021 03:56:49