YARP
Yet Another Robot Platform
SensorMetadata.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_SENSORMETADATA_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_SENSORMETADATA_H
13 
14 #include <yarp/os/Wire.h>
15 #include <yarp/os/idl/WireTypes.h>
16 
19 {
20 public:
21  // Fields
22  std::string name;
23  std::string frameName;
24  std::string additionalMetadata;
25 
26  // Default constructor
28 
29  // Constructor with field values
30  SensorMetadata(const std::string& name,
31  const std::string& frameName,
32  const std::string& additionalMetadata);
33 
34  // Read structure on a Wire
35  bool read(yarp::os::idl::WireReader& reader) override;
36 
37  // Read structure on a Connection
38  bool read(yarp::os::ConnectionReader& connection) override;
39 
40  // Write structure on a Wire
41  bool write(const yarp::os::idl::WireWriter& writer) const override;
42 
43  // Write structure on a Connection
44  bool write(yarp::os::ConnectionWriter& connection) const override;
45 
46  // Convert to a printable string
47  std::string toString() const;
48 
49  // If you want to serialize this class without nesting, use this helper
51 
52  class Editor :
53  public yarp::os::Wire,
55  {
56  public:
57  // Editor: default constructor
58  Editor();
59 
60  // Editor: constructor with base class
61  Editor(SensorMetadata& obj);
62 
63  // Editor: destructor
64  ~Editor() override;
65 
66  // Editor: Deleted constructors and operator=
67  Editor(const Editor& rhs) = delete;
68  Editor(Editor&& rhs) = delete;
69  Editor& operator=(const Editor& rhs) = delete;
70  Editor& operator=(Editor&& rhs) = delete;
71 
72  // Editor: edit
73  bool edit(SensorMetadata& obj, bool dirty = true);
74 
75  // Editor: validity check
76  bool isValid() const;
77 
78  // Editor: state
80 
81  // Editor: start editing
82  void start_editing();
83 
84 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
85  YARP_DEPRECATED_MSG("Use start_editing() instead")
86  void begin()
87  {
88  start_editing();
89  }
90 #endif // YARP_NO_DEPRECATED
91 
92  // Editor: stop editing
93  void stop_editing();
94 
95 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
96  YARP_DEPRECATED_MSG("Use stop_editing() instead")
97  void end()
98  {
99  stop_editing();
100  }
101 #endif // YARP_NO_DEPRECATED
102 
103  // Editor: name field
104  void set_name(const std::string& name);
105  const std::string& get_name() const;
106  virtual bool will_set_name();
107  virtual bool did_set_name();
108 
109  // Editor: frameName field
110  void set_frameName(const std::string& frameName);
111  const std::string& get_frameName() const;
112  virtual bool will_set_frameName();
113  virtual bool did_set_frameName();
114 
115  // Editor: additionalMetadata field
116  void set_additionalMetadata(const std::string& additionalMetadata);
117  const std::string& get_additionalMetadata() const;
118  virtual bool will_set_additionalMetadata();
119  virtual bool did_set_additionalMetadata();
120 
121  // Editor: clean
122  void clean();
123 
124  // Editor: read
125  bool read(yarp::os::ConnectionReader& connection) override;
126 
127  // Editor: write
128  bool write(yarp::os::ConnectionWriter& connection) const override;
129 
130  private:
131  // Editor: state
132  SensorMetadata* obj;
133  bool obj_owned;
134  int group;
135 
136  // Editor: dirty variables
137  bool is_dirty;
138  bool is_dirty_name;
139  bool is_dirty_frameName;
140  bool is_dirty_additionalMetadata;
141  int dirty_count;
142 
143  // Editor: send if possible
144  void communicate();
145 
146  // Editor: mark dirty overall
147  void mark_dirty();
148 
149  // Editor: mark dirty single fields
150  void mark_dirty_name();
151  void mark_dirty_frameName();
152  void mark_dirty_additionalMetadata();
153 
154  // Editor: dirty_flags
155  void dirty_flags(bool flag);
156  };
157 
158 private:
159  // read/write name field
160  bool read_name(yarp::os::idl::WireReader& reader);
161  bool write_name(const yarp::os::idl::WireWriter& writer) const;
162  bool nested_read_name(yarp::os::idl::WireReader& reader);
163  bool nested_write_name(const yarp::os::idl::WireWriter& writer) const;
164 
165  // read/write frameName field
166  bool read_frameName(yarp::os::idl::WireReader& reader);
167  bool write_frameName(const yarp::os::idl::WireWriter& writer) const;
168  bool nested_read_frameName(yarp::os::idl::WireReader& reader);
169  bool nested_write_frameName(const yarp::os::idl::WireWriter& writer) const;
170 
171  // read/write additionalMetadata field
172  bool read_additionalMetadata(yarp::os::idl::WireReader& reader);
173  bool write_additionalMetadata(const yarp::os::idl::WireWriter& writer) const;
174  bool nested_read_additionalMetadata(yarp::os::idl::WireReader& reader);
175  bool nested_write_additionalMetadata(const yarp::os::idl::WireWriter& writer) const;
176 };
177 
178 #endif // YARP_THRIFT_GENERATOR_STRUCT_SENSORMETADATA_H
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
void set_additionalMetadata(const std::string &additionalMetadata)
void set_name(const std::string &name)
virtual bool did_set_name()
virtual bool did_set_frameName()
const std::string & get_frameName() const
bool edit(SensorMetadata &obj, bool dirty=true)
virtual bool will_set_name()
Editor(Editor &&rhs)=delete
virtual bool will_set_frameName()
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
virtual bool did_set_additionalMetadata()
Editor & operator=(const Editor &rhs)=delete
Editor(const Editor &rhs)=delete
void set_frameName(const std::string &frameName)
virtual bool will_set_additionalMetadata()
Editor & operator=(Editor &&rhs)=delete
const std::string & get_additionalMetadata() const
const std::string & get_name() const
SensorMetadata & state()
yarp::os::idl::Unwrapped< SensorMetadata > unwrapped
std::string frameName
bool write(const yarp::os::idl::WireWriter &writer) const override
bool read(yarp::os::idl::WireReader &reader) override
std::string additionalMetadata
std::string toString() const
std::string name
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