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