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