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