YARP
Yet Another Robot Platform
SensorMeasurements.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_SENSORMEASUREMENTS_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_SENSORMEASUREMENTS_H
13 
14 #include <yarp/os/Wire.h>
15 #include <yarp/os/idl/WireTypes.h>
16 #include <SensorMeasurement.h>
17 
20 {
21 public:
22  // Fields
23  std::vector<SensorMeasurement> measurements;
24 
25  // Default constructor
27 
28  // Constructor with field values
29  SensorMeasurements(const std::vector<SensorMeasurement>& measurements);
30 
31  // Read structure on a Wire
32  bool read(yarp::os::idl::WireReader& reader) override;
33 
34  // Read structure on a Connection
35  bool read(yarp::os::ConnectionReader& connection) override;
36 
37  // Write structure on a Wire
38  bool write(const yarp::os::idl::WireWriter& writer) const override;
39 
40  // Write structure on a Connection
41  bool write(yarp::os::ConnectionWriter& connection) const override;
42 
43  // Convert to a printable string
44  std::string toString() const;
45 
46  // If you want to serialize this class without nesting, use this helper
48 
49  class Editor :
50  public yarp::os::Wire,
52  {
53  public:
54  // Editor: default constructor
55  Editor();
56 
57  // Editor: constructor with base class
59 
60  // Editor: destructor
61  ~Editor() override;
62 
63  // Editor: Deleted constructors and operator=
64  Editor(const Editor& rhs) = delete;
65  Editor(Editor&& rhs) = delete;
66  Editor& operator=(const Editor& rhs) = delete;
67  Editor& operator=(Editor&& rhs) = delete;
68 
69  // Editor: edit
70  bool edit(SensorMeasurements& obj, bool dirty = true);
71 
72  // Editor: validity check
73  bool isValid() const;
74 
75  // Editor: state
77 
78  // Editor: start editing
79  void start_editing();
80 
81 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
82  YARP_DEPRECATED_MSG("Use start_editing() instead")
83  void begin()
84  {
85  start_editing();
86  }
87 #endif // YARP_NO_DEPRECATED
88 
89  // Editor: stop editing
90  void stop_editing();
91 
92 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
93  YARP_DEPRECATED_MSG("Use stop_editing() instead")
94  void end()
95  {
96  stop_editing();
97  }
98 #endif // YARP_NO_DEPRECATED
99 
100  // Editor: measurements field
101  void set_measurements(const std::vector<SensorMeasurement>& measurements);
102  void set_measurements(size_t index, const SensorMeasurement& elem);
103  const std::vector<SensorMeasurement>& get_measurements() const;
104  virtual bool will_set_measurements();
105  virtual bool did_set_measurements();
106 
107  // Editor: clean
108  void clean();
109 
110  // Editor: read
111  bool read(yarp::os::ConnectionReader& connection) override;
112 
113  // Editor: write
114  bool write(yarp::os::ConnectionWriter& connection) const override;
115 
116  private:
117  // Editor: state
118  SensorMeasurements* obj;
119  bool obj_owned;
120  int group;
121 
122  // Editor: dirty variables
123  bool is_dirty;
124  bool is_dirty_measurements;
125  int dirty_count;
126 
127  // Editor: send if possible
128  void communicate();
129 
130  // Editor: mark dirty overall
131  void mark_dirty();
132 
133  // Editor: mark dirty single fields
134  void mark_dirty_measurements();
135 
136  // Editor: dirty_flags
137  void dirty_flags(bool flag);
138  };
139 
140 private:
141  // read/write measurements field
142  bool read_measurements(yarp::os::idl::WireReader& reader);
143  bool write_measurements(const yarp::os::idl::WireWriter& writer) const;
144  bool nested_read_measurements(yarp::os::idl::WireReader& reader);
145  bool nested_write_measurements(const yarp::os::idl::WireWriter& writer) const;
146 };
147 
148 #endif // YARP_THRIFT_GENERATOR_STRUCT_SENSORMEASUREMENTS_H
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
bool edit(SensorMeasurements &obj, bool dirty=true)
Editor & operator=(const Editor &rhs)=delete
void set_measurements(const std::vector< SensorMeasurement > &measurements)
Editor(Editor &&rhs)=delete
Editor(const Editor &rhs)=delete
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Editor & operator=(Editor &&rhs)=delete
const std::vector< SensorMeasurement > & get_measurements() const
SensorMeasurements & state()
yarp::os::idl::Unwrapped< SensorMeasurements > unwrapped
std::vector< SensorMeasurement > measurements
std::string toString() const
bool write(const yarp::os::idl::WireWriter &writer) const override
bool read(yarp::os::idl::WireReader &reader) override
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