/**
 * Autogenerated by Thrift Compiler (0.22.0)
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#include "gnuradio_types.h"

#include <algorithm>
#include <ostream>

#include <thrift/TToString.h>

namespace GNURadio {

int _kBaseTypesValues[] = {
  BaseTypes::BOOL,
  BaseTypes::BYTE,
  BaseTypes::SHORT,
  BaseTypes::INT,
  BaseTypes::LONG,
  BaseTypes::DOUBLE,
  BaseTypes::STRING,
  BaseTypes::COMPLEX,
  BaseTypes::F32VECTOR,
  BaseTypes::F64VECTOR,
  BaseTypes::S64VECTOR,
  BaseTypes::S32VECTOR,
  BaseTypes::S16VECTOR,
  BaseTypes::S8VECTOR,
  BaseTypes::C32VECTOR
};
const char* _kBaseTypesNames[] = {
  "BOOL",
  "BYTE",
  "SHORT",
  "INT",
  "LONG",
  "DOUBLE",
  "STRING",
  "COMPLEX",
  "F32VECTOR",
  "F64VECTOR",
  "S64VECTOR",
  "S32VECTOR",
  "S16VECTOR",
  "S8VECTOR",
  "C32VECTOR"
};
const std::map<int, const char*> _BaseTypes_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(15, _kBaseTypesValues, _kBaseTypesNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr));

std::ostream& operator<<(std::ostream& out, const BaseTypes::type& val) {
  std::map<int, const char*>::const_iterator it = _BaseTypes_VALUES_TO_NAMES.find(val);
  if (it != _BaseTypes_VALUES_TO_NAMES.end()) {
    out << it->second;
  } else {
    out << static_cast<int>(val);
  }
  return out;
}

std::string to_string(const BaseTypes::type& val) {
  std::map<int, const char*>::const_iterator it = _BaseTypes_VALUES_TO_NAMES.find(val);
  if (it != _BaseTypes_VALUES_TO_NAMES.end()) {
    return std::string(it->second);
  } else {
    return std::to_string(static_cast<int>(val));
  }
}

int _kKnobTypeValues[] = {
  KnobType::KNOBBOOL,
  KnobType::KNOBCHAR,
  KnobType::KNOBINT,
  KnobType::KNOBDOUBLE,
  KnobType::KNOBSTRING,
  KnobType::KNOBLONG,
  KnobType::KNOBVECBOOL,
  KnobType::KNOBVECCHAR,
  KnobType::KNOBVECINT,
  KnobType::KNOBVECDOUBLE,
  KnobType::KNOBVECSTRING,
  KnobType::KNOBVECLONG,
  KnobType::KNOBSHORT
};
const char* _kKnobTypeNames[] = {
  "KNOBBOOL",
  "KNOBCHAR",
  "KNOBINT",
  "KNOBDOUBLE",
  "KNOBSTRING",
  "KNOBLONG",
  "KNOBVECBOOL",
  "KNOBVECCHAR",
  "KNOBVECINT",
  "KNOBVECDOUBLE",
  "KNOBVECSTRING",
  "KNOBVECLONG",
  "KNOBSHORT"
};
const std::map<int, const char*> _KnobType_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(13, _kKnobTypeValues, _kKnobTypeNames), ::apache::thrift::TEnumIterator(-1, nullptr, nullptr));

std::ostream& operator<<(std::ostream& out, const KnobType::type& val) {
  std::map<int, const char*>::const_iterator it = _KnobType_VALUES_TO_NAMES.find(val);
  if (it != _KnobType_VALUES_TO_NAMES.end()) {
    out << it->second;
  } else {
    out << static_cast<int>(val);
  }
  return out;
}

std::string to_string(const KnobType::type& val) {
  std::map<int, const char*>::const_iterator it = _KnobType_VALUES_TO_NAMES.find(val);
  if (it != _KnobType_VALUES_TO_NAMES.end()) {
    return std::string(it->second);
  } else {
    return std::to_string(static_cast<int>(val));
  }
}


complex::~complex() noexcept {
}

complex::complex() noexcept
   : re(0),
     im(0) {
}

void complex::__set_re(const double val) {
  this->re = val;
}

void complex::__set_im(const double val) {
  this->im = val;
}
std::ostream& operator<<(std::ostream& out, const complex& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t complex::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->re);
          this->__isset.re = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->im);
          this->__isset.im = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t complex::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("complex");

  xfer += oprot->writeFieldBegin("re", ::apache::thrift::protocol::T_DOUBLE, 1);
  xfer += oprot->writeDouble(this->re);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("im", ::apache::thrift::protocol::T_DOUBLE, 2);
  xfer += oprot->writeDouble(this->im);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(complex &a, complex &b) {
  using ::std::swap;
  swap(a.re, b.re);
  swap(a.im, b.im);
  swap(a.__isset, b.__isset);
}

bool complex::operator==(const complex & rhs) const
{
  if (!(re == rhs.re))
    return false;
  if (!(im == rhs.im))
    return false;
  return true;
}

complex::complex(const complex& other0) noexcept {
  re = other0.re;
  im = other0.im;
  __isset = other0.__isset;
}
complex& complex::operator=(const complex& other1) noexcept {
  re = other1.re;
  im = other1.im;
  __isset = other1.__isset;
  return *this;
}
void complex::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "complex(";
  out << "re=" << to_string(re);
  out << ", " << "im=" << to_string(im);
  out << ")";
}


KnobBase::~KnobBase() noexcept {
}

KnobBase::KnobBase() noexcept
   : a_bool(0),
     a_byte(0),
     a_short(0),
     a_int(0),
     a_long(0),
     a_double(0),
     a_string(),
     a_s8vector() {
}

void KnobBase::__set_a_bool(const bool val) {
  this->a_bool = val;
}

void KnobBase::__set_a_byte(const int8_t val) {
  this->a_byte = val;
}

void KnobBase::__set_a_short(const int16_t val) {
  this->a_short = val;
}

void KnobBase::__set_a_int(const int32_t val) {
  this->a_int = val;
}

void KnobBase::__set_a_long(const int64_t val) {
  this->a_long = val;
}

void KnobBase::__set_a_double(const double val) {
  this->a_double = val;
}

void KnobBase::__set_a_string(const std::string& val) {
  this->a_string = val;
}

void KnobBase::__set_a_complex(const complex& val) {
  this->a_complex = val;
}

void KnobBase::__set_a_f32vector(const VectorF& val) {
  this->a_f32vector = val;
}

void KnobBase::__set_a_f64vector(const VectorD& val) {
  this->a_f64vector = val;
}

void KnobBase::__set_a_s64vector(const VectorL& val) {
  this->a_s64vector = val;
}

void KnobBase::__set_a_s32vector(const VectorI& val) {
  this->a_s32vector = val;
}

void KnobBase::__set_a_s16vector(const VectorT& val) {
  this->a_s16vector = val;
}

void KnobBase::__set_a_s8vector(const VectorC& val) {
  this->a_s8vector = val;
}

void KnobBase::__set_a_c32vector(const VectorZ& val) {
  this->a_c32vector = val;
}
std::ostream& operator<<(std::ostream& out, const KnobBase& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t KnobBase::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_BOOL) {
          xfer += iprot->readBool(this->a_bool);
          this->__isset.a_bool = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_BYTE) {
          xfer += iprot->readByte(this->a_byte);
          this->__isset.a_byte = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_I16) {
          xfer += iprot->readI16(this->a_short);
          this->__isset.a_short = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->a_int);
          this->__isset.a_int = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_I64) {
          xfer += iprot->readI64(this->a_long);
          this->__isset.a_long = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_DOUBLE) {
          xfer += iprot->readDouble(this->a_double);
          this->__isset.a_double = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->a_string);
          this->__isset.a_string = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 8:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->a_complex.read(iprot);
          this->__isset.a_complex = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 9:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->a_f32vector.clear();
            uint32_t _size2;
            ::apache::thrift::protocol::TType _etype5;
            xfer += iprot->readListBegin(_etype5, _size2);
            this->a_f32vector.resize(_size2);
            uint32_t _i6;
            for (_i6 = 0; _i6 < _size2; ++_i6)
            {
              xfer += iprot->readDouble(this->a_f32vector[_i6]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.a_f32vector = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 10:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->a_f64vector.clear();
            uint32_t _size7;
            ::apache::thrift::protocol::TType _etype10;
            xfer += iprot->readListBegin(_etype10, _size7);
            this->a_f64vector.resize(_size7);
            uint32_t _i11;
            for (_i11 = 0; _i11 < _size7; ++_i11)
            {
              xfer += iprot->readDouble(this->a_f64vector[_i11]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.a_f64vector = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 11:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->a_s64vector.clear();
            uint32_t _size12;
            ::apache::thrift::protocol::TType _etype15;
            xfer += iprot->readListBegin(_etype15, _size12);
            this->a_s64vector.resize(_size12);
            uint32_t _i16;
            for (_i16 = 0; _i16 < _size12; ++_i16)
            {
              xfer += iprot->readI64(this->a_s64vector[_i16]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.a_s64vector = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 12:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->a_s32vector.clear();
            uint32_t _size17;
            ::apache::thrift::protocol::TType _etype20;
            xfer += iprot->readListBegin(_etype20, _size17);
            this->a_s32vector.resize(_size17);
            uint32_t _i21;
            for (_i21 = 0; _i21 < _size17; ++_i21)
            {
              xfer += iprot->readI32(this->a_s32vector[_i21]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.a_s32vector = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 13:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->a_s16vector.clear();
            uint32_t _size22;
            ::apache::thrift::protocol::TType _etype25;
            xfer += iprot->readListBegin(_etype25, _size22);
            this->a_s16vector.resize(_size22);
            uint32_t _i26;
            for (_i26 = 0; _i26 < _size22; ++_i26)
            {
              xfer += iprot->readI16(this->a_s16vector[_i26]);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.a_s16vector = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 14:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readBinary(this->a_s8vector);
          this->__isset.a_s8vector = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 15:
        if (ftype == ::apache::thrift::protocol::T_LIST) {
          {
            this->a_c32vector.clear();
            uint32_t _size27;
            ::apache::thrift::protocol::TType _etype30;
            xfer += iprot->readListBegin(_etype30, _size27);
            this->a_c32vector.resize(_size27);
            uint32_t _i31;
            for (_i31 = 0; _i31 < _size27; ++_i31)
            {
              xfer += this->a_c32vector[_i31].read(iprot);
            }
            xfer += iprot->readListEnd();
          }
          this->__isset.a_c32vector = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t KnobBase::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("KnobBase");

  xfer += oprot->writeFieldBegin("a_bool", ::apache::thrift::protocol::T_BOOL, 1);
  xfer += oprot->writeBool(this->a_bool);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_byte", ::apache::thrift::protocol::T_BYTE, 2);
  xfer += oprot->writeByte(this->a_byte);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_short", ::apache::thrift::protocol::T_I16, 3);
  xfer += oprot->writeI16(this->a_short);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_int", ::apache::thrift::protocol::T_I32, 4);
  xfer += oprot->writeI32(this->a_int);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_long", ::apache::thrift::protocol::T_I64, 5);
  xfer += oprot->writeI64(this->a_long);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_double", ::apache::thrift::protocol::T_DOUBLE, 6);
  xfer += oprot->writeDouble(this->a_double);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_string", ::apache::thrift::protocol::T_STRING, 7);
  xfer += oprot->writeString(this->a_string);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_complex", ::apache::thrift::protocol::T_STRUCT, 8);
  xfer += this->a_complex.write(oprot);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_f32vector", ::apache::thrift::protocol::T_LIST, 9);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_DOUBLE, static_cast<uint32_t>(this->a_f32vector.size()));
    std::vector<double> ::const_iterator _iter32;
    for (_iter32 = this->a_f32vector.begin(); _iter32 != this->a_f32vector.end(); ++_iter32)
    {
      xfer += oprot->writeDouble((*_iter32));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_f64vector", ::apache::thrift::protocol::T_LIST, 10);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_DOUBLE, static_cast<uint32_t>(this->a_f64vector.size()));
    std::vector<double> ::const_iterator _iter33;
    for (_iter33 = this->a_f64vector.begin(); _iter33 != this->a_f64vector.end(); ++_iter33)
    {
      xfer += oprot->writeDouble((*_iter33));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_s64vector", ::apache::thrift::protocol::T_LIST, 11);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->a_s64vector.size()));
    std::vector<int64_t> ::const_iterator _iter34;
    for (_iter34 = this->a_s64vector.begin(); _iter34 != this->a_s64vector.end(); ++_iter34)
    {
      xfer += oprot->writeI64((*_iter34));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_s32vector", ::apache::thrift::protocol::T_LIST, 12);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I32, static_cast<uint32_t>(this->a_s32vector.size()));
    std::vector<int32_t> ::const_iterator _iter35;
    for (_iter35 = this->a_s32vector.begin(); _iter35 != this->a_s32vector.end(); ++_iter35)
    {
      xfer += oprot->writeI32((*_iter35));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_s16vector", ::apache::thrift::protocol::T_LIST, 13);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I16, static_cast<uint32_t>(this->a_s16vector.size()));
    std::vector<int16_t> ::const_iterator _iter36;
    for (_iter36 = this->a_s16vector.begin(); _iter36 != this->a_s16vector.end(); ++_iter36)
    {
      xfer += oprot->writeI16((*_iter36));
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_s8vector", ::apache::thrift::protocol::T_STRING, 14);
  xfer += oprot->writeBinary(this->a_s8vector);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("a_c32vector", ::apache::thrift::protocol::T_LIST, 15);
  {
    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_STRUCT, static_cast<uint32_t>(this->a_c32vector.size()));
    std::vector<complex> ::const_iterator _iter37;
    for (_iter37 = this->a_c32vector.begin(); _iter37 != this->a_c32vector.end(); ++_iter37)
    {
      xfer += (*_iter37).write(oprot);
    }
    xfer += oprot->writeListEnd();
  }
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(KnobBase &a, KnobBase &b) {
  using ::std::swap;
  swap(a.a_bool, b.a_bool);
  swap(a.a_byte, b.a_byte);
  swap(a.a_short, b.a_short);
  swap(a.a_int, b.a_int);
  swap(a.a_long, b.a_long);
  swap(a.a_double, b.a_double);
  swap(a.a_string, b.a_string);
  swap(a.a_complex, b.a_complex);
  swap(a.a_f32vector, b.a_f32vector);
  swap(a.a_f64vector, b.a_f64vector);
  swap(a.a_s64vector, b.a_s64vector);
  swap(a.a_s32vector, b.a_s32vector);
  swap(a.a_s16vector, b.a_s16vector);
  swap(a.a_s8vector, b.a_s8vector);
  swap(a.a_c32vector, b.a_c32vector);
  swap(a.__isset, b.__isset);
}

bool KnobBase::operator==(const KnobBase & rhs) const
{
  if (!(a_bool == rhs.a_bool))
    return false;
  if (!(a_byte == rhs.a_byte))
    return false;
  if (!(a_short == rhs.a_short))
    return false;
  if (!(a_int == rhs.a_int))
    return false;
  if (!(a_long == rhs.a_long))
    return false;
  if (!(a_double == rhs.a_double))
    return false;
  if (!(a_string == rhs.a_string))
    return false;
  if (!(a_complex == rhs.a_complex))
    return false;
  if (!(a_f32vector == rhs.a_f32vector))
    return false;
  if (!(a_f64vector == rhs.a_f64vector))
    return false;
  if (!(a_s64vector == rhs.a_s64vector))
    return false;
  if (!(a_s32vector == rhs.a_s32vector))
    return false;
  if (!(a_s16vector == rhs.a_s16vector))
    return false;
  if (!(a_s8vector == rhs.a_s8vector))
    return false;
  if (!(a_c32vector == rhs.a_c32vector))
    return false;
  return true;
}

KnobBase::KnobBase(const KnobBase& other38) {
  a_bool = other38.a_bool;
  a_byte = other38.a_byte;
  a_short = other38.a_short;
  a_int = other38.a_int;
  a_long = other38.a_long;
  a_double = other38.a_double;
  a_string = other38.a_string;
  a_complex = other38.a_complex;
  a_f32vector = other38.a_f32vector;
  a_f64vector = other38.a_f64vector;
  a_s64vector = other38.a_s64vector;
  a_s32vector = other38.a_s32vector;
  a_s16vector = other38.a_s16vector;
  a_s8vector = other38.a_s8vector;
  a_c32vector = other38.a_c32vector;
  __isset = other38.__isset;
}
KnobBase& KnobBase::operator=(const KnobBase& other39) {
  a_bool = other39.a_bool;
  a_byte = other39.a_byte;
  a_short = other39.a_short;
  a_int = other39.a_int;
  a_long = other39.a_long;
  a_double = other39.a_double;
  a_string = other39.a_string;
  a_complex = other39.a_complex;
  a_f32vector = other39.a_f32vector;
  a_f64vector = other39.a_f64vector;
  a_s64vector = other39.a_s64vector;
  a_s32vector = other39.a_s32vector;
  a_s16vector = other39.a_s16vector;
  a_s8vector = other39.a_s8vector;
  a_c32vector = other39.a_c32vector;
  __isset = other39.__isset;
  return *this;
}
void KnobBase::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "KnobBase(";
  out << "a_bool=" << to_string(a_bool);
  out << ", " << "a_byte=" << to_string(a_byte);
  out << ", " << "a_short=" << to_string(a_short);
  out << ", " << "a_int=" << to_string(a_int);
  out << ", " << "a_long=" << to_string(a_long);
  out << ", " << "a_double=" << to_string(a_double);
  out << ", " << "a_string=" << to_string(a_string);
  out << ", " << "a_complex=" << to_string(a_complex);
  out << ", " << "a_f32vector=" << to_string(a_f32vector);
  out << ", " << "a_f64vector=" << to_string(a_f64vector);
  out << ", " << "a_s64vector=" << to_string(a_s64vector);
  out << ", " << "a_s32vector=" << to_string(a_s32vector);
  out << ", " << "a_s16vector=" << to_string(a_s16vector);
  out << ", " << "a_s8vector=" << to_string(a_s8vector);
  out << ", " << "a_c32vector=" << to_string(a_c32vector);
  out << ")";
}


Knob::~Knob() noexcept {
}

Knob::Knob() noexcept
   : type(static_cast<BaseTypes::type>(0)) {
}

void Knob::__set_type(const BaseTypes::type val) {
  this->type = val;
}

void Knob::__set_value(const KnobBase& val) {
  this->value = val;
}
std::ostream& operator<<(std::ostream& out, const Knob& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t Knob::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast40;
          xfer += iprot->readI32(ecast40);
          this->type = static_cast<BaseTypes::type>(ecast40);
          this->__isset.type = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->value.read(iprot);
          this->__isset.value = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t Knob::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("Knob");

  xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1);
  xfer += oprot->writeI32(static_cast<int32_t>(this->type));
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("value", ::apache::thrift::protocol::T_STRUCT, 2);
  xfer += this->value.write(oprot);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(Knob &a, Knob &b) {
  using ::std::swap;
  swap(a.type, b.type);
  swap(a.value, b.value);
  swap(a.__isset, b.__isset);
}

bool Knob::operator==(const Knob & rhs) const
{
  if (!(type == rhs.type))
    return false;
  if (!(value == rhs.value))
    return false;
  return true;
}

Knob::Knob(const Knob& other41) {
  type = other41.type;
  value = other41.value;
  __isset = other41.__isset;
}
Knob& Knob::operator=(const Knob& other42) {
  type = other42.type;
  value = other42.value;
  __isset = other42.__isset;
  return *this;
}
void Knob::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "Knob(";
  out << "type=" << to_string(type);
  out << ", " << "value=" << to_string(value);
  out << ")";
}


KnobProp::~KnobProp() noexcept {
}

KnobProp::KnobProp() noexcept
   : type(static_cast<KnobType::type>(0)),
     units(),
     description(),
     display(0) {
}

void KnobProp::__set_type(const KnobType::type val) {
  this->type = val;
}

void KnobProp::__set_units(const std::string& val) {
  this->units = val;
}

void KnobProp::__set_description(const std::string& val) {
  this->description = val;
}

void KnobProp::__set_display(const int32_t val) {
  this->display = val;
}

void KnobProp::__set_min(const Knob& val) {
  this->min = val;
}

void KnobProp::__set_max(const Knob& val) {
  this->max = val;
}

void KnobProp::__set_defaultvalue(const Knob& val) {
  this->defaultvalue = val;
}
std::ostream& operator<<(std::ostream& out, const KnobProp& obj)
{
  obj.printTo(out);
  return out;
}


uint32_t KnobProp::read(::apache::thrift::protocol::TProtocol* iprot) {

  ::apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);
  uint32_t xfer = 0;
  std::string fname;
  ::apache::thrift::protocol::TType ftype;
  int16_t fid;

  xfer += iprot->readStructBegin(fname);

  using ::apache::thrift::protocol::TProtocolException;


  while (true)
  {
    xfer += iprot->readFieldBegin(fname, ftype, fid);
    if (ftype == ::apache::thrift::protocol::T_STOP) {
      break;
    }
    switch (fid)
    {
      case 1:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          int32_t ecast43;
          xfer += iprot->readI32(ecast43);
          this->type = static_cast<KnobType::type>(ecast43);
          this->__isset.type = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 2:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->units);
          this->__isset.units = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 3:
        if (ftype == ::apache::thrift::protocol::T_STRING) {
          xfer += iprot->readString(this->description);
          this->__isset.description = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 4:
        if (ftype == ::apache::thrift::protocol::T_I32) {
          xfer += iprot->readI32(this->display);
          this->__isset.display = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 5:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->min.read(iprot);
          this->__isset.min = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 6:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->max.read(iprot);
          this->__isset.max = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      case 7:
        if (ftype == ::apache::thrift::protocol::T_STRUCT) {
          xfer += this->defaultvalue.read(iprot);
          this->__isset.defaultvalue = true;
        } else {
          xfer += iprot->skip(ftype);
        }
        break;
      default:
        xfer += iprot->skip(ftype);
        break;
    }
    xfer += iprot->readFieldEnd();
  }

  xfer += iprot->readStructEnd();

  return xfer;
}

uint32_t KnobProp::write(::apache::thrift::protocol::TProtocol* oprot) const {
  uint32_t xfer = 0;
  ::apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);
  xfer += oprot->writeStructBegin("KnobProp");

  xfer += oprot->writeFieldBegin("type", ::apache::thrift::protocol::T_I32, 1);
  xfer += oprot->writeI32(static_cast<int32_t>(this->type));
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("units", ::apache::thrift::protocol::T_STRING, 2);
  xfer += oprot->writeString(this->units);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("description", ::apache::thrift::protocol::T_STRING, 3);
  xfer += oprot->writeString(this->description);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("display", ::apache::thrift::protocol::T_I32, 4);
  xfer += oprot->writeI32(this->display);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("min", ::apache::thrift::protocol::T_STRUCT, 5);
  xfer += this->min.write(oprot);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("max", ::apache::thrift::protocol::T_STRUCT, 6);
  xfer += this->max.write(oprot);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldBegin("defaultvalue", ::apache::thrift::protocol::T_STRUCT, 7);
  xfer += this->defaultvalue.write(oprot);
  xfer += oprot->writeFieldEnd();

  xfer += oprot->writeFieldStop();
  xfer += oprot->writeStructEnd();
  return xfer;
}

void swap(KnobProp &a, KnobProp &b) {
  using ::std::swap;
  swap(a.type, b.type);
  swap(a.units, b.units);
  swap(a.description, b.description);
  swap(a.display, b.display);
  swap(a.min, b.min);
  swap(a.max, b.max);
  swap(a.defaultvalue, b.defaultvalue);
  swap(a.__isset, b.__isset);
}

bool KnobProp::operator==(const KnobProp & rhs) const
{
  if (!(type == rhs.type))
    return false;
  if (!(units == rhs.units))
    return false;
  if (!(description == rhs.description))
    return false;
  if (!(display == rhs.display))
    return false;
  if (!(min == rhs.min))
    return false;
  if (!(max == rhs.max))
    return false;
  if (!(defaultvalue == rhs.defaultvalue))
    return false;
  return true;
}

KnobProp::KnobProp(const KnobProp& other44) {
  type = other44.type;
  units = other44.units;
  description = other44.description;
  display = other44.display;
  min = other44.min;
  max = other44.max;
  defaultvalue = other44.defaultvalue;
  __isset = other44.__isset;
}
KnobProp& KnobProp::operator=(const KnobProp& other45) {
  type = other45.type;
  units = other45.units;
  description = other45.description;
  display = other45.display;
  min = other45.min;
  max = other45.max;
  defaultvalue = other45.defaultvalue;
  __isset = other45.__isset;
  return *this;
}
void KnobProp::printTo(std::ostream& out) const {
  using ::apache::thrift::to_string;
  out << "KnobProp(";
  out << "type=" << to_string(type);
  out << ", " << "units=" << to_string(units);
  out << ", " << "description=" << to_string(description);
  out << ", " << "display=" << to_string(display);
  out << ", " << "min=" << to_string(min);
  out << ", " << "max=" << to_string(max);
  out << ", " << "defaultvalue=" << to_string(defaultvalue);
  out << ")";
}

} // namespace
