iol
CalibMatrixReq.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_CALIBMATRIXREQ_H
15 #define YARP_THRIFT_GENERATOR_STRUCT_CALIBMATRIXREQ_H
16 
17 #include <yarp/os/Wire.h>
18 #include <yarp/os/idl/WireTypes.h>
19 #include <yarp/sig/Matrix.h>
20 
26  public yarp::os::idl::WirePortable
27 {
28 public:
29  // Fields
33  std::string result;
37  yarp::sig::Matrix H;
38 
39  // Default constructor
41 
42  // Constructor with field values
43  CalibMatrixReq(const std::string& result,
44  const yarp::sig::Matrix& H);
45 
46  // Read structure on a Wire
47  bool read(yarp::os::idl::WireReader& reader) override;
48 
49  // Read structure on a Connection
50  bool read(yarp::os::ConnectionReader& connection) override;
51 
52  // Write structure on a Wire
53  bool write(const yarp::os::idl::WireWriter& writer) const override;
54 
55  // Write structure on a Connection
56  bool write(yarp::os::ConnectionWriter& connection) const override;
57 
58  // Convert to a printable string
59  std::string toString() const;
60 
61  // If you want to serialize this class without nesting, use this helper
62  typedef yarp::os::idl::Unwrapped<CalibMatrixReq> unwrapped;
63 
64  class Editor :
65  public yarp::os::Wire,
66  public yarp::os::PortWriter
67  {
68  public:
69  // Editor: default constructor
70  Editor();
71 
72  // Editor: constructor with base class
73  Editor(CalibMatrixReq& obj);
74 
75  // Editor: destructor
76  ~Editor() override;
77 
78  // Editor: Deleted constructors and operator=
79  Editor(const Editor& rhs) = delete;
80  Editor(Editor&& rhs) = delete;
81  Editor& operator=(const Editor& rhs) = delete;
82  Editor& operator=(Editor&& rhs) = delete;
83 
84  // Editor: edit
85  bool edit(CalibMatrixReq& obj, bool dirty = true);
86 
87  // Editor: validity check
88  bool isValid() const;
89 
90  // Editor: state
91  CalibMatrixReq& state();
92 
93  // Editor: start editing
94  void start_editing();
95 
96 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
97  YARP_DEPRECATED_MSG("Use start_editing() instead")
98  void begin()
99  {
100  start_editing();
101  }
102 #endif // YARP_NO_DEPRECATED
103 
104  // Editor: stop editing
105  void stop_editing();
106 
107 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
108  YARP_DEPRECATED_MSG("Use stop_editing() instead")
109  void end()
110  {
111  stop_editing();
112  }
113 #endif // YARP_NO_DEPRECATED
114 
115  // Editor: result field
116  void set_result(const std::string& result);
117  const std::string& get_result() const;
118  virtual bool will_set_result();
119  virtual bool did_set_result();
120 
121  // Editor: H field
122  void set_H(const yarp::sig::Matrix& H);
123  const yarp::sig::Matrix& get_H() const;
124  virtual bool will_set_H();
125  virtual bool did_set_H();
126 
127  // Editor: clean
128  void clean();
129 
130  // Editor: read
131  bool read(yarp::os::ConnectionReader& connection) override;
132 
133  // Editor: write
134  bool write(yarp::os::ConnectionWriter& connection) const override;
135 
136  private:
137  // Editor: state
138  CalibMatrixReq* obj;
139  bool obj_owned;
140  int group;
141 
142  // Editor: dirty variables
143  bool is_dirty;
144  bool is_dirty_result;
145  bool is_dirty_H;
146  int dirty_count;
147 
148  // Editor: send if possible
149  void communicate();
150 
151  // Editor: mark dirty overall
152  void mark_dirty();
153 
154  // Editor: mark dirty single fields
155  void mark_dirty_result();
156  void mark_dirty_H();
157 
158  // Editor: dirty_flags
159  void dirty_flags(bool flag);
160  };
161 
162 private:
163  // read/write result field
164  bool read_result(yarp::os::idl::WireReader& reader);
165  bool write_result(const yarp::os::idl::WireWriter& writer) const;
166  bool nested_read_result(yarp::os::idl::WireReader& reader);
167  bool nested_write_result(const yarp::os::idl::WireWriter& writer) const;
168 
169  // read/write H field
170  bool read_H(yarp::os::idl::WireReader& reader);
171  bool write_H(const yarp::os::idl::WireWriter& writer) const;
172  bool nested_read_H(yarp::os::idl::WireReader& reader);
173  bool nested_write_H(const yarp::os::idl::WireWriter& writer) const;
174 };
175 
176 #endif // YARP_THRIFT_GENERATOR_STRUCT_CALIBMATRIXREQ_H
CalibMatrixReq IDL structure to ask for calibration matrix.
std::string result
contain [ok]/[fail] on success/failure.
yarp::sig::Matrix H
the calibration matrix.