YARP
Yet Another Robot Platform
FrameGraphReply.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 "tf/FrameGraphReply" 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_tf_FrameGraphReply_h
13#define YARP_ROSMSG_tf_FrameGraphReply_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 tf {
24
26{
27public:
28 std::string dot_graph;
29
31 dot_graph("")
32 {
33 }
34
35 void clear()
36 {
37 // *** dot_graph ***
38 dot_graph = "";
39 }
40
41 bool readBare(yarp::os::ConnectionReader& connection) override
42 {
43 // *** dot_graph ***
44 int len = connection.expectInt32();
45 dot_graph.resize(len);
46 if (!connection.expectBlock((char*)dot_graph.c_str(), len)) {
47 return false;
48 }
49
50 return !connection.isError();
51 }
52
53 bool readBottle(yarp::os::ConnectionReader& connection) override
54 {
55 connection.convertTextMode();
56 yarp::os::idl::WireReader reader(connection);
57 if (!reader.readListHeader(1)) {
58 return false;
59 }
60
61 // *** dot_graph ***
62 if (!reader.readString(dot_graph)) {
63 return false;
64 }
65
66 return !connection.isError();
67 }
68
70 bool read(yarp::os::ConnectionReader& connection) override
71 {
72 return (connection.isBareMode() ? readBare(connection)
73 : readBottle(connection));
74 }
75
76 bool writeBare(yarp::os::ConnectionWriter& connection) const override
77 {
78 // *** dot_graph ***
79 connection.appendInt32(dot_graph.length());
80 connection.appendExternalBlock((char*)dot_graph.c_str(), dot_graph.length());
81
82 return !connection.isError();
83 }
84
85 bool writeBottle(yarp::os::ConnectionWriter& connection) const override
86 {
87 connection.appendInt32(BOTTLE_TAG_LIST);
88 connection.appendInt32(1);
89
90 // *** dot_graph ***
92 connection.appendInt32(dot_graph.length());
93 connection.appendExternalBlock((char*)dot_graph.c_str(), dot_graph.length());
94
95 connection.convertTextMode();
96 return !connection.isError();
97 }
98
100 bool write(yarp::os::ConnectionWriter& connection) const override
101 {
102 return (connection.isBareMode() ? writeBare(connection)
103 : writeBottle(connection));
104 }
105
106 // This class will serialize ROS style or YARP style depending on protocol.
107 // If you need to force a serialization style, use one of these classes:
110
111 // The name for this message, ROS will need this
112 static constexpr const char* typeName = "tf/FrameGraphReply";
113
114 // The checksum for this message, ROS will need this
115 static constexpr const char* typeChecksum = "c4af9ac907e58e906eb0b6e3c58478c0";
116
117 // The source text for this message, ROS will need this
118 static constexpr const char* typeText = "\
119\n\
120";
121
122 yarp::os::Type getType() const override
123 {
126 typ.addProperty("message_definition", yarp::os::Value(typeText));
127 return typ;
128 }
129};
130
131} // namespace tf
132} // namespace rosmsg
133} // namespace yarp
134
135#endif // YARP_ROSMSG_tf_FrameGraphReply_h
#define BOTTLE_TAG_STRING
Definition: Bottle.h:26
#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 std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
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 appendExternalBlock(const char *data, size_t len)=0
Send a block of data to the network connection, without making a copy.
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
bool readString(std::string &str, bool *is_vocab=nullptr)
Definition: WireReader.cpp:376
yarp::os::Type getType() const override
bool readBare(yarp::os::ConnectionReader &connection) override
static constexpr const char * typeChecksum
static constexpr const char * typeText
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
bool writeBare(yarp::os::ConnectionWriter &connection) const override
static constexpr const char * typeName
bool readBottle(yarp::os::ConnectionReader &connection) override
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::os::idl::BareStyle< yarp::rosmsg::tf::FrameGraphReply > rosStyle
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
yarp::os::idl::BottleStyle< yarp::rosmsg::tf::FrameGraphReply > bottleStyle
Definition: FrameGraph.h:19
The main, catch-all namespace for YARP.
Definition: dirs.h:16