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 "tf2_msgs/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_tf2_msgs_FrameGraphReply_h
16 #define YARP_ROSMSG_tf2_msgs_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 tf2_msgs {
27 
29 {
30 public:
31  std::string frame_yaml;
32 
34  frame_yaml("")
35  {
36  }
37 
38  void clear()
39  {
40  // *** frame_yaml ***
41  frame_yaml = "";
42  }
43 
44  bool readBare(yarp::os::ConnectionReader& connection) override
45  {
46  // *** frame_yaml ***
47  int len = connection.expectInt32();
48  frame_yaml.resize(len);
49  if (!connection.expectBlock((char*)frame_yaml.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  // *** frame_yaml ***
65  if (!reader.readString(frame_yaml)) {
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  // *** frame_yaml ***
82  connection.appendInt32(frame_yaml.length());
83  connection.appendExternalBlock((char*)frame_yaml.c_str(), frame_yaml.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  // *** frame_yaml ***
94  connection.appendInt32(BOTTLE_TAG_STRING);
95  connection.appendInt32(frame_yaml.length());
96  connection.appendExternalBlock((char*)frame_yaml.c_str(), frame_yaml.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 = "tf2_msgs/FrameGraphReply";
116 
117  // The checksum for this message, ROS will need this
118  static constexpr const char* typeChecksum = "437ea58e9463815a0d511c7326b686b0";
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 tf2_msgs
135 } // namespace rosmsg
136 } // namespace yarp
137 
138 #endif // YARP_ROSMSG_tf2_msgs_FrameGraphReply_h
yarp::os::idl::WireReader::readString
bool readString(std::string &str, bool *is_vocab=nullptr)
Definition: WireReader.cpp:339
yarp::rosmsg::tf2_msgs::FrameGraphReply::getType
yarp::os::Type getType() const override
Definition: FrameGraphReply.h:125
WireTypes.h
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
yarp::rosmsg::tf2_msgs::FrameGraphReply::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: FrameGraphReply.h:44
yarp::rosmsg::tf2_msgs::FrameGraphReply::typeChecksum
static constexpr const char * typeChecksum
Definition: FrameGraphReply.h:118
yarp::rosmsg::tf2_msgs::FrameGraphReply::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FrameGraphReply.h:73
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::tf2_msgs::FrameGraphReply::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::tf2_msgs::FrameGraphReply > rosStyle
Definition: FrameGraphReply.h:111
yarp::rosmsg::tf2_msgs::FrameGraphReply::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: FrameGraphReply.h:88
yarp::rosmsg::tf2_msgs::FrameGraphReply::typeText
static constexpr const char * typeText
Definition: FrameGraphReply.h:121
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::ConnectionReader::expectInt32
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
yarp::os::Type::addProperty
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:137
Type.h
yarp::rosmsg::tf2_msgs::FrameGraphReply::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: FrameGraphReply.h:79
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::rosmsg::tf2_msgs::FrameGraphReply::clear
void clear()
Definition: FrameGraphReply.h:38
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::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.
tf2_msgs
Definition: FrameGraph.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::rosmsg::tf2_msgs::FrameGraphReply::FrameGraphReply
FrameGraphReply()
Definition: FrameGraphReply.h:33
yarp::rosmsg::tf2_msgs::FrameGraphReply
Definition: FrameGraphReply.h:29
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::rosmsg::tf2_msgs::FrameGraphReply::typeName
static constexpr const char * typeName
Definition: FrameGraphReply.h:115
yarp::rosmsg::tf2_msgs::FrameGraphReply::frame_yaml
std::string frame_yaml
Definition: FrameGraphReply.h:31
yarp::rosmsg::tf2_msgs::FrameGraphReply::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::tf2_msgs::FrameGraphReply > bottleStyle
Definition: FrameGraphReply.h:112
yarp::rosmsg::tf2_msgs::FrameGraphReply::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: FrameGraphReply.h:56
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::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::tf2_msgs::FrameGraphReply::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FrameGraphReply.h:103
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