YARP
Yet Another Robot Platform
FrameGraph.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/FrameGraph" msg definition:
9 // ---
10 // string dot_graph
11 // Instances of this class can be read and written with YARP ports,
12 // using a ROS-compatible format.
13 
14 #ifndef YARP_ROSMSG_tf_FrameGraph_h
15 #define YARP_ROSMSG_tf_FrameGraph_h
16 
17 #include <yarp/os/Wire.h>
18 #include <yarp/os/Type.h>
20 #include <string>
21 #include <vector>
22 
23 namespace yarp {
24 namespace rosmsg {
25 namespace tf {
26 
28 {
29 public:
30 
32  {
33  }
34 
35  void clear()
36  {
37  }
38 
39  bool readBare(yarp::os::ConnectionReader& connection) override
40  {
41 
42  return !connection.isError();
43  }
44 
45  bool readBottle(yarp::os::ConnectionReader& connection) override
46  {
47  connection.convertTextMode();
48  yarp::os::idl::WireReader reader(connection);
49  if (!reader.readListHeader(0)) {
50  return false;
51  }
52 
53 
54  return !connection.isError();
55  }
56 
58  bool read(yarp::os::ConnectionReader& connection) override
59  {
60  return (connection.isBareMode() ? readBare(connection)
61  : readBottle(connection));
62  }
63 
64  bool writeBare(yarp::os::ConnectionWriter& connection) const override
65  {
66 
67  return !connection.isError();
68  }
69 
70  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
71  {
72  connection.appendInt32(BOTTLE_TAG_LIST);
73  connection.appendInt32(0);
74 
75 
76  connection.convertTextMode();
77  return !connection.isError();
78  }
79 
81  bool write(yarp::os::ConnectionWriter& connection) const override
82  {
83  return (connection.isBareMode() ? writeBare(connection)
84  : writeBottle(connection));
85  }
86 
87  // This class will serialize ROS style or YARP style depending on protocol.
88  // If you need to force a serialization style, use one of these classes:
91 
92  // The name for this message, ROS will need this
93  static constexpr const char* typeName = "tf/FrameGraph";
94 
95  // The checksum for this message, ROS will need this
96  static constexpr const char* typeChecksum = "d41d8cd98f00b204e9800998ecf8427e";
97 
98  // The source text for this message, ROS will need this
99  static constexpr const char* typeText = "\
100 ---\n\
101 string dot_graph\n\
102 ";
103 
104  yarp::os::Type getType() const override
105  {
107  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
108  typ.addProperty("message_definition", yarp::os::Value(typeText));
109  return typ;
110  }
111 };
112 
113 } // namespace tf
114 } // namespace rosmsg
115 } // namespace yarp
116 
117 #endif // YARP_ROSMSG_tf_FrameGraph_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:45
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:23
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:30
static constexpr const char * typeText
Definition: FrameGraph.h:99
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: FrameGraph.h:58
static constexpr const char * typeChecksum
Definition: FrameGraph.h:96
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: FrameGraph.h:64
static constexpr const char * typeName
Definition: FrameGraph.h:93
yarp::os::idl::BareStyle< yarp::rosmsg::tf::FrameGraph > rosStyle
Definition: FrameGraph.h:89
yarp::os::Type getType() const override
Definition: FrameGraph.h:104
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: FrameGraph.h:39
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: FrameGraph.h:70
yarp::os::idl::BottleStyle< yarp::rosmsg::tf::FrameGraph > bottleStyle
Definition: FrameGraph.h:90
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: FrameGraph.h:81
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: FrameGraph.h:45
Definition: FrameGraph.h:19
The main, catch-all namespace for YARP.
Definition: dirs.h:16