// automatically generated by the FlatBuffers compiler, do not modify


#ifndef FLATBUFFERS_GENERATED_IQDCCAL_UHD_USRP_CAL_H_
#define FLATBUFFERS_GENERATED_IQDCCAL_UHD_USRP_CAL_H_

#include "flatbuffers/flatbuffers.h"

#include "cal_metadata_generated.h"

namespace uhd { namespace usrp { namespace cal {

struct IQDCCalCoeff;
struct IQDCCalCoeffBuilder;

struct IQDCCalCoeffs;
struct IQDCCalCoeffsBuilder;

struct IQDCCalCoeff FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
{
    typedef IQDCCalCoeffBuilder Builder;
    enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
        VT_FREQ           = 4,
        VT_SCALING_FACTOR = 6,
        VT_COEFF_REAL     = 8,
        VT_COEFF_IMAG     = 10,
        VT_DELAY          = 12,
        VT_DC_OFFSET_REAL = 14,
        VT_DC_OFFSET_IMAG = 16
    };
    double freq() const
    {
        return GetField<double>(VT_FREQ, 0.0);
    }
    double scaling_factor() const
    {
        return GetField<double>(VT_SCALING_FACTOR, 0.0);
    }
    const flatbuffers::Vector<double>* coeff_real() const
    {
        return GetPointer<const flatbuffers::Vector<double>*>(VT_COEFF_REAL);
    }
    const flatbuffers::Vector<double>* coeff_imag() const
    {
        return GetPointer<const flatbuffers::Vector<double>*>(VT_COEFF_IMAG);
    }
    double delay() const
    {
        return GetField<double>(VT_DELAY, 0.0);
    }
    double dc_offset_real() const
    {
        return GetField<double>(VT_DC_OFFSET_REAL, 0.0);
    }
    double dc_offset_imag() const
    {
        return GetField<double>(VT_DC_OFFSET_IMAG, 0.0);
    }
    bool Verify(flatbuffers::Verifier& verifier) const
    {
        return VerifyTableStart(verifier) && VerifyField<double>(verifier, VT_FREQ)
               && VerifyField<double>(verifier, VT_SCALING_FACTOR)
               && VerifyOffset(verifier, VT_COEFF_REAL)
               && verifier.VerifyVector(coeff_real())
               && VerifyOffset(verifier, VT_COEFF_IMAG)
               && verifier.VerifyVector(coeff_imag())
               && VerifyField<double>(verifier, VT_DELAY)
               && VerifyField<double>(verifier, VT_DC_OFFSET_REAL)
               && VerifyField<double>(verifier, VT_DC_OFFSET_IMAG) && verifier.EndTable();
    }
};

struct IQDCCalCoeffBuilder
{
    typedef IQDCCalCoeff Table;
    flatbuffers::FlatBufferBuilder& fbb_;
    flatbuffers::uoffset_t start_;
    void add_freq(double freq)
    {
        fbb_.AddElement<double>(IQDCCalCoeff::VT_FREQ, freq, 0.0);
    }
    void add_scaling_factor(double scaling_factor)
    {
        fbb_.AddElement<double>(IQDCCalCoeff::VT_SCALING_FACTOR, scaling_factor, 0.0);
    }
    void add_coeff_real(flatbuffers::Offset<flatbuffers::Vector<double>> coeff_real)
    {
        fbb_.AddOffset(IQDCCalCoeff::VT_COEFF_REAL, coeff_real);
    }
    void add_coeff_imag(flatbuffers::Offset<flatbuffers::Vector<double>> coeff_imag)
    {
        fbb_.AddOffset(IQDCCalCoeff::VT_COEFF_IMAG, coeff_imag);
    }
    void add_delay(double delay)
    {
        fbb_.AddElement<double>(IQDCCalCoeff::VT_DELAY, delay, 0.0);
    }
    void add_dc_offset_real(double dc_offset_real)
    {
        fbb_.AddElement<double>(IQDCCalCoeff::VT_DC_OFFSET_REAL, dc_offset_real, 0.0);
    }
    void add_dc_offset_imag(double dc_offset_imag)
    {
        fbb_.AddElement<double>(IQDCCalCoeff::VT_DC_OFFSET_IMAG, dc_offset_imag, 0.0);
    }
    explicit IQDCCalCoeffBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb)
    {
        start_ = fbb_.StartTable();
    }
    flatbuffers::Offset<IQDCCalCoeff> Finish()
    {
        const auto end = fbb_.EndTable(start_);
        auto o         = flatbuffers::Offset<IQDCCalCoeff>(end);
        return o;
    }
};

inline flatbuffers::Offset<IQDCCalCoeff> CreateIQDCCalCoeff(
    flatbuffers::FlatBufferBuilder& _fbb,
    double freq                                                 = 0.0,
    double scaling_factor                                       = 0.0,
    flatbuffers::Offset<flatbuffers::Vector<double>> coeff_real = 0,
    flatbuffers::Offset<flatbuffers::Vector<double>> coeff_imag = 0,
    double delay                                                = 0.0,
    double dc_offset_real                                       = 0.0,
    double dc_offset_imag                                       = 0.0)
{
    IQDCCalCoeffBuilder builder_(_fbb);
    builder_.add_dc_offset_imag(dc_offset_imag);
    builder_.add_dc_offset_real(dc_offset_real);
    builder_.add_delay(delay);
    builder_.add_scaling_factor(scaling_factor);
    builder_.add_freq(freq);
    builder_.add_coeff_imag(coeff_imag);
    builder_.add_coeff_real(coeff_real);
    return builder_.Finish();
}

inline flatbuffers::Offset<IQDCCalCoeff> CreateIQDCCalCoeffDirect(
    flatbuffers::FlatBufferBuilder& _fbb,
    double freq                           = 0.0,
    double scaling_factor                 = 0.0,
    const std::vector<double>* coeff_real = nullptr,
    const std::vector<double>* coeff_imag = nullptr,
    double delay                          = 0.0,
    double dc_offset_real                 = 0.0,
    double dc_offset_imag                 = 0.0)
{
    auto coeff_real__ = coeff_real ? _fbb.CreateVector<double>(*coeff_real) : 0;
    auto coeff_imag__ = coeff_imag ? _fbb.CreateVector<double>(*coeff_imag) : 0;
    return uhd::usrp::cal::CreateIQDCCalCoeff(_fbb,
        freq,
        scaling_factor,
        coeff_real__,
        coeff_imag__,
        delay,
        dc_offset_real,
        dc_offset_imag);
}

struct IQDCCalCoeffs FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table
{
    typedef IQDCCalCoeffsBuilder Builder;
    enum FlatBuffersVTableOffset FLATBUFFERS_VTABLE_UNDERLYING_TYPE {
        VT_METADATA = 4,
        VT_COEFFS   = 6
    };
    const Metadata* metadata() const
    {
        return GetPointer<const Metadata*>(VT_METADATA);
    }
    const flatbuffers::Vector<flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeff>>*
    coeffs() const
    {
        return GetPointer<const flatbuffers::Vector<
            flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeff>>*>(VT_COEFFS);
    }
    bool Verify(flatbuffers::Verifier& verifier) const
    {
        return VerifyTableStart(verifier) && VerifyOffset(verifier, VT_METADATA)
               && verifier.VerifyTable(metadata()) && VerifyOffset(verifier, VT_COEFFS)
               && verifier.VerifyVector(coeffs())
               && verifier.VerifyVectorOfTables(coeffs()) && verifier.EndTable();
    }
};

struct IQDCCalCoeffsBuilder
{
    typedef IQDCCalCoeffs Table;
    flatbuffers::FlatBufferBuilder& fbb_;
    flatbuffers::uoffset_t start_;
    void add_metadata(flatbuffers::Offset<Metadata> metadata)
    {
        fbb_.AddOffset(IQDCCalCoeffs::VT_METADATA, metadata);
    }
    void add_coeffs(flatbuffers::Offset<
        flatbuffers::Vector<flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeff>>> coeffs)
    {
        fbb_.AddOffset(IQDCCalCoeffs::VT_COEFFS, coeffs);
    }
    explicit IQDCCalCoeffsBuilder(flatbuffers::FlatBufferBuilder& _fbb) : fbb_(_fbb)
    {
        start_ = fbb_.StartTable();
    }
    flatbuffers::Offset<IQDCCalCoeffs> Finish()
    {
        const auto end = fbb_.EndTable(start_);
        auto o         = flatbuffers::Offset<IQDCCalCoeffs>(end);
        return o;
    }
};

inline flatbuffers::Offset<IQDCCalCoeffs> CreateIQDCCalCoeffs(
    flatbuffers::FlatBufferBuilder& _fbb,
    flatbuffers::Offset<Metadata> metadata = 0,
    flatbuffers::Offset<
        flatbuffers::Vector<flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeff>>> coeffs =
        0)
{
    IQDCCalCoeffsBuilder builder_(_fbb);
    builder_.add_coeffs(coeffs);
    builder_.add_metadata(metadata);
    return builder_.Finish();
}

inline flatbuffers::Offset<IQDCCalCoeffs> CreateIQDCCalCoeffsDirect(
    flatbuffers::FlatBufferBuilder& _fbb,
    flatbuffers::Offset<Metadata> metadata = 0,
    const std::vector<flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeff>>* coeffs =
        nullptr)
{
    auto coeffs__ =
        coeffs ? _fbb.CreateVector<flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeff>>(
            *coeffs)
               : 0;
    return uhd::usrp::cal::CreateIQDCCalCoeffs(_fbb, metadata, coeffs__);
}

inline const uhd::usrp::cal::IQDCCalCoeffs* GetIQDCCalCoeffs(const void* buf)
{
    return flatbuffers::GetRoot<uhd::usrp::cal::IQDCCalCoeffs>(buf);
}

inline const uhd::usrp::cal::IQDCCalCoeffs* GetSizePrefixedIQDCCalCoeffs(const void* buf)
{
    return flatbuffers::GetSizePrefixedRoot<uhd::usrp::cal::IQDCCalCoeffs>(buf);
}

inline const char* IQDCCalCoeffsIdentifier()
{
    return "IQDC";
}

inline bool IQDCCalCoeffsBufferHasIdentifier(const void* buf)
{
    return flatbuffers::BufferHasIdentifier(buf, IQDCCalCoeffsIdentifier());
}

inline bool VerifyIQDCCalCoeffsBuffer(flatbuffers::Verifier& verifier)
{
    return verifier.VerifyBuffer<uhd::usrp::cal::IQDCCalCoeffs>(
        IQDCCalCoeffsIdentifier());
}

inline bool VerifySizePrefixedIQDCCalCoeffsBuffer(flatbuffers::Verifier& verifier)
{
    return verifier.VerifySizePrefixedBuffer<uhd::usrp::cal::IQDCCalCoeffs>(
        IQDCCalCoeffsIdentifier());
}

inline const char* IQDCCalCoeffsExtension()
{
    return "cal";
}

inline void FinishIQDCCalCoeffsBuffer(flatbuffers::FlatBufferBuilder& fbb,
    flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeffs> root)
{
    fbb.Finish(root, IQDCCalCoeffsIdentifier());
}

inline void FinishSizePrefixedIQDCCalCoeffsBuffer(flatbuffers::FlatBufferBuilder& fbb,
    flatbuffers::Offset<uhd::usrp::cal::IQDCCalCoeffs> root)
{
    fbb.FinishSizePrefixed(root, IQDCCalCoeffsIdentifier());
}

}}} // namespace uhd::usrp::cal

#endif // FLATBUFFERS_GENERATED_IQDCCAL_UHD_USRP_CAL_H_
