YARP
Yet Another Robot Platform
UInt32.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/UInt32" msg definition:
9// uint32 data// 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_UInt32_h
13#define YARP_ROSMSG_std_msgs_UInt32_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 std::uint32_t data;
29
31 data(0)
32 {
33 }
34
35 void clear()
36 {
37 // *** data ***
38 data = 0;
39 }
40
41 bool readBare(yarp::os::ConnectionReader& connection) override
42 {
43 // *** data ***
44 data = connection.expectInt32();
45
46 return !connection.isError();
47 }
48
49 bool readBottle(yarp::os::ConnectionReader& connection) override
50 {
51 connection.convertTextMode();
52 yarp::os::idl::WireReader reader(connection);
53 if (!reader.readListHeader(1)) {
54 return false;
55 }
56
57 // *** data ***
58 data = reader.expectInt32();
59
60 return !connection.isError();
61 }
62
64 bool read(yarp::os::ConnectionReader& connection) override
65 {
66 return (connection.isBareMode() ? readBare(connection)
67 : readBottle(connection));
68 }
69
70 bool writeBare(yarp::os::ConnectionWriter& connection) const override
71 {
72 // *** data ***
73 connection.appendInt32(data);
74
75 return !connection.isError();
76 }
77
78 bool writeBottle(yarp::os::ConnectionWriter& connection) const override
79 {
80 connection.appendInt32(BOTTLE_TAG_LIST);
81 connection.appendInt32(1);
82
83 // *** data ***
84 connection.appendInt32(BOTTLE_TAG_INT32);
85 connection.appendInt32(data);
86
87 connection.convertTextMode();
88 return !connection.isError();
89 }
90
92 bool write(yarp::os::ConnectionWriter& connection) const override
93 {
94 return (connection.isBareMode() ? writeBare(connection)
95 : writeBottle(connection));
96 }
97
98 // This class will serialize ROS style or YARP style depending on protocol.
99 // If you need to force a serialization style, use one of these classes:
102
103 // The name for this message, ROS will need this
104 static constexpr const char* typeName = "std_msgs/UInt32";
105
106 // The checksum for this message, ROS will need this
107 static constexpr const char* typeChecksum = "304a39449588c7f8ce2df6e8001c5fce";
108
109 // The source text for this message, ROS will need this
110 static constexpr const char* typeText = "\
111uint32 data\n\
112";
113
114 yarp::os::Type getType() const override
115 {
118 typ.addProperty("message_definition", yarp::os::Value(typeText));
119 return typ;
120 }
121};
122
123} // namespace std_msgs
124} // namespace rosmsg
125} // namespace yarp
126
127#endif // YARP_ROSMSG_std_msgs_UInt32_h
#define BOTTLE_TAG_INT32
Definition: Bottle.h:21
#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 std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
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
std::int32_t expectInt32()
Definition: WireReader.h:89
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: UInt32.h:64
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: UInt32.h:70
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: UInt32.h:49
yarp::os::idl::BottleStyle< yarp::rosmsg::std_msgs::UInt32 > bottleStyle
Definition: UInt32.h:101
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: UInt32.h:41
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: UInt32.h:92
yarp::os::idl::BareStyle< yarp::rosmsg::std_msgs::UInt32 > rosStyle
Definition: UInt32.h:100
static constexpr const char * typeChecksum
Definition: UInt32.h:107
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: UInt32.h:78
static constexpr const char * typeName
Definition: UInt32.h:104
static constexpr const char * typeText
Definition: UInt32.h:110
yarp::os::Type getType() const override
Definition: UInt32.h:114
Definition: Bool.h:19
The main, catch-all namespace for YARP.
Definition: dirs.h:16