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