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