YARP
Yet Another Robot Platform
LaserScan2D.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_LASERSCAN2D_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_LASERSCAN2D_H
13 
14 #include <yarp/dev/api.h>
15 
16 #include <yarp/os/Wire.h>
17 #include <yarp/os/idl/WireTypes.h>
18 #include <yarp/sig/Vector.h>
19 
20 namespace yarp {
21 namespace dev {
22 
25 {
26 public:
27  // Fields
31  double angle_min;
35  double angle_max;
39  double range_min;
43  double range_max;
48  std::int32_t status;
49 
50  // Default constructor
51  LaserScan2D();
52 
53  // Constructor with field values
54  LaserScan2D(const double angle_min,
55  const double angle_max,
56  const double range_min,
57  const double range_max,
58  const yarp::sig::Vector& scans,
59  const std::int32_t status);
60 
61  // Read structure on a Wire
62  bool read(yarp::os::idl::WireReader& reader) override;
63 
64  // Read structure on a Connection
65  bool read(yarp::os::ConnectionReader& connection) override;
66 
67  // Write structure on a Wire
68  bool write(const yarp::os::idl::WireWriter& writer) const override;
69 
70  // Write structure on a Connection
71  bool write(yarp::os::ConnectionWriter& connection) const override;
72 
73  // Convert to a printable string
74  std::string toString() const;
75 
76  // If you want to serialize this class without nesting, use this helper
78 
79  class Editor :
80  public yarp::os::Wire,
82  {
83  public:
84  // Editor: default constructor
85  Editor();
86 
87  // Editor: constructor with base class
88  Editor(LaserScan2D& obj);
89 
90  // Editor: destructor
91  ~Editor() override;
92 
93  // Editor: Deleted constructors and operator=
94  Editor(const Editor& rhs) = delete;
95  Editor(Editor&& rhs) = delete;
96  Editor& operator=(const Editor& rhs) = delete;
97  Editor& operator=(Editor&& rhs) = delete;
98 
99  // Editor: edit
100  bool edit(LaserScan2D& obj, bool dirty = true);
101 
102  // Editor: validity check
103  bool isValid() const;
104 
105  // Editor: state
106  LaserScan2D& state();
107 
108  // Editor: start editing
109  void start_editing();
110 
111 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
112  YARP_DEPRECATED_MSG("Use start_editing() instead")
113  void begin()
114  {
115  start_editing();
116  }
117 #endif // YARP_NO_DEPRECATED
118 
119  // Editor: stop editing
120  void stop_editing();
121 
122 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
123  YARP_DEPRECATED_MSG("Use stop_editing() instead")
124  void end()
125  {
126  stop_editing();
127  }
128 #endif // YARP_NO_DEPRECATED
129 
130  // Editor: angle_min field
131  void set_angle_min(const double angle_min);
132  double get_angle_min() const;
133  virtual bool will_set_angle_min();
134  virtual bool did_set_angle_min();
135 
136  // Editor: angle_max field
137  void set_angle_max(const double angle_max);
138  double get_angle_max() const;
139  virtual bool will_set_angle_max();
140  virtual bool did_set_angle_max();
141 
142  // Editor: range_min field
143  void set_range_min(const double range_min);
144  double get_range_min() const;
145  virtual bool will_set_range_min();
146  virtual bool did_set_range_min();
147 
148  // Editor: range_max field
149  void set_range_max(const double range_max);
150  double get_range_max() const;
151  virtual bool will_set_range_max();
152  virtual bool did_set_range_max();
153 
154  // Editor: scans field
155  void set_scans(const yarp::sig::Vector& scans);
156  const yarp::sig::Vector& get_scans() const;
157  virtual bool will_set_scans();
158  virtual bool did_set_scans();
159 
160  // Editor: status field
161  void set_status(const std::int32_t status);
162  std::int32_t get_status() const;
163  virtual bool will_set_status();
164  virtual bool did_set_status();
165 
166  // Editor: clean
167  void clean();
168 
169  // Editor: read
170  bool read(yarp::os::ConnectionReader& connection) override;
171 
172  // Editor: write
173  bool write(yarp::os::ConnectionWriter& connection) const override;
174 
175  private:
176  // Editor: state
177  LaserScan2D* obj;
178  bool obj_owned;
179  int group;
180 
181  // Editor: dirty variables
182  bool is_dirty;
183  bool is_dirty_angle_min;
184  bool is_dirty_angle_max;
185  bool is_dirty_range_min;
186  bool is_dirty_range_max;
187  bool is_dirty_scans;
188  bool is_dirty_status;
189  int dirty_count;
190 
191  // Editor: send if possible
192  void communicate();
193 
194  // Editor: mark dirty overall
195  void mark_dirty();
196 
197  // Editor: mark dirty single fields
198  void mark_dirty_angle_min();
199  void mark_dirty_angle_max();
200  void mark_dirty_range_min();
201  void mark_dirty_range_max();
202  void mark_dirty_scans();
203  void mark_dirty_status();
204 
205  // Editor: dirty_flags
206  void dirty_flags(bool flag);
207  };
208 
209 private:
210  // read/write angle_min field
211  bool read_angle_min(yarp::os::idl::WireReader& reader);
212  bool write_angle_min(const yarp::os::idl::WireWriter& writer) const;
213  bool nested_read_angle_min(yarp::os::idl::WireReader& reader);
214  bool nested_write_angle_min(const yarp::os::idl::WireWriter& writer) const;
215 
216  // read/write angle_max field
217  bool read_angle_max(yarp::os::idl::WireReader& reader);
218  bool write_angle_max(const yarp::os::idl::WireWriter& writer) const;
219  bool nested_read_angle_max(yarp::os::idl::WireReader& reader);
220  bool nested_write_angle_max(const yarp::os::idl::WireWriter& writer) const;
221 
222  // read/write range_min field
223  bool read_range_min(yarp::os::idl::WireReader& reader);
224  bool write_range_min(const yarp::os::idl::WireWriter& writer) const;
225  bool nested_read_range_min(yarp::os::idl::WireReader& reader);
226  bool nested_write_range_min(const yarp::os::idl::WireWriter& writer) const;
227 
228  // read/write range_max field
229  bool read_range_max(yarp::os::idl::WireReader& reader);
230  bool write_range_max(const yarp::os::idl::WireWriter& writer) const;
231  bool nested_read_range_max(yarp::os::idl::WireReader& reader);
232  bool nested_write_range_max(const yarp::os::idl::WireWriter& writer) const;
233 
234  // read/write scans field
235  bool read_scans(yarp::os::idl::WireReader& reader);
236  bool write_scans(const yarp::os::idl::WireWriter& writer) const;
237  bool nested_read_scans(yarp::os::idl::WireReader& reader);
238  bool nested_write_scans(const yarp::os::idl::WireWriter& writer) const;
239 
240  // read/write status field
241  bool read_status(yarp::os::idl::WireReader& reader);
242  bool write_status(const yarp::os::idl::WireWriter& writer) const;
243  bool nested_read_status(yarp::os::idl::WireReader& reader);
244  bool nested_write_status(const yarp::os::idl::WireWriter& writer) const;
245 };
246 
247 } // namespace yarp
248 } // namespace dev
249 
250 #endif // YARP_THRIFT_GENERATOR_STRUCT_LASERSCAN2D_H
contains the definition of a Vector type
Editor & operator=(Editor &&rhs)=delete
Editor(Editor &&rhs)=delete
Editor & operator=(const Editor &rhs)=delete
Editor(const Editor &rhs)=delete
yarp::sig::Vector scans
the scan data, measured in [m].
Definition: LaserScan2D.h:47
std::int32_t status
Definition: LaserScan2D.h:48
yarp::os::idl::Unwrapped< LaserScan2D > unwrapped
Definition: LaserScan2D.h:77
double angle_min
first angle of the scan [deg]
Definition: LaserScan2D.h:31
double angle_max
last angle of the scan [deg]
Definition: LaserScan2D.h:35
double range_min
the minimum distance of the scan [m]
Definition: LaserScan2D.h:39
double range_max
the maximum distance of the scan [m]
Definition: LaserScan2D.h:43
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:922
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1098
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18