YARP
Yet Another Robot Platform
GetMap.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/GetMap" msg definition:
9// # Get the map as a nav_msgs/OccupancyGrid
10// ---
11// nav_msgs/OccupancyGrid map
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_GetMap_h
16#define YARP_ROSMSG_nav_msgs_GetMap_h
17
18#include <yarp/os/Wire.h>
21#include <string>
22#include <vector>
23
24namespace yarp {
25namespace rosmsg {
26namespace nav_msgs {
27
29{
30public:
31
33 {
34 }
35
36 void clear()
37 {
38 }
39
40 bool readBare(yarp::os::ConnectionReader& connection) override
41 {
42
43 return !connection.isError();
44 }
45
46 bool readBottle(yarp::os::ConnectionReader& connection) override
47 {
48 connection.convertTextMode();
49 yarp::os::idl::WireReader reader(connection);
50 if (!reader.readListHeader(0)) {
51 return false;
52 }
53
54
55 return !connection.isError();
56 }
57
59 bool read(yarp::os::ConnectionReader& connection) override
60 {
61 return (connection.isBareMode() ? readBare(connection)
62 : readBottle(connection));
63 }
64
65 bool writeBare(yarp::os::ConnectionWriter& connection) const override
66 {
67
68 return !connection.isError();
69 }
70
71 bool writeBottle(yarp::os::ConnectionWriter& connection) const override
72 {
73 connection.appendInt32(BOTTLE_TAG_LIST);
74 connection.appendInt32(0);
75
76
77 connection.convertTextMode();
78 return !connection.isError();
79 }
80
82 bool write(yarp::os::ConnectionWriter& connection) const override
83 {
84 return (connection.isBareMode() ? writeBare(connection)
85 : writeBottle(connection));
86 }
87
88 // This class will serialize ROS style or YARP style depending on protocol.
89 // If you need to force a serialization style, use one of these classes:
92
93 // The name for this message, ROS will need this
94 static constexpr const char* typeName = "nav_msgs/GetMap";
95
96 // The checksum for this message, ROS will need this
97 static constexpr const char* typeChecksum = "d41d8cd98f00b204e9800998ecf8427e";
98
99 // The source text for this message, ROS will need this
100 static constexpr const char* typeText = "\
101# Get the map as a nav_msgs/OccupancyGrid\n\
102---\n\
103nav_msgs/OccupancyGrid map\n\
104";
105
106 yarp::os::Type getType() const override
107 {
110 typ.addProperty("message_definition", yarp::os::Value(typeText));
111 return typ;
112 }
113};
114
115} // namespace nav_msgs
116} // namespace rosmsg
117} // namespace yarp
118
119#endif // YARP_ROSMSG_nav_msgs_GetMap_h
#define BOTTLE_TAG_LIST
Definition: Bottle.h:28
An interface for reading from a 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 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.
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
yarp::os::idl::BottleStyle< yarp::rosmsg::nav_msgs::GetMap > bottleStyle
Definition: GetMap.h:91
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: GetMap.h:59
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: GetMap.h:71
yarp::os::idl::BareStyle< yarp::rosmsg::nav_msgs::GetMap > rosStyle
Definition: GetMap.h:90
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: GetMap.h:82
yarp::os::Type getType() const override
Definition: GetMap.h:106
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: GetMap.h:65
static constexpr const char * typeName
Definition: GetMap.h:94
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: GetMap.h:40
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: GetMap.h:46
static constexpr const char * typeText
Definition: GetMap.h:100
static constexpr const char * typeChecksum
Definition: GetMap.h:97
The main, catch-all namespace for YARP.
Definition: dirs.h:16