YARP
Yet Another Robot Platform
Map2DLocationData.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 // Autogenerated by Thrift Compiler (0.14.1-yarped)
7 //
8 // This is an automatically generated file.
9 // It could get re-generated if the ALLOW_IDL_GENERATION flag is on.
10 
11 #ifndef YARP_THRIFT_GENERATOR_STRUCT_MAP2DLOCATIONDATA_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_MAP2DLOCATIONDATA_H
13 
14 #include <yarp/dev/api.h>
15 
16 #include <yarp/os/Wire.h>
17 #include <yarp/os/idl/WireTypes.h>
18 
19 namespace yarp {
20 namespace dev {
21 
24 {
25 public:
26  // Fields
27  std::string map_id;
28  double x;
29  double y;
30  double theta;
31 
32  // Default constructor
34 
35  // Constructor with field values
36  Map2DLocationData(const std::string& map_id,
37  const double x,
38  const double y,
39  const double theta);
40 
41  // Read structure on a Wire
42  bool read(yarp::os::idl::WireReader& reader) override;
43 
44  // Read structure on a Connection
45  bool read(yarp::os::ConnectionReader& connection) override;
46 
47  // Write structure on a Wire
48  bool write(const yarp::os::idl::WireWriter& writer) const override;
49 
50  // Write structure on a Connection
51  bool write(yarp::os::ConnectionWriter& connection) const override;
52 
53  // Convert to a printable string
54  std::string toString() const;
55 
56  // If you want to serialize this class without nesting, use this helper
58 
59  class Editor :
60  public yarp::os::Wire,
62  {
63  public:
64  // Editor: default constructor
65  Editor();
66 
67  // Editor: constructor with base class
69 
70  // Editor: destructor
71  ~Editor() override;
72 
73  // Editor: Deleted constructors and operator=
74  Editor(const Editor& rhs) = delete;
75  Editor(Editor&& rhs) = delete;
76  Editor& operator=(const Editor& rhs) = delete;
77  Editor& operator=(Editor&& rhs) = delete;
78 
79  // Editor: edit
80  bool edit(Map2DLocationData& obj, bool dirty = true);
81 
82  // Editor: validity check
83  bool isValid() const;
84 
85  // Editor: state
86  Map2DLocationData& state();
87 
88  // Editor: start editing
89  void start_editing();
90 
91 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
92  YARP_DEPRECATED_MSG("Use start_editing() instead")
93  void begin()
94  {
95  start_editing();
96  }
97 #endif // YARP_NO_DEPRECATED
98 
99  // Editor: stop editing
100  void stop_editing();
101 
102 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
103  YARP_DEPRECATED_MSG("Use stop_editing() instead")
104  void end()
105  {
106  stop_editing();
107  }
108 #endif // YARP_NO_DEPRECATED
109 
110  // Editor: map_id field
111  void set_map_id(const std::string& map_id);
112  const std::string& get_map_id() const;
113  virtual bool will_set_map_id();
114  virtual bool did_set_map_id();
115 
116  // Editor: x field
117  void set_x(const double x);
118  double get_x() const;
119  virtual bool will_set_x();
120  virtual bool did_set_x();
121 
122  // Editor: y field
123  void set_y(const double y);
124  double get_y() const;
125  virtual bool will_set_y();
126  virtual bool did_set_y();
127 
128  // Editor: theta field
129  void set_theta(const double theta);
130  double get_theta() const;
131  virtual bool will_set_theta();
132  virtual bool did_set_theta();
133 
134  // Editor: clean
135  void clean();
136 
137  // Editor: read
138  bool read(yarp::os::ConnectionReader& connection) override;
139 
140  // Editor: write
141  bool write(yarp::os::ConnectionWriter& connection) const override;
142 
143  private:
144  // Editor: state
145  Map2DLocationData* obj;
146  bool obj_owned;
147  int group;
148 
149  // Editor: dirty variables
150  bool is_dirty;
151  bool is_dirty_map_id;
152  bool is_dirty_x;
153  bool is_dirty_y;
154  bool is_dirty_theta;
155  int dirty_count;
156 
157  // Editor: send if possible
158  void communicate();
159 
160  // Editor: mark dirty overall
161  void mark_dirty();
162 
163  // Editor: mark dirty single fields
164  void mark_dirty_map_id();
165  void mark_dirty_x();
166  void mark_dirty_y();
167  void mark_dirty_theta();
168 
169  // Editor: dirty_flags
170  void dirty_flags(bool flag);
171  };
172 
173 private:
174  // read/write map_id field
175  bool read_map_id(yarp::os::idl::WireReader& reader);
176  bool write_map_id(const yarp::os::idl::WireWriter& writer) const;
177  bool nested_read_map_id(yarp::os::idl::WireReader& reader);
178  bool nested_write_map_id(const yarp::os::idl::WireWriter& writer) const;
179 
180  // read/write x field
181  bool read_x(yarp::os::idl::WireReader& reader);
182  bool write_x(const yarp::os::idl::WireWriter& writer) const;
183  bool nested_read_x(yarp::os::idl::WireReader& reader);
184  bool nested_write_x(const yarp::os::idl::WireWriter& writer) const;
185 
186  // read/write y field
187  bool read_y(yarp::os::idl::WireReader& reader);
188  bool write_y(const yarp::os::idl::WireWriter& writer) const;
189  bool nested_read_y(yarp::os::idl::WireReader& reader);
190  bool nested_write_y(const yarp::os::idl::WireWriter& writer) const;
191 
192  // read/write theta field
193  bool read_theta(yarp::os::idl::WireReader& reader);
194  bool write_theta(const yarp::os::idl::WireWriter& writer) const;
195  bool nested_read_theta(yarp::os::idl::WireReader& reader);
196  bool nested_write_theta(const yarp::os::idl::WireWriter& writer) const;
197 };
198 
199 } // namespace yarp
200 } // namespace dev
201 
202 #endif // YARP_THRIFT_GENERATOR_STRUCT_MAP2DLOCATIONDATA_H
Editor(const Editor &rhs)=delete
Editor & operator=(Editor &&rhs)=delete
Editor & operator=(const Editor &rhs)=delete
yarp::os::idl::Unwrapped< Map2DLocationData > unwrapped
An interface for reading from a network connection.
An interface for writing to a network connection.
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:24
Base class for IDL client/server.
Definition: Wire.h:19
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:23
IDL-friendly connection reader.
Definition: WireReader.h:30
IDL-friendly connection writer.
Definition: WireWriter.h:30
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition: compiler.h:2885
std::string toString(const T &value)
convert an arbitrary type to string.
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:923
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1099
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18