/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */
#ifndef  _Tleveldb_DB_H
#define  _Tleveldb_DB_H

#include <TDispatchProcessor.h>
#include "leveldb_types.h"

namespace Tleveldb {

class DBIf {
 public:
  virtual ~DBIf() {}
  virtual void Open(DBHandle& _return, const Text& dbname, const DBOptions& dboptions) = 0;
  virtual Code Close(const DBHandle& dbhandle, const Text& dbname) = 0;
  virtual Code Put(const DBHandle& dbhandle, const kv& keyvalue, const WriteOptions& options) = 0;
  virtual Code Delete(const DBHandle& dbhandle, const Slice& key, const WriteOptions& options) = 0;
  virtual Code Write(const DBHandle& dbhandle, const std::vector<kv> & batch, const WriteOptions& options) = 0;
  virtual void Get(ResultItem& _return, const DBHandle& dbhandle, const Slice& inputkey, const ReadOptions& options) = 0;
  virtual void NewIterator(ResultIterator& _return, const DBHandle& dbhandle, const ReadOptions& options, IteratorType iteratorType, const Slice& target) = 0;
  virtual Code DeleteIterator(const DBHandle& dbhandle, const Iterator& iterator) = 0;
  virtual void GetNext(ResultPair& _return, const DBHandle& dbhandle, const Iterator& iterator) = 0;
  virtual void GetPrev(ResultPair& _return, const DBHandle& dbhandle, const Iterator& iterator) = 0;
  virtual void GetSnapshot(ResultSnapshot& _return, const DBHandle& dbhandle) = 0;
  virtual Code ReleaseSnapshot(const DBHandle& dbhandle, const Snapshot& snapshot) = 0;
  virtual Code CompactRange(const DBHandle& dbhandle, const Slice& start, const Slice& endhere) = 0;
};

class DBIfFactory {
 public:
  typedef DBIf Handler;

  virtual ~DBIfFactory() {}

  virtual DBIf* getHandler(::apache::thrift::server::TConnectionContext* ctx) = 0;
  virtual void releaseHandler(DBIf* handler) = 0;
};

class DBIfSingletonFactory : virtual public DBIfFactory {
 public:
  DBIfSingletonFactory(const boost::shared_ptr<DBIf>& iface) : iface_(iface) {}
  virtual ~DBIfSingletonFactory() {}

  virtual DBIf* getHandler(::apache::thrift::server::TConnectionContext*) {
    return iface_.get();
  }
  virtual void releaseHandler(DBIf* handler) {}

 protected:
  boost::shared_ptr<DBIf> iface_;
};

class DBNull : virtual public DBIf {
 public:
  virtual ~DBNull() {}
  void Open(DBHandle& /* _return */, const Text& /* dbname */, const DBOptions& /* dboptions */) {
    return;
  }
  Code Close(const DBHandle& /* dbhandle */, const Text& /* dbname */) {
    Code _return = (Code)0;
    return _return;
  }
  Code Put(const DBHandle& /* dbhandle */, const kv& /* keyvalue */, const WriteOptions& /* options */) {
    Code _return = (Code)0;
    return _return;
  }
  Code Delete(const DBHandle& /* dbhandle */, const Slice& /* key */, const WriteOptions& /* options */) {
    Code _return = (Code)0;
    return _return;
  }
  Code Write(const DBHandle& /* dbhandle */, const std::vector<kv> & /* batch */, const WriteOptions& /* options */) {
    Code _return = (Code)0;
    return _return;
  }
  void Get(ResultItem& /* _return */, const DBHandle& /* dbhandle */, const Slice& /* inputkey */, const ReadOptions& /* options */) {
    return;
  }
  void NewIterator(ResultIterator& /* _return */, const DBHandle& /* dbhandle */, const ReadOptions& /* options */, IteratorType /* iteratorType */, const Slice& /* target */) {
    return;
  }
  Code DeleteIterator(const DBHandle& /* dbhandle */, const Iterator& /* iterator */) {
    Code _return = (Code)0;
    return _return;
  }
  void GetNext(ResultPair& /* _return */, const DBHandle& /* dbhandle */, const Iterator& /* iterator */) {
    return;
  }
  void GetPrev(ResultPair& /* _return */, const DBHandle& /* dbhandle */, const Iterator& /* iterator */) {
    return;
  }
  void GetSnapshot(ResultSnapshot& /* _return */, const DBHandle& /* dbhandle */) {
    return;
  }
  Code ReleaseSnapshot(const DBHandle& /* dbhandle */, const Snapshot& /* snapshot */) {
    Code _return = (Code)0;
    return _return;
  }
  Code CompactRange(const DBHandle& /* dbhandle */, const Slice& /* start */, const Slice& /* endhere */) {
    Code _return = (Code)0;
    return _return;
  }
};

class DB_Open_args {
 public:

  static const uint64_t _reflection_id = 5143148560683113100U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Open_args() : dbname("") {
  }

  DB_Open_args(const DB_Open_args&) = default;
  DB_Open_args& operator=(const DB_Open_args&) = default;
  DB_Open_args(DB_Open_args&&) = default;
  DB_Open_args& operator=(DB_Open_args&&) = default;

  void __clear() {
    dbname = "";
    dboptions.__clear();
    __isset.__clear();
  }

  virtual ~DB_Open_args() throw() {}

