YARP
Yet Another Robot Platform
AudioPlayerStatus.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_AUDIOPLAYERSTATUS_H
12 #define YARP_THRIFT_GENERATOR_STRUCT_AUDIOPLAYERSTATUS_H
13 
14 #include <yarp/dev/api.h>
15 
16 #include <yarp/os/Wire.h>
17 #include <yarp/os/idl/WireTypes.h>
18 
20 
21 namespace yarp {
22 namespace dev {
23 
30 {
31 public:
32  // Fields
36  bool enabled;
45 
46  // Default constructor
48 
49  // Constructor with field values
50  AudioPlayerStatus(const bool enabled,
51  const size_t current_buffer_size,
52  const size_t max_buffer_size);
53 
54  // Read structure on a Wire
55  bool read(yarp::os::idl::WireReader& reader) override;
56 
57  // Read structure on a Connection
58  bool read(yarp::os::ConnectionReader& connection) override;
59 
60  // Write structure on a Wire
61  bool write(const yarp::os::idl::WireWriter& writer) const override;
62 
63  // Write structure on a Connection
64  bool write(yarp::os::ConnectionWriter& connection) const override;
65 
66  // Convert to a printable string
67  std::string toString() const;
68 
69  // If you want to serialize this class without nesting, use this helper
71 
72  class Editor :
73  public yarp::os::Wire,
75  {
76  public:
77  // Editor: default constructor
78  Editor();
79 
80  // Editor: constructor with base class
82 
83  // Editor: destructor
84  ~Editor() override;
85 
86  // Editor: Deleted constructors and operator=
87  Editor(const Editor& rhs) = delete;
88  Editor(Editor&& rhs) = delete;
89  Editor& operator=(const Editor& rhs) = delete;
90  Editor& operator=(Editor&& rhs) = delete;
91 
92  // Editor: edit
93  bool edit(AudioPlayerStatus& obj, bool dirty = true);
94 
95  // Editor: validity check
96  bool isValid() const;
97 
98  // Editor: state
99  AudioPlayerStatus& state();
100 
101  // Editor: start editing
102  void start_editing();
103 
104 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
105  YARP_DEPRECATED_MSG("Use start_editing() instead")
106  void begin()
107  {
108  start_editing();
109  }
110 #endif // YARP_NO_DEPRECATED
111 
112  // Editor: stop editing
113  void stop_editing();
114 
115 #ifndef YARP_NO_DEPRECATED // Since YARP 3.2
116  YARP_DEPRECATED_MSG("Use stop_editing() instead")
117  void end()
118  {
119  stop_editing();
120  }
121 #endif // YARP_NO_DEPRECATED
122 
123  // Editor: enabled field
124  void set_enabled(const bool enabled);
125  bool get_enabled() const;
126  virtual bool will_set_enabled();
127  virtual bool did_set_enabled();
128 
129  // Editor: current_buffer_size field
130  void set_current_buffer_size(const size_t current_buffer_size);
131  size_t get_current_buffer_size() const;
132  virtual bool will_set_current_buffer_size();
133  virtual bool did_set_current_buffer_size();
134 
135  // Editor: max_buffer_size field
136  void set_max_buffer_size(const size_t max_buffer_size);
137  size_t get_max_buffer_size() const;
138  virtual bool will_set_max_buffer_size();
139  virtual bool did_set_max_buffer_size();
140 
141  // Editor: clean
142  void clean();
143 
144  // Editor: read
145  bool read(yarp::os::ConnectionReader& connection) override;
146 
147  // Editor: write
148  bool write(yarp::os::ConnectionWriter& connection) const override;
149 
150  private:
151  // Editor: state
152  AudioPlayerStatus* obj;
153  bool obj_owned;
154  int group;
155 
156  // Editor: dirty variables
157  bool is_dirty;
158  bool is_dirty_enabled;
159  bool is_dirty_current_buffer_size;
160  bool is_dirty_max_buffer_size;
161  int dirty_count;
162 
163  // Editor: send if possible
164  void communicate();
165 
166  // Editor: mark dirty overall
167  void mark_dirty();
168 
169  // Editor: mark dirty single fields
170  void mark_dirty_enabled();
171  void mark_dirty_current_buffer_size();
172  void mark_dirty_max_buffer_size();
173 
174  // Editor: dirty_flags
175  void dirty_flags(bool flag);
176  };
177 
178 private:
179  // read/write enabled field
180  bool read_enabled(yarp::os::idl::WireReader& reader);
181  bool write_enabled(const yarp::os::idl::WireWriter& writer) const;
182  bool nested_read_enabled(yarp::os::idl::WireReader& reader);
183  bool nested_write_enabled(const yarp::os::idl::WireWriter& writer) const;
184 
185  // read/write current_buffer_size field
186  bool read_current_buffer_size(yarp::os::idl::WireReader& reader);
187  bool write_current_buffer_size(const yarp::os::idl::WireWriter& writer) const;
188  bool nested_read_current_buffer_size(yarp::os::idl::WireReader& reader);
189  bool nested_write_current_buffer_size(const yarp::os::idl::WireWriter& writer) const;
190 
191  // read/write max_buffer_size field
192  bool read_max_buffer_size(yarp::os::idl::WireReader& reader);
193  bool write_max_buffer_size(const yarp::os::idl::WireWriter& writer) const;
194  bool nested_read_max_buffer_size(yarp::os::idl::WireReader& reader);
195  bool nested_write_max_buffer_size(const yarp::os::idl::WireWriter& writer) const;
196 };
197 
198 } // namespace yarp
199 } // namespace dev
200 
201 #endif // YARP_THRIFT_GENERATOR_STRUCT_AUDIOPLAYERSTATUS_H
Editor(const Editor &rhs)=delete
Editor & operator=(const Editor &rhs)=delete
Editor & operator=(Editor &&rhs)=delete
AudioPlayerStatus: A class used to describe the status of an audio player device.
size_t current_buffer_size
the size of the audio buffer [samples]
size_t max_buffer_size
the max_size of the audio buffer [samples]
bool enabled
true if the playback is currently enabled
yarp::os::idl::Unwrapped< AudioPlayerStatus > 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