/*
 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
 * SPDX-License-Identifier: BSD-3-Clause
 */

// Autogenerated by Thrift Compiler (0.14.1-yarped)
//
// This is an automatically generated file.
// It could get re-generated if the ALLOW_IDL_GENERATION flag is on.

#ifndef YARP_THRIFT_GENERATOR_STRUCT_AUDIORECORDERSTATUS_H
#define YARP_THRIFT_GENERATOR_STRUCT_AUDIORECORDERSTATUS_H

#include <yarp/dev/api.h>

#include <yarp/os/Wire.h>
#include <yarp/os/idl/WireTypes.h>

#include <yarp/dev/AudioRecorderStatus_common.h>

namespace yarp::dev {

/**
 * \brief `AudioRecorderStatus`: A class used to describe the status of an audio recorder device.
 * See \ref AudioDoc for additional documentation on YARP audio.
 */
class YARP_dev_API AudioRecorderStatus :
        public yarp::os::idl::WirePortable
{
public:
    // Fields
    /**
     * true if the playback is currently enabled
     */
    bool enabled{false};
    /**
     * the size of the audio buffer [samples]
     */
    size_t current_buffer_size{0};
    /**
     * the max_size of the audio buffer [samples]
     */
    size_t max_buffer_size{0};

    // Default constructor
    AudioRecorderStatus() = default;

    // Constructor with field values
    AudioRecorderStatus(const bool enabled,
                        const size_t current_buffer_size,
                        const size_t max_buffer_size);

    // Read structure on a Wire
    bool read(yarp::os::idl::WireReader& reader) override;

    // Read structure on a Connection
    bool read(yarp::os::ConnectionReader& connection) override;

    // Write structure on a Wire
    bool write(const yarp::os::idl::WireWriter& writer) const override;

    // Write structure on a Connection
    bool write(yarp::os::ConnectionWriter& connection) const override;

    // Convert to a printable string
    std::string toString() const;

    // If you want to serialize this class without nesting, use this helper
    typedef yarp::os::idl::Unwrapped<AudioRecorderStatus> unwrapped;

private:
    // read/write enabled field
    bool read_enabled(yarp::os::idl::WireReader& reader);
    bool write_enabled(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_enabled(yarp::os::idl::WireReader& reader);
    bool nested_write_enabled(const yarp::os::idl::WireWriter& writer) const;

    // read/write current_buffer_size field
    bool read_current_buffer_size(yarp::os::idl::WireReader& reader);
    bool write_current_buffer_size(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_current_buffer_size(yarp::os::idl::WireReader& reader);
    bool nested_write_current_buffer_size(const yarp::os::idl::WireWriter& writer) const;

    // read/write max_buffer_size field
    bool read_max_buffer_size(yarp::os::idl::WireReader& reader);
    bool write_max_buffer_size(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_max_buffer_size(yarp::os::idl::WireReader& reader);
    bool nested_write_max_buffer_size(const yarp::os::idl::WireWriter& writer) const;
};

} // namespace yarp::dev

#endif // YARP_THRIFT_GENERATOR_STRUCT_AUDIORECORDERSTATUS_H
