YARP
Yet Another Robot Platform
UInt64.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/UInt64" msg definition:
12 // uint64 data// 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_UInt64_h
16 #define YARP_ROSMSG_std_msgs_UInt64_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  std::uint64_t data;
32 
33  UInt64() :
34  data(0)
35  {
36  }
37 
38  void clear()
39  {
40  // *** data ***
41  data = 0;
42  }
43 
44  bool readBare(yarp::os::ConnectionReader& connection) override
45  {
46  // *** data ***
47  data = connection.expectInt64();
48 
49  return !connection.isError();
50  }
51 
52  bool readBottle(yarp::os::ConnectionReader& connection) override
53  {
54  connection.convertTextMode();
55  yarp::os::idl::WireReader reader(connection);
56  if (!reader.readListHeader(1)) {
57  return false;
58  }
59 
60  // *** data ***
61  data = reader.expectInt64();
62 
63  return !connection.isError();
64  }
65 
67  bool read(yarp::os::ConnectionReader& connection) override
68  {
69  return (connection.isBareMode() ? readBare(connection)
70  : readBottle(connection));
71  }
72 
73  bool writeBare(yarp::os::ConnectionWriter& connection) const override
74  {
75  // *** data ***
76  connection.appendInt64(data);
77 
78  return !connection.isError();
79  }
80 
81  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
82  {
83  connection.appendInt32(BOTTLE_TAG_LIST);
84  connection.appendInt32(1);
85 
86  // *** data ***
87  connection.appendInt32(BOTTLE_TAG_INT64);
88  connection.appendInt64(data);
89 
90  connection.convertTextMode();
91  return !connection.isError();
92  }
93 
95  bool write(yarp::os::ConnectionWriter& connection) const override
96  {
97  return (connection.isBareMode() ? writeBare(connection)
98  : writeBottle(connection));
99  }
100 
101  // This class will serialize ROS style or YARP style depending on protocol.
102  // If you need to force a serialization style, use one of these classes:
105 
106  // The name for this message, ROS will need this
107  static constexpr const char* typeName = "std_msgs/UInt64";
108 
109  // The checksum for this message, ROS will need this
110  static constexpr const char* typeChecksum = "1b2a79973e8bf53d7b53acb71299cb57";
111 
112  // The source text for this message, ROS will need this
113  static constexpr const char* typeText = "\
114 uint64 data\n\
115 ";
116 
117  yarp::os::Type getType() const override
118  {
120  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
121  typ.addProperty("message_definition", yarp::os::Value(typeText));
122  return typ;
123  }
124 };
125 
126 } // namespace std_msgs
127 } // namespace rosmsg
128 } // namespace yarp
129 
130 #endif // YARP_ROSMSG_std_msgs_UInt64_h
yarp::rosmsg::std_msgs::UInt64::getType
yarp::os::Type getType() const override
Definition: UInt64.h:117
yarp::rosmsg::std_msgs::UInt64::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: UInt64.h:73
WireTypes.h
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
yarp::rosmsg::std_msgs::UInt64::clear
void clear()
Definition: UInt64.h:38
yarp::rosmsg::std_msgs::UInt64::typeText
static constexpr const char * typeText
Definition: UInt64.h:113
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::os::idl::WireReader::expectInt64
std::int64_t expectInt64()
Definition: WireReader.h:106
yarp::rosmsg::std_msgs::UInt64::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: UInt64.h:44
yarp::rosmsg::std_msgs::UInt64::typeChecksum
static constexpr const char * typeChecksum
Definition: UInt64.h:110
yarp::rosmsg::std_msgs::UInt64::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: UInt64.h:81
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::UInt64::UInt64
UInt64()
Definition: UInt64.h:33
yarp::os::ConnectionReader::expectInt64
virtual std::int64_t expectInt64()=0
Read a 64-bit integer from the network connection.
yarp::os::Type::addProperty
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:137
Type.h
yarp::rosmsg::std_msgs::UInt64::typeName
static constexpr const char * typeName
Definition: UInt64.h:107
std_msgs
Definition: Bool.h:22
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
BOTTLE_TAG_INT64
#define BOTTLE_TAG_INT64
Definition: Bottle.h:24
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::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::os::ConnectionWriter::appendInt64
virtual void appendInt64(std::int64_t data)=0
Send a representation of a 64-bit integer to the network connection.
yarp::rosmsg::std_msgs::UInt64::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: UInt64.h:67
yarp::rosmsg::std_msgs::UInt64::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: UInt64.h:95
yarp::rosmsg::std_msgs::UInt64::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: UInt64.h:52
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::rosmsg::std_msgs::UInt64::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::std_msgs::UInt64 > rosStyle
Definition: UInt64.h:103
yarp::rosmsg::std_msgs::UInt64::data
std::uint64_t data
Definition: UInt64.h:31
yarp::rosmsg::std_msgs::UInt64
Definition: UInt64.h:29
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
yarp::rosmsg::std_msgs::UInt64::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::std_msgs::UInt64 > bottleStyle
Definition: UInt64.h:104
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