YARP
Yet Another Robot Platform
SetMapReply.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6// This is an automatically generated file.
7
8// Generated from the following "nav_msgs/SetMapReply" msg definition:
9// Instances of this class can be read and written with YARP ports,
10// using a ROS-compatible format.
11
12#ifndef YARP_ROSMSG_nav_msgs_SetMapReply_h
13#define YARP_ROSMSG_nav_msgs_SetMapReply_h
14
15#include <yarp/os/Wire.h>
16#include <yarp/os/Type.h>
18#include <string>
19#include <vector>
20
21namespace yarp {
22namespace rosmsg {
23namespace nav_msgs {
24
26{
27public:
28 bool success;
29
31 success(false)
32 {
33 }
34
35 void clear()
36 {
37 // *** success ***
38 success = false;
39 }
40
41 bool readBare(yarp::os::ConnectionReader& connection) override
42 {
43 // *** success ***
44 if (!connection.expectBlock((char*)&success, 1)) {
45 return false;
46 }
47
48 return !connection.isError();
49 }
50
51 bool readBottle(yarp::os::ConnectionReader& connection) override
52 {
53 connection.convertTextMode();
54 yarp::os::idl::WireReader reader(connection);
55 if (!reader.readListHeader(1)) {
56 return false;
57 }
58
59 // *** success ***
60 success = reader.expectInt8();
61
62 return !connection.isError();
63 }
64
66 bool read(yarp::os::ConnectionReader& connection) override
67 {
68 return (connection.isBareMode() ? readBare(connection)
69 : readBottle(connection));
70 }
71
72 bool writeBare(yarp::os::ConnectionWriter& connection) const override
73 {
74 // *** success ***
75 connection.appendBlock((char*)&success, 1);
76
77 return !connection.isError();
78 }
79
80 bool writeBottle(yarp::os::ConnectionWriter& connection) const override
81 {
82 connection.appendInt32(BOTTLE_TAG_LIST);
83 connection.appendInt32(1);
84
85 // *** success ***
86 connection.appendInt32(BOTTLE_TAG_INT8);
87 connection.appendInt8(success);
88
89 connection.convertTextMode();
90 return !connection.isError();
91 }
92
94 bool write(yarp::os::ConnectionWriter& connection) const override
95 {
96 return (connection.isBareMode() ? writeBare(connection)
97 : writeBottle(connection));
98 }
99
100 // This class will serialize ROS style or YARP style depending on protocol.
101 // If you need to force a serialization style, use one of these classes:
104
105 // The name for this message, ROS will need this
106 static constexpr const char* typeName = "nav_msgs/SetMapReply";
107
108 // The checksum for this message, ROS will need this
109 static constexpr const char* typeChecksum = "358e233cde0c8a8bcfea4ce193f8fc15";
110
111 // The source text for this message, ROS will need this
112 static constexpr const char* typeText = "\
113\n\
114";
115
116 yarp::os::Type getType() const override
117 {
120 typ.addProperty("message_definition", yarp::os::Value(typeText));
121 return typ;
122 }
123};
124
125} // namespace nav_msgs
126} // namespace rosmsg
127} // namespace yarp
128
129#endif // YARP_ROSMSG_nav_msgs_SetMapReply_h
#define BOTTLE_TAG_INT8
Definition: Bottle.h:19
#define BOTTLE_TAG_LIST
Definition: Bottle.h:28
An interface for reading from a network connection.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual bool isError() const =0
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual void appendInt8(std::int8_t data)=0
Send a representation of a 8-bit integer to the network connection.
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
virtual void appendBlock(const char *data, size_t len)=0
Send a block of data to the network connection.
static Type byName(const char *name)
Definition: Type.cpp:171
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:134
A single value (typically within a Bottle).
Definition: Value.h:43
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:21
virtual bool read(yarp::os::idl::WireReader &reader)
virtual bool write(const yarp::os::idl::WireWriter &writer) const
IDL-friendly connection reader.
Definition: WireReader.h:27
std::int8_t expectInt8()
Definition: WireReader.h:77
static constexpr const char * typeChecksum
Definition: SetMapReply.h:109
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: SetMapReply.h:51
static constexpr const char * typeText
Definition: SetMapReply.h:112
yarp::os::Type getType() const override
Definition: SetMapReply.h:116
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: SetMapReply.h:80
yarp::os::idl::BareStyle< yarp::rosmsg::nav_msgs::SetMapReply > rosStyle
Definition: SetMapReply.h:102
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: SetMapReply.h:94
yarp::os::idl::BottleStyle< yarp::rosmsg::nav_msgs::SetMapReply > bottleStyle
Definition: SetMapReply.h:103
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: SetMapReply.h:72
static constexpr const char * typeName
Definition: SetMapReply.h:106
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: SetMapReply.h:66
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: SetMapReply.h:41
The main, catch-all namespace for YARP.
Definition: dirs.h:16