YARP
Yet Another Robot Platform
audioBufferSizeData.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_AUDIOBUFFERSIZEDATA_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_AUDIOBUFFERSIZEDATA_H
13 
14 #include <yarp/dev/api.h>
15 
16 #include <yarp/os/Wire.h>
17 #include <yarp/os/idl/WireTypes.h>
18 
19 namespace yarp {
20 namespace dev {
21 
24 {
25 public:
26  // Fields
27  std::int32_t m_samples;
28  std::int32_t m_channels;
29  std::int32_t m_depth;
30  std::int32_t size;
31 
32  // Default constructor
34 
35  // Constructor with field values
36  audioBufferSizeData(const std::int32_t m_samples,
37  const std::int32_t m_channels,
38  const std::int32_t m_depth,
39  const std::int32_t size);
40 
41  // Read structure on a Wire
42  bool read(yarp::os::idl::WireReader& reader) override;
43 
44  // Read structure on a Connection
45  bool read(yarp::os::ConnectionReader& connection) override;
46 
47  // Write structure on a Wire
48  bool write(const yarp::os::idl::WireWriter& writer) const override;
49 
50  // Write structure on a Connection
51  bool write(yarp::os::ConnectionWriter& connection) const override;
52 
53  // Convert to a printable string
54  std::string toString() const;
55 
56  // If you want to serialize this class without nesting, use this helper
58 
59  class Editor :
60  public yarp::os::Wire,
62  {
63  public:
64  // Editor: default constructor
65  Editor();
66 
67  // Editor: constructor with base class
69 
70  // Editor: destructor
71  ~Editor() override;
72 
73  // Editor: Deleted constructors and operator=
74  Editor(const Editor& rhs) = delete;
75  Editor(Editor&& rhs) = delete;
76  Editor& operator=(const Editor& rhs) = delete;
77  Editor& operator=(Editor&& rhs) = delete;
78 
79  // Editor: edit
80  bool edit(audioBufferSizeData& obj, bool dirty = true);
81 
82  // Editor: validity check
83  bool isValid() const;
84 
85  // Editor: state
86  audioBufferSizeData& state();
87 
88  // Editor: start editing
89  void start_editing();
90 
91 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
92  YARP_DEPRECATED_MSG("Use start_editing() instead")
93  void begin()
94  {
95  start_editing();
96  }
97 #endif // YARP_NO_DEPRECATED
98 
99  // Editor: stop editing
100  void stop_editing();
101 
102 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
103  YARP_DEPRECATED_MSG("Use stop_editing() instead")
104  void end()
105  {
106  stop_editing();
107  }
108 #endif // YARP_NO_DEPRECATED
109 
110  // Editor: m_samples field
111  void set_m_samples(const std::int32_t m_samples);
112  std::int32_t get_m_samples() const;
113  virtual bool will_set_m_samples();
114  virtual bool did_set_m_samples();
115 
116  // Editor: m_channels field
117  void set_m_channels(const std::int32_t m_channels);
118  std::int32_t get_m_channels() const;
119  virtual bool will_set_m_channels();
120  virtual bool did_set_m_channels();
121 
122  // Editor: m_depth field
123  void set_m_depth(const std::int32_t m_depth);
124  std::int32_t get_m_depth() const;
125  virtual bool will_set_m_depth();
126  virtual bool did_set_m_depth();
127 
128  // Editor: size field
129  void set_size(const std::int32_t size);
130  std::int32_t get_size() const;
131  virtual bool will_set_size();
132  virtual bool did_set_size();
133 
134  // Editor: clean
135  void clean();
136 
137  // Editor: read
138  bool read(yarp::os::ConnectionReader& connection) override;
139 
140  // Editor: write
141  bool write(yarp::os::ConnectionWriter& connection) const override;
142 
143  private:
144  // Editor: state
145  audioBufferSizeData* obj;
146  bool obj_owned;
147  int group;
148 
149  // Editor: dirty variables
150  bool is_dirty;
151  bool is_dirty_m_samples;
152  bool is_dirty_m_channels;
153  bool is_dirty_m_depth;
154  bool is_dirty_size;
155  int dirty_count;
156 
157  // Editor: send if possible
158  void communicate();
159 
160  // Editor: mark dirty overall
161  void mark_dirty();
162 
163  // Editor: mark dirty single fields
164  void mark_dirty_m_samples();
165  void mark_dirty_m_channels();
166  void mark_dirty_m_depth();
167  void mark_dirty_size();
168 
169  // Editor: dirty_flags
170  void dirty_flags(bool flag);
171  };
172 
173 private:
174  // read/write m_samples field
175  bool read_m_samples(yarp::os::idl::WireReader& reader);
176  bool write_m_samples(const yarp::os::idl::WireWriter& writer) const;
177  bool nested_read_m_samples(yarp::os::idl::WireReader& reader);
178  bool nested_write_m_samples(const yarp::os::idl::WireWriter& writer) const;
179 
180  // read/write m_channels field
181  bool read_m_channels(yarp::os::idl::WireReader& reader);
182  bool write_m_channels(const yarp::os::idl::WireWriter& writer) const;
183  bool nested_read_m_channels(yarp::os::idl::WireReader& reader);
184  bool nested_write_m_channels(const yarp::os::idl::WireWriter& writer) const;
185 
186  // read/write m_depth field
187  bool read_m_depth(yarp::os::idl::WireReader& reader);
188  bool write_m_depth(const yarp::os::idl::WireWriter& writer) const;
189  bool nested_read_m_depth(yarp::os::idl::WireReader& reader);
190  bool nested_write_m_depth(const yarp::os::idl::WireWriter& writer) const;
191 
192  // read/write size field
193  bool read_size(yarp::os::idl::WireReader& reader);
194  bool write_size(const yarp::os::idl::WireWriter& writer) const;
195  bool nested_read_size(yarp::os::idl::WireReader& reader);
196  bool nested_write_size(const yarp::os::idl::WireWriter& writer) const;
197 };
198 
199 } // namespace yarp
200 } // namespace dev
201 
202 #endif // YARP_THRIFT_GENERATOR_STRUCT_AUDIOBUFFERSIZEDATA_H
Editor & operator=(Editor &&rhs)=delete
Editor(const Editor &rhs)=delete
Editor & operator=(const Editor &rhs)=delete
yarp::os::idl::Unwrapped< audioBufferSizeData > unwrapped
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
std::string toString(const T &value)
convert an arbitrary type to string.
bool isValid()
Check if time is valid (non-zero).
Definition: Time.cpp:314
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
Definition: ImageFile.cpp:922
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
Definition: ImageFile.cpp:1098
The main, catch-all namespace for YARP.
Definition: dirs.h:16
#define YARP_dev_API
Definition: api.h:18