iCub-main
PointReq.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_POINTREQ_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_POINTREQ_H
13 
14 #include <yarp/os/Wire.h>
15 #include <yarp/os/idl/WireTypes.h>
16 
21 class PointReq :
22  public yarp::os::idl::WirePortable
23 {
24 public:
25  // Fields
29  std::string result{};
33  double x{0.0};
37  double y{0.0};
41  double z{0.0};
42 
43  // Default constructor
44  PointReq() = default;
45 
46  // Constructor with field values
47  PointReq(const std::string& result,
48  const double x,
49  const double y,
50  const double z);
51 
52  // Read structure on a Wire
53  bool read(yarp::os::idl::WireReader& reader) override;
54 
55  // Read structure on a Connection
56  bool read(yarp::os::ConnectionReader& connection) override;
57 
58  // Write structure on a Wire
59  bool write(const yarp::os::idl::WireWriter& writer) const override;
60 
61  // Write structure on a Connection
62  bool write(yarp::os::ConnectionWriter& connection) const override;
63 
64  // Convert to a printable string
65  std::string toString() const;
66 
67  // If you want to serialize this class without nesting, use this helper
68  typedef yarp::os::idl::Unwrapped<PointReq> unwrapped;
69 
70  class Editor :
71  public yarp::os::Wire,
72  public yarp::os::PortWriter
73  {
74  public:
75  // Editor: default constructor
76  Editor();
77 
78  // Editor: constructor with base class
80 
81  // Editor: destructor
82  ~Editor() override;
83 
84  // Editor: Deleted constructors and operator=
85  Editor(const Editor& rhs) = delete;
86  Editor(Editor&& rhs) = delete;
87  Editor& operator=(const Editor& rhs) = delete;
88  Editor& operator=(Editor&& rhs) = delete;
89 
90  // Editor: edit
91  bool edit(PointReq& obj, bool dirty = true);
92 
93  // Editor: validity check
94  bool isValid() const;
95 
96  // Editor: state
98 
99  // Editor: start editing
101 
102 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
103  YARP_DEPRECATED_MSG("Use start_editing() instead")
104  void begin()
105  {
106  start_editing();
107  }
108 #endif // YARP_NO_DEPRECATED
109 
110  // Editor: stop editing
111  void stop_editing();
112 
113 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
114  YARP_DEPRECATED_MSG("Use stop_editing() instead")
115  void end()
116  {
117  stop_editing();
118  }
119 #endif // YARP_NO_DEPRECATED
120 
121  // Editor: result field
122  void set_result(const std::string& result);
123  const std::string& get_result() const;
124  virtual bool will_set_result();
125  virtual bool did_set_result();
126 
127  // Editor: x field
128  void set_x(const double x);
129  double get_x() const;
130  virtual bool will_set_x();
131  virtual bool did_set_x();
132 
133  // Editor: y field
134  void set_y(const double y);
135  double get_y() const;
136  virtual bool will_set_y();
137  virtual bool did_set_y();
138 
139  // Editor: z field
140  void set_z(const double z);
141  double get_z() const;
142  virtual bool will_set_z();
143  virtual bool did_set_z();
144 
145  // Editor: clean
146  void clean();
147 
148  // Editor: read
149  bool read(yarp::os::ConnectionReader& connection) override;
150 
151  // Editor: write
152  bool write(yarp::os::ConnectionWriter& connection) const override;
153 
154  private:
155  // Editor: state
156  PointReq* obj;
157  bool obj_owned;
158  int group;
159 
160  // Editor: dirty variables
161  bool is_dirty;
162  bool is_dirty_result;
163  bool is_dirty_x;
164  bool is_dirty_y;
165  bool is_dirty_z;
166  int dirty_count;
167 
168  // Editor: send if possible
169  void communicate();
170 
171  // Editor: mark dirty overall
172  void mark_dirty();
173 
174  // Editor: mark dirty single fields
175  void mark_dirty_result();
176  void mark_dirty_x();
177  void mark_dirty_y();
178  void mark_dirty_z();
179 
180  // Editor: dirty_flags
181  void dirty_flags(bool flag);
182  };
183 
184 private:
185  // read/write result field
186  bool read_result(yarp::os::idl::WireReader& reader);
187  bool write_result(const yarp::os::idl::WireWriter& writer) const;
188  bool nested_read_result(yarp::os::idl::WireReader& reader);
189  bool nested_write_result(const yarp::os::idl::WireWriter& writer) const;
190 
191  // read/write x field
192  bool read_x(yarp::os::idl::WireReader& reader);
193  bool write_x(const yarp::os::idl::WireWriter& writer) const;
194  bool nested_read_x(yarp::os::idl::WireReader& reader);
195  bool nested_write_x(const yarp::os::idl::WireWriter& writer) const;
196 
197  // read/write y field
198  bool read_y(yarp::os::idl::WireReader& reader);
199  bool write_y(const yarp::os::idl::WireWriter& writer) const;
200  bool nested_read_y(yarp::os::idl::WireReader& reader);
201  bool nested_write_y(const yarp::os::idl::WireWriter& writer) const;
202 
203  // read/write z field
204  bool read_z(yarp::os::idl::WireReader& reader);
205  bool write_z(const yarp::os::idl::WireWriter& writer) const;
206  bool nested_read_z(yarp::os::idl::WireReader& reader);
207  bool nested_write_z(const yarp::os::idl::WireWriter& writer) const;
208 };
209 
210 #endif // YARP_THRIFT_GENERATOR_STRUCT_POINTREQ_H
double get_y() const
void set_y(const double y)
virtual bool did_set_result()
bool read(yarp::os::ConnectionReader &connection) override
virtual bool did_set_y()
double get_x() const
virtual bool did_set_x()
bool write(yarp::os::ConnectionWriter &connection) const override
Editor(const Editor &rhs)=delete
void set_z(const double z)
bool isValid() const
virtual bool will_set_y()
Editor & operator=(const Editor &rhs)=delete
virtual bool will_set_result()
void set_x(const double x)
double get_z() const
virtual bool will_set_z()
const std::string & get_result() const
Editor(PointReq &obj)
virtual bool did_set_z()
Editor(Editor &&rhs)=delete
Editor & operator=(Editor &&rhs)=delete
void set_result(const std::string &result)
virtual bool will_set_x()
~Editor() override
PointReq & state()
bool edit(PointReq &obj, bool dirty=true)
PointReq IDL structure to send/receive points.
Definition: PointReq.h:23
double y
the y-coordinate.
Definition: PointReq.h:37
bool read(yarp::os::ConnectionReader &connection) override
PointReq()=default
bool write(yarp::os::ConnectionWriter &connection) const override
PointReq(const std::string &result, const double x, const double y, const double z)
std::string toString() const
yarp::os::idl::Unwrapped< PointReq > unwrapped
Definition: PointReq.h:68
bool read(yarp::os::idl::WireReader &reader) override
std::string result
contain [ok]/[fail] on success/failure.
Definition: PointReq.h:29
double x
the x-coordinate.
Definition: PointReq.h:33
bool write(const yarp::os::idl::WireWriter &writer) const override
double z
the z-coordinate.
Definition: PointReq.h:41