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