  Text dbname;
  DBOptions dboptions;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbname = false;
      dboptions = false;
    }
    bool dbname;
    bool dboptions;
  } __isset;

  bool operator == (const DB_Open_args & rhs) const
  {
    if (!(this->dbname == rhs.dbname))
      return false;
    if (!(this->dboptions == rhs.dboptions))
      return false;
    return true;
  }
  bool operator != (const DB_Open_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Open_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Open_pargs {
 public:

  static const uint64_t _reflection_id = 5558263615018901836U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Open_pargs() throw() {}

  const Text* dbname;
  const DBOptions* dboptions;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Open_result {
 public:

  static const uint64_t _reflection_id = 585101419942616428U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Open_result() {
  }

  DB_Open_result(const DB_Open_result&) = default;
  DB_Open_result& operator=(const DB_Open_result&) = default;
  DB_Open_result(DB_Open_result&&) = default;
  DB_Open_result& operator=(DB_Open_result&&) = default;

  void __clear() {
    success.__clear();
    se.__clear();
    __isset.__clear();
  }

  virtual ~DB_Open_result() throw() {}

  DBHandle success;
  LeveldbException se;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
      se = false;
    }
    bool success;
    bool se;
  } __isset;

  bool operator == (const DB_Open_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    if (!(this->se == rhs.se))
      return false;
    return true;
  }
  bool operator != (const DB_Open_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Open_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Open_presult {
 public:

  static const uint64_t _reflection_id = 1768872265754142060U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Open_presult() throw() {}

  DBHandle* success;
  LeveldbException se;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
      se = false;
    }
    bool success;
    bool se;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_Close_args {
 public:

  static const uint64_t _reflection_id = 3653575979806469484U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Close_args() : dbname("") {
  }

  DB_Close_args(const DB_Close_args&) = default;
  DB_Close_args& operator=(const DB_Close_args&) = default;
  DB_Close_args(DB_Close_args&&) = default;
  DB_Close_args& operator=(DB_Close_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    dbname = "";
    __isset.__clear();
  }

  virtual ~DB_Close_args() throw() {}

  DBHandle dbhandle;
  Text dbname;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      dbname = false;
    }
    bool dbhandle;
    bool dbname;
  } __isset;

  bool operator == (const DB_Close_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->dbname == rhs.dbname))
      return false;
    return true;
  }
  bool operator != (const DB_Close_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Close_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Close_pargs {
 public:

  static const uint64_t _reflection_id = 2939164562981598508U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Close_pargs() throw() {}

  const DBHandle* dbhandle;
  const Text* dbname;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Close_result {
 public:

  static const uint64_t _reflection_id = 11420986846439017932U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Close_result() : success(static_cast<Code>(0)) {
  }

  DB_Close_result(const DB_Close_result&) = default;
  DB_Close_result& operator=(const DB_Close_result&) = default;
  DB_Close_result(DB_Close_result&&) = default;
  DB_Close_result& operator=(DB_Close_result&&) = default;

  void __clear() {
    success = static_cast<Code>(0);
    __isset.__clear();
  }

  virtual ~DB_Close_result() throw() {}

  Code success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_Close_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_Close_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Close_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Close_presult {
 public:

  static const uint64_t _reflection_id = 6223865401759091820U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Close_presult() throw() {}

  Code* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_Put_args {
 public:

  static const uint64_t _reflection_id = 15095251014297097356U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Put_args() {
  }

  DB_Put_args(const DB_Put_args&) = default;
  DB_Put_args& operator=(const DB_Put_args&) = default;
  DB_Put_args(DB_Put_args&&) = default;
  DB_Put_args& operator=(DB_Put_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    keyvalue.__clear();
    options.__clear();
    __isset.__clear();
  }

  virtual ~DB_Put_args() throw() {}

  DBHandle dbhandle;
  kv keyvalue;
  WriteOptions options;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      keyvalue = false;
      options = false;
    }
    bool dbhandle;
    bool keyvalue;
    bool options;
  } __isset;

  bool operator == (const DB_Put_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->keyvalue == rhs.keyvalue))
      return false;
    if (!(this->options == rhs.options))
      return false;
    return true;
  }
  bool operator != (const DB_Put_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Put_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Put_pargs {
 public:

  static const uint64_t _reflection_id = 5565059585805949260U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Put_pargs() throw() {}

  const DBHandle* dbhandle;
  const kv* keyvalue;
  const WriteOptions* options;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Put_result {
 public:

  static const uint64_t _reflection_id = 16570405853514888204U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Put_result() : success(static_cast<Code>(0)) {
  }

  DB_Put_result(const DB_Put_result&) = default;
  DB_Put_result& operator=(const DB_Put_result&) = default;
  DB_Put_result(DB_Put_result&&) = default;
  DB_Put_result& operator=(DB_Put_result&&) = default;

  void __clear() {
    success = static_cast<Code>(0);
    __isset.__clear();
  }

  virtual ~DB_Put_result() throw() {}

  Code success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_Put_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_Put_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Put_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Put_presult {
 public:

  static const uint64_t _reflection_id = 10104675682455674284U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Put_presult() throw() {}

  Code* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_Delete_args {
 public:

  static const uint64_t _reflection_id = 14071755674720794316U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Delete_args() {
  }

  DB_Delete_args(const DB_Delete_args&) = default;
  DB_Delete_args& operator=(const DB_Delete_args&) = default;
  DB_Delete_args(DB_Delete_args&&) = default;
  DB_Delete_args& operator=(DB_Delete_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    key.__clear();
    options.__clear();
    __isset.__clear();
  }

  virtual ~DB_Delete_args() throw() {}

  DBHandle dbhandle;
  Slice key;
  WriteOptions options;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      key = false;
      options = false;
    }
    bool dbhandle;
    bool key;
    bool options;
  } __isset;

  bool operator == (const DB_Delete_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->key == rhs.key))
      return false;
    if (!(this->options == rhs.options))
      return false;
    return true;
  }
  bool operator != (const DB_Delete_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Delete_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Delete_pargs {
 public:

  static const uint64_t _reflection_id = 10963630852202029196U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Delete_pargs() throw() {}

  const DBHandle* dbhandle;
  const Slice* key;
  const WriteOptions* options;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Delete_result {
 public:

  static const uint64_t _reflection_id = 13146432606937654604U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Delete_result() : success(static_cast<Code>(0)) {
  }

  DB_Delete_result(const DB_Delete_result&) = default;
  DB_Delete_result& operator=(const DB_Delete_result&) = default;
  DB_Delete_result(DB_Delete_result&&) = default;
  DB_Delete_result& operator=(DB_Delete_result&&) = default;

  void __clear() {
    success = static_cast<Code>(0);
    __isset.__clear();
  }

  virtual ~DB_Delete_result() throw() {}

  Code success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_Delete_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_Delete_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Delete_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Delete_presult {
 public:

  static const uint64_t _reflection_id = 17322073978832327340U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Delete_presult() throw() {}

  Code* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_Write_args {
 public:

  static const uint64_t _reflection_id = 12580138032621479660U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Write_args() {
  }

  DB_Write_args(const DB_Write_args&) = default;
  DB_Write_args& operator=(const DB_Write_args&) = default;
  DB_Write_args(DB_Write_args&&) = default;
  DB_Write_args& operator=(DB_Write_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    batch.clear();
    options.__clear();
    __isset.__clear();
  }

  virtual ~DB_Write_args() throw() {}

  DBHandle dbhandle;
  std::vector<kv>  batch;
  WriteOptions options;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      batch = false;
      options = false;
    }
    bool dbhandle;
    bool batch;
    bool options;
  } __isset;

  bool operator == (const DB_Write_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->batch == rhs.batch))
      return false;
    if (!(this->options == rhs.options))
      return false;
    return true;
  }
  bool operator != (const DB_Write_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Write_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Write_pargs {
 public:

  static const uint64_t _reflection_id = 3898152651480297548U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Write_pargs() throw() {}

  const DBHandle* dbhandle;
  const std::vector<kv> * batch;
  const WriteOptions* options;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Write_result {
 public:

  static const uint64_t _reflection_id = 18306458689824631724U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Write_result() : success(static_cast<Code>(0)) {
  }

  DB_Write_result(const DB_Write_result&) = default;
  DB_Write_result& operator=(const DB_Write_result&) = default;
  DB_Write_result(DB_Write_result&&) = default;
  DB_Write_result& operator=(DB_Write_result&&) = default;

  void __clear() {
    success = static_cast<Code>(0);
    __isset.__clear();
  }

  virtual ~DB_Write_result() throw() {}

  Code success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_Write_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_Write_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Write_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Write_presult {
 public:

  static const uint64_t _reflection_id = 11189139329514764236U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Write_presult() throw() {}

  Code* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_Get_args {
 public:

  static const uint64_t _reflection_id = 5802112698229680972U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Get_args() {
  }

  DB_Get_args(const DB_Get_args&) = default;
  DB_Get_args& operator=(const DB_Get_args&) = default;
  DB_Get_args(DB_Get_args&&) = default;
  DB_Get_args& operator=(DB_Get_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    inputkey.__clear();
    options.__clear();
    __isset.__clear();
  }

  virtual ~DB_Get_args() throw() {}

  DBHandle dbhandle;
  Slice inputkey;
  ReadOptions options;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      inputkey = false;
      options = false;
    }
    bool dbhandle;
    bool inputkey;
    bool options;
  } __isset;

  bool operator == (const DB_Get_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->inputkey == rhs.inputkey))
      return false;
    if (!(this->options == rhs.options))
      return false;
    return true;
  }
  bool operator != (const DB_Get_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Get_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Get_pargs {
 public:

  static const uint64_t _reflection_id = 775586916617672204U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Get_pargs() throw() {}

  const DBHandle* dbhandle;
  const Slice* inputkey;
  const ReadOptions* options;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Get_result {
 public:

  static const uint64_t _reflection_id = 471316346092127948U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_Get_result() {
  }

  DB_Get_result(const DB_Get_result&) = default;
  DB_Get_result& operator=(const DB_Get_result&) = default;
  DB_Get_result(DB_Get_result&&) = default;
  DB_Get_result& operator=(DB_Get_result&&) = default;

  void __clear() {
    success.__clear();
    __isset.__clear();
  }

  virtual ~DB_Get_result() throw() {}

  ResultItem success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_Get_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_Get_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_Get_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_Get_presult {
 public:

  static const uint64_t _reflection_id = 15884536389555503916U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_Get_presult() throw() {}

  ResultItem* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_NewIterator_args {
 public:

  static const uint64_t _reflection_id = 6645485240268124940U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_NewIterator_args() : iteratorType(static_cast<IteratorType>(0)) {
  }

  DB_NewIterator_args(const DB_NewIterator_args&) = default;
  DB_NewIterator_args& operator=(const DB_NewIterator_args&) = default;
  DB_NewIterator_args(DB_NewIterator_args&&) = default;
  DB_NewIterator_args& operator=(DB_NewIterator_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    options.__clear();
    iteratorType = static_cast<IteratorType>(0);
    target.__clear();
    __isset.__clear();
  }

  virtual ~DB_NewIterator_args() throw() {}

  DBHandle dbhandle;
  ReadOptions options;
  IteratorType iteratorType;
  Slice target;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      options = false;
      iteratorType = false;
      target = false;
    }
    bool dbhandle;
    bool options;
    bool iteratorType;
    bool target;
  } __isset;

  bool operator == (const DB_NewIterator_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->options == rhs.options))
      return false;
    if (!(this->iteratorType == rhs.iteratorType))
      return false;
    if (!(this->target == rhs.target))
      return false;
    return true;
  }
  bool operator != (const DB_NewIterator_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_NewIterator_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_NewIterator_pargs {
 public:

  static const uint64_t _reflection_id = 5353644888786218764U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_NewIterator_pargs() throw() {}

  const DBHandle* dbhandle;
  const ReadOptions* options;
  const IteratorType* iteratorType;
  const Slice* target;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_NewIterator_result {
 public:

  static const uint64_t _reflection_id = 16747725486624219692U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_NewIterator_result() {
  }

  DB_NewIterator_result(const DB_NewIterator_result&) = default;
  DB_NewIterator_result& operator=(const DB_NewIterator_result&) = default;
  DB_NewIterator_result(DB_NewIterator_result&&) = default;
  DB_NewIterator_result& operator=(DB_NewIterator_result&&) = default;

  void __clear() {
    success.__clear();
    __isset.__clear();
  }

  virtual ~DB_NewIterator_result() throw() {}

  ResultIterator success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_NewIterator_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_NewIterator_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_NewIterator_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_NewIterator_presult {
 public:

  static const uint64_t _reflection_id = 30225981924653164U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_NewIterator_presult() throw() {}

  ResultIterator* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_DeleteIterator_args {
 public:

  static const uint64_t _reflection_id = 15751789239200963564U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_DeleteIterator_args() {
  }

  DB_DeleteIterator_args(const DB_DeleteIterator_args&) = default;
  DB_DeleteIterator_args& operator=(const DB_DeleteIterator_args&) = default;
  DB_DeleteIterator_args(DB_DeleteIterator_args&&) = default;
  DB_DeleteIterator_args& operator=(DB_DeleteIterator_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    iterator.__clear();
    __isset.__clear();
  }

  virtual ~DB_DeleteIterator_args() throw() {}

  DBHandle dbhandle;
  Iterator iterator;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      iterator = false;
    }
    bool dbhandle;
    bool iterator;
  } __isset;

  bool operator == (const DB_DeleteIterator_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->iterator == rhs.iterator))
      return false;
    return true;
  }
  bool operator != (const DB_DeleteIterator_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_DeleteIterator_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_DeleteIterator_pargs {
 public:

  static const uint64_t _reflection_id = 6515929643750099916U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_DeleteIterator_pargs() throw() {}

  const DBHandle* dbhandle;
  const Iterator* iterator;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_DeleteIterator_result {
 public:

  static const uint64_t _reflection_id = 567840673627283948U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_DeleteIterator_result() : success(static_cast<Code>(0)) {
  }

  DB_DeleteIterator_result(const DB_DeleteIterator_result&) = default;
  DB_DeleteIterator_result& operator=(const DB_DeleteIterator_result&) = default;
  DB_DeleteIterator_result(DB_DeleteIterator_result&&) = default;
  DB_DeleteIterator_result& operator=(DB_DeleteIterator_result&&) = default;

  void __clear() {
    success = static_cast<Code>(0);
    __isset.__clear();
  }

  virtual ~DB_DeleteIterator_result() throw() {}

  Code success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_DeleteIterator_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_DeleteIterator_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_DeleteIterator_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_DeleteIterator_presult {
 public:

  static const uint64_t _reflection_id = 16445220168564239308U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_DeleteIterator_presult() throw() {}

  Code* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_GetNext_args {
 public:

  static const uint64_t _reflection_id = 6184101100378654860U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_GetNext_args() {
  }

  DB_GetNext_args(const DB_GetNext_args&) = default;
  DB_GetNext_args& operator=(const DB_GetNext_args&) = default;
  DB_GetNext_args(DB_GetNext_args&&) = default;
  DB_GetNext_args& operator=(DB_GetNext_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    iterator.__clear();
    __isset.__clear();
  }

  virtual ~DB_GetNext_args() throw() {}

  DBHandle dbhandle;
  Iterator iterator;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      iterator = false;
    }
    bool dbhandle;
    bool iterator;
  } __isset;

  bool operator == (const DB_GetNext_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->iterator == rhs.iterator))
      return false;
    return true;
  }
  bool operator != (const DB_GetNext_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_GetNext_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetNext_pargs {
 public:

  static const uint64_t _reflection_id = 14242404761042565548U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_GetNext_pargs() throw() {}

  const DBHandle* dbhandle;
  const Iterator* iterator;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetNext_result {
 public:

  static const uint64_t _reflection_id = 824363650095435948U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_GetNext_result() {
  }

  DB_GetNext_result(const DB_GetNext_result&) = default;
  DB_GetNext_result& operator=(const DB_GetNext_result&) = default;
  DB_GetNext_result(DB_GetNext_result&&) = default;
  DB_GetNext_result& operator=(DB_GetNext_result&&) = default;

  void __clear() {
    success.__clear();
    __isset.__clear();
  }

  virtual ~DB_GetNext_result() throw() {}

  ResultPair success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_GetNext_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_GetNext_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_GetNext_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetNext_presult {
 public:

  static const uint64_t _reflection_id = 17974802380941600588U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_GetNext_presult() throw() {}

  ResultPair* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_GetPrev_args {
 public:

  static const uint64_t _reflection_id = 8870271973715332140U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_GetPrev_args() {
  }

  DB_GetPrev_args(const DB_GetPrev_args&) = default;
  DB_GetPrev_args& operator=(const DB_GetPrev_args&) = default;
  DB_GetPrev_args(DB_GetPrev_args&&) = default;
  DB_GetPrev_args& operator=(DB_GetPrev_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    iterator.__clear();
    __isset.__clear();
  }

  virtual ~DB_GetPrev_args() throw() {}

  DBHandle dbhandle;
  Iterator iterator;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      iterator = false;
    }
    bool dbhandle;
    bool iterator;
  } __isset;

  bool operator == (const DB_GetPrev_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->iterator == rhs.iterator))
      return false;
    return true;
  }
  bool operator != (const DB_GetPrev_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_GetPrev_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetPrev_pargs {
 public:

  static const uint64_t _reflection_id = 16552208169457784972U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_GetPrev_pargs() throw() {}

  const DBHandle* dbhandle;
  const Iterator* iterator;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetPrev_result {
 public:

  static const uint64_t _reflection_id = 17005837545637039820U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_GetPrev_result() {
  }

  DB_GetPrev_result(const DB_GetPrev_result&) = default;
  DB_GetPrev_result& operator=(const DB_GetPrev_result&) = default;
  DB_GetPrev_result(DB_GetPrev_result&&) = default;
  DB_GetPrev_result& operator=(DB_GetPrev_result&&) = default;

  void __clear() {
    success.__clear();
    __isset.__clear();
  }

  virtual ~DB_GetPrev_result() throw() {}

  ResultPair success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_GetPrev_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_GetPrev_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_GetPrev_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetPrev_presult {
 public:

  static const uint64_t _reflection_id = 12518588444439336556U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_GetPrev_presult() throw() {}

  ResultPair* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_GetSnapshot_args {
 public:

  static const uint64_t _reflection_id = 14984968825961323724U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_GetSnapshot_args() {
  }

  DB_GetSnapshot_args(const DB_GetSnapshot_args&) = default;
  DB_GetSnapshot_args& operator=(const DB_GetSnapshot_args&) = default;
  DB_GetSnapshot_args(DB_GetSnapshot_args&&) = default;
  DB_GetSnapshot_args& operator=(DB_GetSnapshot_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    __isset.__clear();
  }

  virtual ~DB_GetSnapshot_args() throw() {}

  DBHandle dbhandle;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
    }
    bool dbhandle;
  } __isset;

  bool operator == (const DB_GetSnapshot_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    return true;
  }
  bool operator != (const DB_GetSnapshot_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_GetSnapshot_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetSnapshot_pargs {
 public:

  static const uint64_t _reflection_id = 7188867685881890956U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_GetSnapshot_pargs() throw() {}

  const DBHandle* dbhandle;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetSnapshot_result {
 public:

  static const uint64_t _reflection_id = 18029040421792131212U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_GetSnapshot_result() {
  }

  DB_GetSnapshot_result(const DB_GetSnapshot_result&) = default;
  DB_GetSnapshot_result& operator=(const DB_GetSnapshot_result&) = default;
  DB_GetSnapshot_result(DB_GetSnapshot_result&&) = default;
  DB_GetSnapshot_result& operator=(DB_GetSnapshot_result&&) = default;

  void __clear() {
    success.__clear();
    __isset.__clear();
  }

  virtual ~DB_GetSnapshot_result() throw() {}

  ResultSnapshot success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_GetSnapshot_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_GetSnapshot_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_GetSnapshot_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_GetSnapshot_presult {
 public:

  static const uint64_t _reflection_id = 10451056179121017996U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_GetSnapshot_presult() throw() {}

  ResultSnapshot* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_ReleaseSnapshot_args {
 public:

  static const uint64_t _reflection_id = 14945627971981075500U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_ReleaseSnapshot_args() {
  }

  DB_ReleaseSnapshot_args(const DB_ReleaseSnapshot_args&) = default;
  DB_ReleaseSnapshot_args& operator=(const DB_ReleaseSnapshot_args&) = default;
  DB_ReleaseSnapshot_args(DB_ReleaseSnapshot_args&&) = default;
  DB_ReleaseSnapshot_args& operator=(DB_ReleaseSnapshot_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    snapshot.__clear();
    __isset.__clear();
  }

  virtual ~DB_ReleaseSnapshot_args() throw() {}

  DBHandle dbhandle;
  Snapshot snapshot;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      snapshot = false;
    }
    bool dbhandle;
    bool snapshot;
  } __isset;

  bool operator == (const DB_ReleaseSnapshot_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->snapshot == rhs.snapshot))
      return false;
    return true;
  }
  bool operator != (const DB_ReleaseSnapshot_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_ReleaseSnapshot_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_ReleaseSnapshot_pargs {
 public:

  static const uint64_t _reflection_id = 8283387247692679788U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_ReleaseSnapshot_pargs() throw() {}

  const DBHandle* dbhandle;
  const Snapshot* snapshot;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_ReleaseSnapshot_result {
 public:

  static const uint64_t _reflection_id = 15486363403695239660U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_ReleaseSnapshot_result() : success(static_cast<Code>(0)) {
  }

  DB_ReleaseSnapshot_result(const DB_ReleaseSnapshot_result&) = default;
  DB_ReleaseSnapshot_result& operator=(const DB_ReleaseSnapshot_result&) = default;
  DB_ReleaseSnapshot_result(DB_ReleaseSnapshot_result&&) = default;
  DB_ReleaseSnapshot_result& operator=(DB_ReleaseSnapshot_result&&) = default;

  void __clear() {
    success = static_cast<Code>(0);
    __isset.__clear();
  }

  virtual ~DB_ReleaseSnapshot_result() throw() {}

  Code success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_ReleaseSnapshot_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_ReleaseSnapshot_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_ReleaseSnapshot_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_ReleaseSnapshot_presult {
 public:

  static const uint64_t _reflection_id = 13925350785061977420U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_ReleaseSnapshot_presult() throw() {}

  Code* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DB_CompactRange_args {
 public:

  static const uint64_t _reflection_id = 6075170995358567596U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_CompactRange_args() {
  }

  DB_CompactRange_args(const DB_CompactRange_args&) = default;
  DB_CompactRange_args& operator=(const DB_CompactRange_args&) = default;
  DB_CompactRange_args(DB_CompactRange_args&&) = default;
  DB_CompactRange_args& operator=(DB_CompactRange_args&&) = default;

  void __clear() {
    dbhandle.__clear();
    start.__clear();
    endhere.__clear();
    __isset.__clear();
  }

  virtual ~DB_CompactRange_args() throw() {}

  DBHandle dbhandle;
  Slice start;
  Slice endhere;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      dbhandle = false;
      start = false;
      endhere = false;
    }
    bool dbhandle;
    bool start;
    bool endhere;
  } __isset;

  bool operator == (const DB_CompactRange_args & rhs) const
  {
    if (!(this->dbhandle == rhs.dbhandle))
      return false;
    if (!(this->start == rhs.start))
      return false;
    if (!(this->endhere == rhs.endhere))
      return false;
    return true;
  }
  bool operator != (const DB_CompactRange_args &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_CompactRange_args & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_CompactRange_pargs {
 public:

  static const uint64_t _reflection_id = 11177200356381642316U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_CompactRange_pargs() throw() {}

  const DBHandle* dbhandle;
  const Slice* start;
  const Slice* endhere;

  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_CompactRange_result {
 public:

  static const uint64_t _reflection_id = 12835198829390966636U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);
  DB_CompactRange_result() : success(static_cast<Code>(0)) {
  }

  DB_CompactRange_result(const DB_CompactRange_result&) = default;
  DB_CompactRange_result& operator=(const DB_CompactRange_result&) = default;
  DB_CompactRange_result(DB_CompactRange_result&&) = default;
  DB_CompactRange_result& operator=(DB_CompactRange_result&&) = default;

  void __clear() {
    success = static_cast<Code>(0);
    __isset.__clear();
  }

  virtual ~DB_CompactRange_result() throw() {}

  Code success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  bool operator == (const DB_CompactRange_result & rhs) const
  {
    if (!(this->success == rhs.success))
      return false;
    return true;
  }
  bool operator != (const DB_CompactRange_result &rhs) const {
    return !(*this == rhs);
  }

  bool operator < (const DB_CompactRange_result & ) const;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);
  uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;

};

class DB_CompactRange_presult {
 public:

  static const uint64_t _reflection_id = 14927478234826947852U;
  static void _reflection_register(::apache::thrift::reflection::Schema&);

  virtual ~DB_CompactRange_presult() throw() {}

  Code* success;

  struct __isset {
    __isset() { __clear(); } 
    void __clear() {
      success = false;
    }
    bool success;
  } __isset;

  uint32_t read(apache::thrift::protocol::TProtocol* iprot);

};

class DBClient : virtual public DBIf, virtual public apache::thrift::TClientBase {
 public:
  DBClient(boost::shared_ptr<apache::thrift::protocol::TProtocol> prot) :
    checkSeqid_(true),
    nextSendSequenceId_(1),
    nextRecvSequenceId_(1),
    piprot_(prot),
    poprot_(prot) {
    iprot_ = prot.get();
    oprot_ = prot.get();
  }
  DBClient(boost::shared_ptr<apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr<apache::thrift::protocol::TProtocol> oprot) :
    checkSeqid_(true),
    nextSendSequenceId_(1),
    nextRecvSequenceId_(1),
    piprot_(iprot),
    poprot_(oprot) {
    iprot_ = iprot.get();
    oprot_ = oprot.get();
  }
  boost::shared_ptr<apache::thrift::protocol::TProtocol> getInputProtocol() {
    return piprot_;
  }
  boost::shared_ptr<apache::thrift::protocol::TProtocol> getOutputProtocol() {
    return poprot_;
  }
  void Open(DBHandle& _return, const Text& dbname, const DBOptions& dboptions);
  void send_Open(const Text& dbname, const DBOptions& dboptions);
  void recv_Open(DBHandle& _return);
  Code Close(const DBHandle& dbhandle, const Text& dbname);
  void send_Close(const DBHandle& dbhandle, const Text& dbname);
  Code recv_Close();
  Code Put(const DBHandle& dbhandle, const kv& keyvalue, const WriteOptions& options);
  void send_Put(const DBHandle& dbhandle, const kv& keyvalue, const WriteOptions& options);
  Code recv_Put();
  Code Delete(const DBHandle& dbhandle, const Slice& key, const WriteOptions& options);
  void send_Delete(const DBHandle& dbhandle, const Slice& key, const WriteOptions& options);
  Code recv_Delete();
  Code Write(const DBHandle& dbhandle, const std::vector<kv> & batch, const WriteOptions& options);
  void send_Write(const DBHandle& dbhandle, const std::vector<kv> & batch, const WriteOptions& options);
  Code recv_Write();
  void Get(ResultItem& _return, const DBHandle& dbhandle, const Slice& inputkey, const ReadOptions& options);
  void send_Get(const DBHandle& dbhandle, const Slice& inputkey, const ReadOptions& options);
  void recv_Get(ResultItem& _return);
  void NewIterator(ResultIterator& _return, const DBHandle& dbhandle, const ReadOptions& options, IteratorType iteratorType, const Slice& target);
  void send_NewIterator(const DBHandle& dbhandle, const ReadOptions& options, IteratorType iteratorType, const Slice& target);
  void recv_NewIterator(ResultIterator& _return);
  Code DeleteIterator(const DBHandle& dbhandle, const Iterator& iterator);
  void send_DeleteIterator(const DBHandle& dbhandle, const Iterator& iterator);
  Code recv_DeleteIterator();
  void GetNext(ResultPair& _return, const DBHandle& dbhandle, const Iterator& iterator);
  void send_GetNext(const DBHandle& dbhandle, const Iterator& iterator);
  void recv_GetNext(ResultPair& _return);
  void GetPrev(ResultPair& _return, const DBHandle& dbhandle, const Iterator& iterator);
  void send_GetPrev(const DBHandle& dbhandle, const Iterator& iterator);
  void recv_GetPrev(ResultPair& _return);
  void GetSnapshot(ResultSnapshot& _return, const DBHandle& dbhandle);
  void send_GetSnapshot(const DBHandle& dbhandle);
  void recv_GetSnapshot(ResultSnapshot& _return);
  Code ReleaseSnapshot(const DBHandle& dbhandle, const Snapshot& snapshot);
  void send_ReleaseSnapshot(const DBHandle& dbhandle, const Snapshot& snapshot);
  Code recv_ReleaseSnapshot();
  Code CompactRange(const DBHandle& dbhandle, const Slice& start, const Slice& endhere);
  void send_CompactRange(const DBHandle& dbhandle, const Slice& start, const Slice& endhere);
  Code recv_CompactRange();

  /**
   * Disable checking the seqid field in server responses.
   *
   * This should only be used with broken servers that return incorrect seqid values.
   */
  void _disableSequenceIdChecks() {
    checkSeqid_ = false;
  }

 protected:
  bool checkSeqid_;
  int32_t nextSendSequenceId_;
  int32_t nextRecvSequenceId_;
  int32_t getNextSendSequenceId();
  int32_t getNextRecvSequenceId();
  boost::shared_ptr<apache::thrift::protocol::TProtocol> piprot_;
  boost::shared_ptr<apache::thrift::protocol::TProtocol> poprot_;
  apache::thrift::protocol::TProtocol* iprot_;
  apache::thrift::protocol::TProtocol* oprot_;
};

class DBProcessor : public ::apache::thrift::TDispatchProcessor {
 protected:
  boost::shared_ptr<DBIf> iface_;
  virtual bool dispatchCall(apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, apache::thrift::server::TConnectionContext* connectionContext);
 private:
  typedef  void (DBProcessor::*ProcessFunction)(int32_t, apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*, apache::thrift::server::TConnectionContext*);
  typedef std::map<std::string, ProcessFunction> ProcessMap;
  ProcessMap processMap_;
  void process_Open(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_Close(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_Put(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_Delete(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_Write(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_Get(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_NewIterator(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_DeleteIterator(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_GetNext(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_GetPrev(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_GetSnapshot(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_ReleaseSnapshot(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
  void process_CompactRange(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, apache::thrift::server::TConnectionContext* connectionContext);
 public:
  DBProcessor(boost::shared_ptr<DBIf> iface) :
    iface_(iface) {
    processMap_["Open"] = &DBProcessor::process_Open;
    processMap_["Close"] = &DBProcessor::process_Close;
    processMap_["Put"] = &DBProcessor::process_Put;
    processMap_["Delete"] = &DBProcessor::process_Delete;
    processMap_["Write"] = &DBProcessor::process_Write;
    processMap_["Get"] = &DBProcessor::process_Get;
    processMap_["NewIterator"] = &DBProcessor::process_NewIterator;
    processMap_["DeleteIterator"] = &DBProcessor::process_DeleteIterator;
    processMap_["GetNext"] = &DBProcessor::process_GetNext;
    processMap_["GetPrev"] = &DBProcessor::process_GetPrev;
    processMap_["GetSnapshot"] = &DBProcessor::process_GetSnapshot;
    processMap_["ReleaseSnapshot"] = &DBProcessor::process_ReleaseSnapshot;
    processMap_["CompactRange"] = &DBProcessor::process_CompactRange;
  }

  virtual ~DBProcessor() {}

  boost::shared_ptr<std::set<std::string> > getProcessFunctions() { 
    boost::shared_ptr<std::set<std::string> > rSet(new std::set<std::string>());
    rSet->insert("DB.Open");
    rSet->insert("DB.Close");
    rSet->insert("DB.Put");
    rSet->insert("DB.Delete");
    rSet->insert("DB.Write");
    rSet->insert("DB.Get");
    rSet->insert("DB.NewIterator");
    rSet->insert("DB.DeleteIterator");
    rSet->insert("DB.GetNext");
    rSet->insert("DB.GetPrev");
    rSet->insert("DB.GetSnapshot");
    rSet->insert("DB.ReleaseSnapshot");
    rSet->insert("DB.CompactRange");
    return rSet;
  }
};

class DBProcessorFactory : public ::apache::thrift::TProcessorFactory {
 public:
  DBProcessorFactory(const ::boost::shared_ptr< DBIfFactory >& handlerFactory) :
      handlerFactory_(handlerFactory) {}

  ::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(::apache::thrift::server::TConnectionContext* ctx);

 protected:
  ::boost::shared_ptr< DBIfFactory > handlerFactory_;
};

class DBMultiface : virtual public DBIf {
 public:
  DBMultiface(std::vector<boost::shared_ptr<DBIf> >& ifaces) : ifaces_(ifaces) {
  }
  virtual ~DBMultiface() {}
 protected:
  std::vector<boost::shared_ptr<DBIf> > ifaces_;
  DBMultiface() {}
  void add(boost::shared_ptr<DBIf> iface) {
    ifaces_.push_back(iface);
  }
 public:
  void Open(DBHandle& _return, const Text& dbname, const DBOptions& dboptions) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz; ++i) {
      ifaces_[i]->Open(_return, dbname, dboptions);
    }
  }

  Code Close(const DBHandle& dbhandle, const Text& dbname) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz - 1; ++i) {
      ifaces_[i]->Close(dbhandle, dbname);
    }
    return ifaces_[i]->Close(dbhandle, dbname);
  }

  Code Put(const DBHandle& dbhandle, const kv& keyvalue, const WriteOptions& options) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz - 1; ++i) {
      ifaces_[i]->Put(dbhandle, keyvalue, options);
    }
    return ifaces_[i]->Put(dbhandle, keyvalue, options);
  }

  Code Delete(const DBHandle& dbhandle, const Slice& key, const WriteOptions& options) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz - 1; ++i) {
      ifaces_[i]->Delete(dbhandle, key, options);
    }
    return ifaces_[i]->Delete(dbhandle, key, options);
  }

  Code Write(const DBHandle& dbhandle, const std::vector<kv> & batch, const WriteOptions& options) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz - 1; ++i) {
      ifaces_[i]->Write(dbhandle, batch, options);
    }
    return ifaces_[i]->Write(dbhandle, batch, options);
  }

  void Get(ResultItem& _return, const DBHandle& dbhandle, const Slice& inputkey, const ReadOptions& options) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz; ++i) {
      ifaces_[i]->Get(_return, dbhandle, inputkey, options);
    }
  }

  void NewIterator(ResultIterator& _return, const DBHandle& dbhandle, const ReadOptions& options, IteratorType iteratorType, const Slice& target) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz; ++i) {
      ifaces_[i]->NewIterator(_return, dbhandle, options, iteratorType, target);
    }
  }

  Code DeleteIterator(const DBHandle& dbhandle, const Iterator& iterator) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz - 1; ++i) {
      ifaces_[i]->DeleteIterator(dbhandle, iterator);
    }
    return ifaces_[i]->DeleteIterator(dbhandle, iterator);
  }

  void GetNext(ResultPair& _return, const DBHandle& dbhandle, const Iterator& iterator) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz; ++i) {
      ifaces_[i]->GetNext(_return, dbhandle, iterator);
    }
  }

  void GetPrev(ResultPair& _return, const DBHandle& dbhandle, const Iterator& iterator) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz; ++i) {
      ifaces_[i]->GetPrev(_return, dbhandle, iterator);
    }
  }

  void GetSnapshot(ResultSnapshot& _return, const DBHandle& dbhandle) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz; ++i) {
      ifaces_[i]->GetSnapshot(_return, dbhandle);
    }
  }

  Code ReleaseSnapshot(const DBHandle& dbhandle, const Snapshot& snapshot) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz - 1; ++i) {
      ifaces_[i]->ReleaseSnapshot(dbhandle, snapshot);
    }
    return ifaces_[i]->ReleaseSnapshot(dbhandle, snapshot);
  }

  Code CompactRange(const DBHandle& dbhandle, const Slice& start, const Slice& endhere) {
    uint32_t i;
    uint32_t sz = ifaces_.size();
    for (i = 0; i < sz - 1; ++i) {
      ifaces_[i]->CompactRange(dbhandle, start, endhere);
    }
    return ifaces_[i]->CompactRange(dbhandle, start, endhere);
  }

};

} // namespace

#endif