YARP
Yet Another Robot Platform
SensorMetadata.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 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_SENSORMETADATA_H
15 #define YARP_THRIFT_GENERATOR_STRUCT_SENSORMETADATA_H
16 
17 #include <yarp/os/Wire.h>
18 #include <yarp/os/idl/WireTypes.h>
19 
22 {
23 public:
24  // Fields
25  std::string name;
26  std::string frameName;
27  std::string additionalMetadata;
28 
29  // Default constructor
31 
32  // Constructor with field values
33  SensorMetadata(const std::string& name,
34  const std::string& frameName,
35  const std::string& additionalMetadata);
36 
37  // Read structure on a Wire
38  bool read(yarp::os::idl::WireReader& reader) override;
39 
40  // Read structure on a Connection
41  bool read(yarp::os::ConnectionReader& connection) override;
42 
43  // Write structure on a Wire
44  bool write(const yarp::os::idl::WireWriter& writer) const override;
45 
46  // Write structure on a Connection
47  bool write(yarp::os::ConnectionWriter& connection) const override;
48 
49  // Convert to a printable string
50  std::string toString() const;
51 
52  // If you want to serialize this class without nesting, use this helper
54 
55  class Editor :
56  public yarp::os::Wire,
58  {
59  public:
60  // Editor: default constructor
61  Editor();
62 
63  // Editor: constructor with base class
64  Editor(SensorMetadata& obj);
65 
66  // Editor: destructor
67  ~Editor() override;
68 
69  // Editor: Deleted constructors and operator=
70  Editor(const Editor& rhs) = delete;
71  Editor(Editor&& rhs) = delete;
72  Editor& operator=(const Editor& rhs) = delete;
73  Editor& operator=(Editor&& rhs) = delete;
74 
75  // Editor: edit
76  bool edit(SensorMetadata& obj, bool dirty = true);
77 
78  // Editor: validity check
79  bool isValid() const;
80 
81  // Editor: state
83 
84  // Editor: start editing
85  void start_editing();
86 
87 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
88  YARP_DEPRECATED_MSG("Use start_editing() instead")
89  void begin()
90  {
91  start_editing();
92  }
93 #endif // YARP_NO_DEPRECATED
94 
95  // Editor: stop editing
96  void stop_editing();
97 
98 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
99  YARP_DEPRECATED_MSG("Use stop_editing() instead")
100  void end()
101  {
102  stop_editing();
103  }
104 #endif // YARP_NO_DEPRECATED
105 
106  // Editor: name field
107  void set_name(const std::string& name);
108  const std::string& get_name() const;
109  virtual bool will_set_name();
110  virtual bool did_set_name();
111 
112  // Editor: frameName field
113  void set_frameName(const std::string& frameName);
114  const std::string& get_frameName() const;
115  virtual bool will_set_frameName();
116  virtual bool did_set_frameName();
117 
118  // Editor: additionalMetadata field
119  void set_additionalMetadata(const std::string& additionalMetadata);
120  const std::string& get_additionalMetadata() const;
121  virtual bool will_set_additionalMetadata();
122  virtual bool did_set_additionalMetadata();
123 
124  // Editor: clean
125  void clean();
126 
127  // Editor: read
128  bool read(yarp::os::ConnectionReader& connection) override;
129 
130  // Editor: write
131  bool write(yarp::os::ConnectionWriter& connection) const override;
132 
133  private:
134  // Editor: state
135  SensorMetadata* obj;
136  bool obj_owned;
137  int group;
138 
139  // Editor: dirty variables
140  bool is_dirty;
141  bool is_dirty_name;
142  bool is_dirty_frameName;
143  bool is_dirty_additionalMetadata;
144  int dirty_count;
145 
146  // Editor: send if possible
147  void communicate();
148 
149  // Editor: mark dirty overall
150  void mark_dirty();
151 
152  // Editor: mark dirty single fields
153  void mark_dirty_name();
154  void mark_dirty_frameName();
155  void mark_dirty_additionalMetadata();
156 
157  // Editor: dirty_flags
158  void dirty_flags(bool flag);
159  };
160 
161 private:
162  // read/write name field
163  bool read_name(yarp::os::idl::WireReader& reader);
164  bool write_name(const yarp::os::idl::WireWriter& writer) const;
165  bool nested_read_name(yarp::os::idl::WireReader& reader);
166  bool nested_write_name(const yarp::os::idl::WireWriter& writer) const;
167 
168  // read/write frameName field
169  bool read_frameName(yarp::os::idl::WireReader& reader);
170  bool write_frameName(const yarp::os::idl::WireWriter& writer) const;
171  bool nested_read_frameName(yarp::os::idl::WireReader& reader);
172  bool nested_write_frameName(const yarp::os::idl::WireWriter& writer) const;
173 
174  // read/write additionalMetadata field
175  bool read_additionalMetadata(yarp::os::idl::WireReader& reader);
176  bool write_additionalMetadata(const yarp::os::idl::WireWriter& writer) const;
177  bool nested_read_additionalMetadata(yarp::os::idl::WireReader& reader);
178  bool nested_write_additionalMetadata(const yarp::os::idl::WireWriter& writer) const;
179 };
180 
181 #endif // YARP_THRIFT_GENERATOR_STRUCT_SENSORMETADATA_H
SensorMetadata::Editor::Editor
Editor()
Definition: SensorMetadata.cpp:95
SensorMetadata::toString
std::string toString() const
Definition: SensorMetadata.cpp:87
SensorMetadata::Editor::did_set_frameName
virtual bool did_set_frameName()
Definition: SensorMetadata.cpp:210
SensorMetadata::Editor::get_frameName
const std::string & get_frameName() const
Definition: SensorMetadata.cpp:198
SensorMetadata::frameName
std::string frameName
Definition: SensorMetadata.h:26
SensorMetadata::Editor::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: SensorMetadata.cpp:250
WireTypes.h
SensorMetadata::Editor::state
SensorMetadata & state()
Definition: SensorMetadata.cpp:140
Wire.h
SensorMetadata::Editor::set_frameName
void set_frameName(const std::string &frameName)
Definition: SensorMetadata.cpp:188
SensorMetadata::Editor::will_set_name
virtual bool will_set_name()
Definition: SensorMetadata.cpp:176
SensorMetadata::Editor::set_additionalMetadata
void set_additionalMetadata(const std::string &additionalMetadata)
Definition: SensorMetadata.cpp:216
SensorMetadata::Editor::stop_editing
void stop_editing()
Definition: SensorMetadata.cpp:152
yarp::os::PortWriter
Interface implemented by all objects that can write themselves to the network, such as Bottle objects...
Definition: PortWriter.h:27
SensorMetadata::Editor::operator=
Editor & operator=(const Editor &rhs)=delete
SensorMetadata::additionalMetadata
std::string additionalMetadata
Definition: SensorMetadata.h:27
yarp::os::idl::WireWriter
IDL-friendly connection writer.
Definition: WireWriter.h:33
SensorMetadata::Editor::clean
void clean()
Definition: SensorMetadata.cpp:244
SensorMetadata::Editor::operator=
Editor & operator=(Editor &&rhs)=delete
SensorMetadata::Editor::set_name
void set_name(const std::string &name)
Definition: SensorMetadata.cpp:160
SensorMetadata::unwrapped
yarp::os::idl::Unwrapped< SensorMetadata > unwrapped
Definition: SensorMetadata.h:53
SensorMetadata::Editor::Editor
Editor(Editor &&rhs)=delete
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
SensorMetadata::Editor::get_additionalMetadata
const std::string & get_additionalMetadata() const
Definition: SensorMetadata.cpp:226
SensorMetadata::Editor::edit
bool edit(SensorMetadata &obj, bool dirty=true)
Definition: SensorMetadata.cpp:122
yarp::os::idl::Unwrapped
Definition: Unwrapped.h:22
SensorMetadata::Editor::begin
void begin()
Definition: SensorMetadata.h:89
SensorMetadata::Editor::get_name
const std::string & get_name() const
Definition: SensorMetadata.cpp:170
SensorMetadata::Editor::will_set_additionalMetadata
virtual bool will_set_additionalMetadata()
Definition: SensorMetadata.cpp:232
SensorMetadata::Editor::did_set_name
virtual bool did_set_name()
Definition: SensorMetadata.cpp:182
SensorMetadata::Editor::end
void end()
Definition: SensorMetadata.h:100
yarp::os::idl::WirePortable
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:26
yarp::os::Wire
Base class for IDL client/server.
Definition: Wire.h:22
SensorMetadata::name
std::string name
Definition: SensorMetadata.h:25
SensorMetadata::Editor::~Editor
~Editor() override
Definition: SensorMetadata.cpp:114
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
SensorMetadata
Definition: SensorMetadata.h:22
SensorMetadata::Editor::isValid
bool isValid() const
Definition: SensorMetadata.cpp:134
SensorMetadata::Editor::Editor
Editor(const Editor &rhs)=delete
SensorMetadata::Editor::did_set_additionalMetadata
virtual bool did_set_additionalMetadata()
Definition: SensorMetadata.cpp:238
YARP_DEPRECATED_MSG
#define YARP_DEPRECATED_MSG(MSG)
Expands to either the standard [[deprecated]] attribute or a compiler-specific decorator such as __at...
Definition: compiler.h:2883
SensorMetadata::SensorMetadata
SensorMetadata()
Definition: SensorMetadata.cpp:17
SensorMetadata::read
bool read(yarp::os::idl::WireReader &reader) override
Definition: SensorMetadata.cpp:37
SensorMetadata::Editor
Definition: SensorMetadata.h:58
SensorMetadata::Editor::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: SensorMetadata.cpp:383
SensorMetadata::Editor::start_editing
void start_editing()
Definition: SensorMetadata.cpp:146
SensorMetadata::write
bool write(const yarp::os::idl::WireWriter &writer) const override
Definition: SensorMetadata.cpp:62
SensorMetadata::Editor::will_set_frameName
virtual bool will_set_frameName()
Definition: SensorMetadata.cpp:204