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