YARP
Yet Another Robot Platform
Empty.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 "std_msgs/Empty" 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_std_msgs_Empty_h
16 #define YARP_ROSMSG_std_msgs_Empty_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 std_msgs {
27 
29 {
30 public:
31 
33  {
34  }
35 
36  void clear()
37  {
38  }
39 
40  bool readBare(yarp::os::ConnectionReader& connection) override
41  {
42 
43  return !connection.isError();
44  }
45 
46  bool readBottle(yarp::os::ConnectionReader& connection) override
47  {
48  connection.convertTextMode();
49  yarp::os::idl::WireReader reader(connection);
50  if (!reader.readListHeader(0)) {
51  return false;
52  }
53 
54 
55  return !connection.isError();
56  }
57 
59  bool read(yarp::os::ConnectionReader& connection) override
60  {
61  return (connection.isBareMode() ? readBare(connection)
62  : readBottle(connection));
63  }
64 
65  bool writeBare(yarp::os::ConnectionWriter& connection) const override
66  {
67 
68  return !connection.isError();
69  }
70 
71  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
72  {
73  connection.appendInt32(BOTTLE_TAG_LIST);
74  connection.appendInt32(0);
75 
76 
77  connection.convertTextMode();
78  return !connection.isError();
79  }
80 
82  bool write(yarp::os::ConnectionWriter& connection) const override
83  {
84  return (connection.isBareMode() ? writeBare(connection)
85  : writeBottle(connection));
86  }
87 
88  // This class will serialize ROS style or YARP style depending on protocol.
89  // If you need to force a serialization style, use one of these classes:
92 
93  // The name for this message, ROS will need this
94  static constexpr const char* typeName = "std_msgs/Empty";
95 
96  // The checksum for this message, ROS will need this
97  static constexpr const char* typeChecksum = "d41d8cd98f00b204e9800998ecf8427e";
98 
99  // The source text for this message, ROS will need this
100  static constexpr const char* typeText = "\
101 \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 std_msgs
114 } // namespace rosmsg
115 } // namespace yarp
116 
117 #endif // YARP_ROSMSG_std_msgs_Empty_h
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.
Wire.h
yarp::rosmsg::std_msgs::Empty::typeChecksum
static constexpr const char * typeChecksum
Definition: Empty.h:97
yarp::rosmsg::std_msgs::Empty::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::std_msgs::Empty > rosStyle
Definition: Empty.h:90
yarp::rosmsg::std_msgs::Empty::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: Empty.h:71
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::std_msgs::Empty::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: Empty.h:82
yarp::rosmsg::std_msgs::Empty::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: Empty.h:59
yarp::os::Type::addProperty
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:137
Type.h
std_msgs
Definition: Bool.h:22
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::rosmsg::std_msgs::Empty
Definition: Empty.h:29
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::std_msgs::Empty::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: Empty.h:46
yarp::rosmsg::std_msgs::Empty::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::std_msgs::Empty > bottleStyle
Definition: Empty.h:91
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::std_msgs::Empty::Empty
Empty()
Definition: Empty.h:32
yarp::rosmsg::std_msgs::Empty::typeText
static constexpr const char * typeText
Definition: Empty.h:100
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::std_msgs::Empty::typeName
static constexpr const char * typeName
Definition: Empty.h:94
yarp::rosmsg::std_msgs::Empty::getType
yarp::os::Type getType() const override
Definition: Empty.h:104
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
yarp::rosmsg::std_msgs::Empty::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: Empty.h:65
yarp::rosmsg::std_msgs::Empty::clear
void clear()
Definition: Empty.h:36
yarp::rosmsg::std_msgs::Empty::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: Empty.h:40
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