YARP
Yet Another Robot Platform
GoalStatusArray.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 "actionlib_msgs/GoalStatusArray" msg definition:
12 // # Stores the statuses for goals that are currently being tracked
13 // # by an action server
14 // Header header
15 // GoalStatus[] status_list
16 //
17 // Instances of this class can be read and written with YARP ports,
18 // using a ROS-compatible format.
19 
20 #ifndef YARP_ROSMSG_actionlib_msgs_GoalStatusArray_h
21 #define YARP_ROSMSG_actionlib_msgs_GoalStatusArray_h
22 
23 #include <yarp/os/Wire.h>
24 #include <yarp/os/Type.h>
25 #include <yarp/os/idl/WireTypes.h>
26 #include <string>
27 #include <vector>
30 
31 namespace yarp {
32 namespace rosmsg {
33 namespace actionlib_msgs {
34 
36 {
37 public:
39  std::vector<yarp::rosmsg::actionlib_msgs::GoalStatus> status_list;
40 
42  header(),
43  status_list()
44  {
45  }
46 
47  void clear()
48  {
49  // *** header ***
50  header.clear();
51 
52  // *** status_list ***
53  status_list.clear();
54  }
55 
56  bool readBare(yarp::os::ConnectionReader& connection) override
57  {
58  // *** header ***
59  if (!header.read(connection)) {
60  return false;
61  }
62 
63  // *** status_list ***
64  int len = connection.expectInt32();
65  status_list.resize(len);
66  for (int i=0; i<len; i++) {
67  if (!status_list[i].read(connection)) {
68  return false;
69  }
70  }
71 
72  return !connection.isError();
73  }
74 
75  bool readBottle(yarp::os::ConnectionReader& connection) override
76  {
77  connection.convertTextMode();
78  yarp::os::idl::WireReader reader(connection);
79  if (!reader.readListHeader(2)) {
80  return false;
81  }
82 
83  // *** header ***
84  if (!header.read(connection)) {
85  return false;
86  }
87 
88  // *** status_list ***
89  if (connection.expectInt32() != BOTTLE_TAG_LIST) {
90  return false;
91  }
92  int len = connection.expectInt32();
93  status_list.resize(len);
94  for (int i=0; i<len; i++) {
95  if (!status_list[i].read(connection)) {
96  return false;
97  }
98  }
99 
100  return !connection.isError();
101  }
102 
104  bool read(yarp::os::ConnectionReader& connection) override
105  {
106  return (connection.isBareMode() ? readBare(connection)
107  : readBottle(connection));
108  }
109 
110  bool writeBare(yarp::os::ConnectionWriter& connection) const override
111  {
112  // *** header ***
113  if (!header.write(connection)) {
114  return false;
115  }
116 
117  // *** status_list ***
118  connection.appendInt32(status_list.size());
119  for (size_t i=0; i<status_list.size(); i++) {
120  if (!status_list[i].write(connection)) {
121  return false;
122  }
123  }
124 
125  return !connection.isError();
126  }
127 
128  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
129  {
130  connection.appendInt32(BOTTLE_TAG_LIST);
131  connection.appendInt32(2);
132 
133  // *** header ***
134  if (!header.write(connection)) {
135  return false;
136  }
137 
138  // *** status_list ***
139  connection.appendInt32(BOTTLE_TAG_LIST);
140  connection.appendInt32(status_list.size());
141  for (size_t i=0; i<status_list.size(); i++) {
142  if (!status_list[i].write(connection)) {
143  return false;
144  }
145  }
146 
147  connection.convertTextMode();
148  return !connection.isError();
149  }
150 
152  bool write(yarp::os::ConnectionWriter& connection) const override
153  {
154  return (connection.isBareMode() ? writeBare(connection)
155  : writeBottle(connection));
156  }
157 
158  // This class will serialize ROS style or YARP style depending on protocol.
159  // If you need to force a serialization style, use one of these classes:
162 
163  // The name for this message, ROS will need this
164  static constexpr const char* typeName = "actionlib_msgs/GoalStatusArray";
165 
166  // The checksum for this message, ROS will need this
167  static constexpr const char* typeChecksum = "8b2b82f13216d0a8ea88bd3af735e619";
168 
169  // The source text for this message, ROS will need this
170  static constexpr const char* typeText = "\
171 # Stores the statuses for goals that are currently being tracked\n\
172 # by an action server\n\
173 Header header\n\
174 GoalStatus[] status_list\n\
175 \n\
176 \n\
177 ================================================================================\n\
178 MSG: std_msgs/Header\n\
179 # Standard metadata for higher-level stamped data types.\n\
180 # This is generally used to communicate timestamped data \n\
181 # in a particular coordinate frame.\n\
182 # \n\
183 # sequence ID: consecutively increasing ID \n\
184 uint32 seq\n\
185 #Two-integer timestamp that is expressed as:\n\
186 # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
187 # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
188 # time-handling sugar is provided by the client library\n\
189 time stamp\n\
190 #Frame this data is associated with\n\
191 # 0: no frame\n\
192 # 1: global frame\n\
193 string frame_id\n\
194 \n\
195 ================================================================================\n\
196 MSG: actionlib_msgs/GoalStatus\n\
197 GoalID goal_id\n\
198 uint8 status\n\
199 uint8 PENDING = 0 # The goal has yet to be processed by the action server\n\
200 uint8 ACTIVE = 1 # The goal is currently being processed by the action server\n\
201 uint8 PREEMPTED = 2 # The goal received a cancel request after it started executing\n\
202  # and has since completed its execution (Terminal State)\n\
203 uint8 SUCCEEDED = 3 # The goal was achieved successfully by the action server (Terminal State)\n\
204 uint8 ABORTED = 4 # The goal was aborted during execution by the action server due\n\
205  # to some failure (Terminal State)\n\
206 uint8 REJECTED = 5 # The goal was rejected by the action server without being processed,\n\
207  # because the goal was unattainable or invalid (Terminal State)\n\
208 uint8 PREEMPTING = 6 # The goal received a cancel request after it started executing\n\
209  # and has not yet completed execution\n\
210 uint8 RECALLING = 7 # The goal received a cancel request before it started executing,\n\
211  # but the action server has not yet confirmed that the goal is canceled\n\
212 uint8 RECALLED = 8 # The goal received a cancel request before it started executing\n\
213  # and was successfully cancelled (Terminal State)\n\
214 uint8 LOST = 9 # An action client can determine that a goal is LOST. This should not be\n\
215  # sent over the wire by an action server\n\
216 \n\
217 #Allow for the user to associate a string with GoalStatus for debugging\n\
218 string text\n\
219 \n\
220 \n\
221 ================================================================================\n\
222 MSG: actionlib_msgs/GoalID\n\
223 # The stamp should store the time at which this goal was requested.\n\
224 # It is used by an action server when it tries to preempt all\n\
225 # goals that were requested before a certain time\n\
226 time stamp\n\
227 \n\
228 # The id provides a way to associate feedback and\n\
229 # result message with specific goal requests. The id\n\
230 # specified must be unique.\n\
231 string id\n\
232 \n\
233 ";
234 
235  yarp::os::Type getType() const override
236  {
238  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
239  typ.addProperty("message_definition", yarp::os::Value(typeText));
240  return typ;
241  }
242 };
243 
244 } // namespace actionlib_msgs
245 } // namespace rosmsg
246 } // namespace yarp
247 
248 #endif // YARP_ROSMSG_actionlib_msgs_GoalStatusArray_h
yarp::rosmsg::actionlib_msgs::GoalStatusArray::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: GoalStatusArray.h:56
yarp::rosmsg::std_msgs::Header::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: Header.h:115
yarp::rosmsg::actionlib_msgs::GoalStatusArray::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: GoalStatusArray.h:110
yarp::rosmsg::actionlib_msgs::GoalStatusArray::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: GoalStatusArray.h:104
WireTypes.h
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
actionlib_msgs
Definition: GoalID.h:22
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
Header.h
yarp::os::ConnectionReader::isBareMode
virtual bool isBareMode() const =0
Check if the connection is bare mode.
yarp::rosmsg::std_msgs::Header::clear
void clear()
Definition: Header.h:58
Wire.h
yarp::rosmsg::actionlib_msgs::GoalStatusArray::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: GoalStatusArray.h:128
yarp::rosmsg::actionlib_msgs::GoalStatusArray::typeName
static constexpr const char * typeName
Definition: GoalStatusArray.h:164
yarp::rosmsg::actionlib_msgs::GoalStatusArray::GoalStatusArray
GoalStatusArray()
Definition: GoalStatusArray.h:41
yarp::rosmsg::actionlib_msgs::GoalStatusArray::getType
yarp::os::Type getType() const override
Definition: GoalStatusArray.h:235
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::actionlib_msgs::GoalStatusArray::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: GoalStatusArray.h:152
yarp::os::ConnectionReader::expectInt32
virtual std::int32_t expectInt32()=0
Read a 32-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::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::os::ConnectionReader::isError
virtual bool isError() const =0
GoalStatus.h
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::actionlib_msgs::GoalStatusArray::clear
void clear()
Definition: GoalStatusArray.h:47
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::actionlib_msgs::GoalStatusArray::typeText
static constexpr const char * typeText
Definition: GoalStatusArray.h:170
yarp::rosmsg::std_msgs::Header::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: Header.h:162
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::rosmsg::actionlib_msgs::GoalStatusArray::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: GoalStatusArray.h:75
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::rosmsg::actionlib_msgs::GoalStatusArray
Definition: GoalStatusArray.h:36
yarp::rosmsg::actionlib_msgs::GoalStatusArray::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::actionlib_msgs::GoalStatusArray > rosStyle
Definition: GoalStatusArray.h:160
yarp::os::idl::BareStyle
Definition: BareStyle.h:22
yarp::rosmsg::actionlib_msgs::GoalStatusArray::status_list
std::vector< yarp::rosmsg::actionlib_msgs::GoalStatus > status_list
Definition: GoalStatusArray.h:39
yarp::rosmsg::actionlib_msgs::GoalStatusArray::header
yarp::rosmsg::std_msgs::Header header
Definition: GoalStatusArray.h:38
yarp::rosmsg::actionlib_msgs::GoalStatusArray::typeChecksum
static constexpr const char * typeChecksum
Definition: GoalStatusArray.h:167
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::Header
Definition: Header.h:45
yarp::os::idl::WireReader::readListHeader
bool readListHeader()
Definition: WireReader.cpp:470
yarp::rosmsg::actionlib_msgs::GoalStatusArray::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::actionlib_msgs::GoalStatusArray > bottleStyle
Definition: GoalStatusArray.h:161
yarp::os::idl::WirePortable::write
virtual bool write(const yarp::os::idl::WireWriter &writer) const
Definition: WirePortable.cpp:20