pos/database/gen-cpp/PosBookie.h

724 lines
18 KiB
C++

/**
* Autogenerated by Thrift Compiler (0.9.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
#ifndef PosBookie_H
#define PosBookie_H
#include <thrift/TDispatchProcessor.h>
#include "posbookie_types.h"
namespace posbookie {
class PosBookieIf {
public:
virtual ~PosBookieIf() {}
virtual void ping() = 0;
virtual void getSalt(std::string& _return) = 0;
virtual E_PURCHASE_STATUS::type purchaseItems(const std::string& auth, const std::string& dataToHash, const std::vector<int64_t> & upcs) = 0;
virtual int32_t getUPCPrice(const int64_t upc) = 0;
virtual int32_t getStock(const int64_t upc) = 0;
};
class PosBookieIfFactory {
public:
typedef PosBookieIf Handler;
virtual ~PosBookieIfFactory() {}
virtual PosBookieIf* getHandler(const ::apache::thrift::TConnectionInfo& connInfo) = 0;
virtual void releaseHandler(PosBookieIf* /* handler */) = 0;
};
class PosBookieIfSingletonFactory : virtual public PosBookieIfFactory {
public:
PosBookieIfSingletonFactory(const boost::shared_ptr<PosBookieIf>& iface) : iface_(iface) {}
virtual ~PosBookieIfSingletonFactory() {}
virtual PosBookieIf* getHandler(const ::apache::thrift::TConnectionInfo&) {
return iface_.get();
}
virtual void releaseHandler(PosBookieIf* /* handler */) {}
protected:
boost::shared_ptr<PosBookieIf> iface_;
};
class PosBookieNull : virtual public PosBookieIf {
public:
virtual ~PosBookieNull() {}
void ping() {
return;
}
void getSalt(std::string& /* _return */) {
return;
}
E_PURCHASE_STATUS::type purchaseItems(const std::string& /* auth */, const std::string& /* dataToHash */, const std::vector<int64_t> & /* upcs */) {
E_PURCHASE_STATUS::type _return = (E_PURCHASE_STATUS::type)0;
return _return;
}
int32_t getUPCPrice(const int64_t /* upc */) {
int32_t _return = 0;
return _return;
}
int32_t getStock(const int64_t /* upc */) {
int32_t _return = 0;
return _return;
}
};
class PosBookie_ping_args {
public:
PosBookie_ping_args() {
}
virtual ~PosBookie_ping_args() throw() {}
bool operator == (const PosBookie_ping_args & /* rhs */) const
{
return true;
}
bool operator != (const PosBookie_ping_args &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_ping_args & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
class PosBookie_ping_pargs {
public:
virtual ~PosBookie_ping_pargs() throw() {}
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
class PosBookie_ping_result {
public:
PosBookie_ping_result() {
}
virtual ~PosBookie_ping_result() throw() {}
bool operator == (const PosBookie_ping_result & /* rhs */) const
{
return true;
}
bool operator != (const PosBookie_ping_result &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_ping_result & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
class PosBookie_ping_presult {
public:
virtual ~PosBookie_ping_presult() throw() {}
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
};
class PosBookie_getSalt_args {
public:
PosBookie_getSalt_args() {
}
virtual ~PosBookie_getSalt_args() throw() {}
bool operator == (const PosBookie_getSalt_args & /* rhs */) const
{
return true;
}
bool operator != (const PosBookie_getSalt_args &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_getSalt_args & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
class PosBookie_getSalt_pargs {
public:
virtual ~PosBookie_getSalt_pargs() throw() {}
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_getSalt_result__isset {
_PosBookie_getSalt_result__isset() : success(false) {}
bool success;
} _PosBookie_getSalt_result__isset;
class PosBookie_getSalt_result {
public:
PosBookie_getSalt_result() : success() {
}
virtual ~PosBookie_getSalt_result() throw() {}
std::string success;
_PosBookie_getSalt_result__isset __isset;
void __set_success(const std::string& val) {
success = val;
}
bool operator == (const PosBookie_getSalt_result & rhs) const
{
if (!(success == rhs.success))
return false;
return true;
}
bool operator != (const PosBookie_getSalt_result &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_getSalt_result & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_getSalt_presult__isset {
_PosBookie_getSalt_presult__isset() : success(false) {}
bool success;
} _PosBookie_getSalt_presult__isset;
class PosBookie_getSalt_presult {
public:
virtual ~PosBookie_getSalt_presult() throw() {}
std::string* success;
_PosBookie_getSalt_presult__isset __isset;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
};
typedef struct _PosBookie_purchaseItems_args__isset {
_PosBookie_purchaseItems_args__isset() : auth(false), dataToHash(false), upcs(false) {}
bool auth;
bool dataToHash;
bool upcs;
} _PosBookie_purchaseItems_args__isset;
class PosBookie_purchaseItems_args {
public:
PosBookie_purchaseItems_args() : auth(), dataToHash() {
}
virtual ~PosBookie_purchaseItems_args() throw() {}
std::string auth;
std::string dataToHash;
std::vector<int64_t> upcs;
_PosBookie_purchaseItems_args__isset __isset;
void __set_auth(const std::string& val) {
auth = val;
}
void __set_dataToHash(const std::string& val) {
dataToHash = val;
}
void __set_upcs(const std::vector<int64_t> & val) {
upcs = val;
}
bool operator == (const PosBookie_purchaseItems_args & rhs) const
{
if (!(auth == rhs.auth))
return false;
if (!(dataToHash == rhs.dataToHash))
return false;
if (!(upcs == rhs.upcs))
return false;
return true;
}
bool operator != (const PosBookie_purchaseItems_args &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_purchaseItems_args & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
class PosBookie_purchaseItems_pargs {
public:
virtual ~PosBookie_purchaseItems_pargs() throw() {}
const std::string* auth;
const std::string* dataToHash;
const std::vector<int64_t> * upcs;
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_purchaseItems_result__isset {
_PosBookie_purchaseItems_result__isset() : success(false) {}
bool success;
} _PosBookie_purchaseItems_result__isset;
class PosBookie_purchaseItems_result {
public:
PosBookie_purchaseItems_result() : success((E_PURCHASE_STATUS::type)0) {
}
virtual ~PosBookie_purchaseItems_result() throw() {}
E_PURCHASE_STATUS::type success;
_PosBookie_purchaseItems_result__isset __isset;
void __set_success(const E_PURCHASE_STATUS::type val) {
success = val;
}
bool operator == (const PosBookie_purchaseItems_result & rhs) const
{
if (!(success == rhs.success))
return false;
return true;
}
bool operator != (const PosBookie_purchaseItems_result &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_purchaseItems_result & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_purchaseItems_presult__isset {
_PosBookie_purchaseItems_presult__isset() : success(false) {}
bool success;
} _PosBookie_purchaseItems_presult__isset;
class PosBookie_purchaseItems_presult {
public:
virtual ~PosBookie_purchaseItems_presult() throw() {}
E_PURCHASE_STATUS::type* success;
_PosBookie_purchaseItems_presult__isset __isset;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
};
typedef struct _PosBookie_getUPCPrice_args__isset {
_PosBookie_getUPCPrice_args__isset() : upc(false) {}
bool upc;
} _PosBookie_getUPCPrice_args__isset;
class PosBookie_getUPCPrice_args {
public:
PosBookie_getUPCPrice_args() : upc(0) {
}
virtual ~PosBookie_getUPCPrice_args() throw() {}
int64_t upc;
_PosBookie_getUPCPrice_args__isset __isset;
void __set_upc(const int64_t val) {
upc = val;
}
bool operator == (const PosBookie_getUPCPrice_args & rhs) const
{
if (!(upc == rhs.upc))
return false;
return true;
}
bool operator != (const PosBookie_getUPCPrice_args &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_getUPCPrice_args & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
class PosBookie_getUPCPrice_pargs {
public:
virtual ~PosBookie_getUPCPrice_pargs() throw() {}
const int64_t* upc;
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_getUPCPrice_result__isset {
_PosBookie_getUPCPrice_result__isset() : success(false) {}
bool success;
} _PosBookie_getUPCPrice_result__isset;
class PosBookie_getUPCPrice_result {
public:
PosBookie_getUPCPrice_result() : success(0) {
}
virtual ~PosBookie_getUPCPrice_result() throw() {}
int32_t success;
_PosBookie_getUPCPrice_result__isset __isset;
void __set_success(const int32_t val) {
success = val;
}
bool operator == (const PosBookie_getUPCPrice_result & rhs) const
{
if (!(success == rhs.success))
return false;
return true;
}
bool operator != (const PosBookie_getUPCPrice_result &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_getUPCPrice_result & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_getUPCPrice_presult__isset {
_PosBookie_getUPCPrice_presult__isset() : success(false) {}
bool success;
} _PosBookie_getUPCPrice_presult__isset;
class PosBookie_getUPCPrice_presult {
public:
virtual ~PosBookie_getUPCPrice_presult() throw() {}
int32_t* success;
_PosBookie_getUPCPrice_presult__isset __isset;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
};
typedef struct _PosBookie_getStock_args__isset {
_PosBookie_getStock_args__isset() : upc(false) {}
bool upc;
} _PosBookie_getStock_args__isset;
class PosBookie_getStock_args {
public:
PosBookie_getStock_args() : upc(0) {
}
virtual ~PosBookie_getStock_args() throw() {}
int64_t upc;
_PosBookie_getStock_args__isset __isset;
void __set_upc(const int64_t val) {
upc = val;
}
bool operator == (const PosBookie_getStock_args & rhs) const
{
if (!(upc == rhs.upc))
return false;
return true;
}
bool operator != (const PosBookie_getStock_args &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_getStock_args & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
class PosBookie_getStock_pargs {
public:
virtual ~PosBookie_getStock_pargs() throw() {}
const int64_t* upc;
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_getStock_result__isset {
_PosBookie_getStock_result__isset() : success(false) {}
bool success;
} _PosBookie_getStock_result__isset;
class PosBookie_getStock_result {
public:
PosBookie_getStock_result() : success(0) {
}
virtual ~PosBookie_getStock_result() throw() {}
int32_t success;
_PosBookie_getStock_result__isset __isset;
void __set_success(const int32_t val) {
success = val;
}
bool operator == (const PosBookie_getStock_result & rhs) const
{
if (!(success == rhs.success))
return false;
return true;
}
bool operator != (const PosBookie_getStock_result &rhs) const {
return !(*this == rhs);
}
bool operator < (const PosBookie_getStock_result & ) const;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
uint32_t write(::apache::thrift::protocol::TProtocol* oprot) const;
};
typedef struct _PosBookie_getStock_presult__isset {
_PosBookie_getStock_presult__isset() : success(false) {}
bool success;
} _PosBookie_getStock_presult__isset;
class PosBookie_getStock_presult {
public:
virtual ~PosBookie_getStock_presult() throw() {}
int32_t* success;
_PosBookie_getStock_presult__isset __isset;
uint32_t read(::apache::thrift::protocol::TProtocol* iprot);
};
class PosBookieClient : virtual public PosBookieIf {
public:
PosBookieClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> prot) :
piprot_(prot),
poprot_(prot) {
iprot_ = prot.get();
oprot_ = prot.get();
}
PosBookieClient(boost::shared_ptr< ::apache::thrift::protocol::TProtocol> iprot, boost::shared_ptr< ::apache::thrift::protocol::TProtocol> oprot) :
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 ping();
void send_ping();
void recv_ping();
void getSalt(std::string& _return);
void send_getSalt();
void recv_getSalt(std::string& _return);
E_PURCHASE_STATUS::type purchaseItems(const std::string& auth, const std::string& dataToHash, const std::vector<int64_t> & upcs);
void send_purchaseItems(const std::string& auth, const std::string& dataToHash, const std::vector<int64_t> & upcs);
E_PURCHASE_STATUS::type recv_purchaseItems();
int32_t getUPCPrice(const int64_t upc);
void send_getUPCPrice(const int64_t upc);
int32_t recv_getUPCPrice();
int32_t getStock(const int64_t upc);
void send_getStock(const int64_t upc);
int32_t recv_getStock();
protected:
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 PosBookieProcessor : public ::apache::thrift::TDispatchProcessor {
protected:
boost::shared_ptr<PosBookieIf> iface_;
virtual bool dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext);
private:
typedef void (PosBookieProcessor::*ProcessFunction)(int32_t, ::apache::thrift::protocol::TProtocol*, ::apache::thrift::protocol::TProtocol*, void*);
typedef std::map<std::string, ProcessFunction> ProcessMap;
ProcessMap processMap_;
void process_ping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_getSalt(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_purchaseItems(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_getUPCPrice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
void process_getStock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext);
public:
PosBookieProcessor(boost::shared_ptr<PosBookieIf> iface) :
iface_(iface) {
processMap_["ping"] = &PosBookieProcessor::process_ping;
processMap_["getSalt"] = &PosBookieProcessor::process_getSalt;
processMap_["purchaseItems"] = &PosBookieProcessor::process_purchaseItems;
processMap_["getUPCPrice"] = &PosBookieProcessor::process_getUPCPrice;
processMap_["getStock"] = &PosBookieProcessor::process_getStock;
}
virtual ~PosBookieProcessor() {}
};
class PosBookieProcessorFactory : public ::apache::thrift::TProcessorFactory {
public:
PosBookieProcessorFactory(const ::boost::shared_ptr< PosBookieIfFactory >& handlerFactory) :
handlerFactory_(handlerFactory) {}
::boost::shared_ptr< ::apache::thrift::TProcessor > getProcessor(const ::apache::thrift::TConnectionInfo& connInfo);
protected:
::boost::shared_ptr< PosBookieIfFactory > handlerFactory_;
};
class PosBookieMultiface : virtual public PosBookieIf {
public:
PosBookieMultiface(std::vector<boost::shared_ptr<PosBookieIf> >& ifaces) : ifaces_(ifaces) {
}
virtual ~PosBookieMultiface() {}
protected:
std::vector<boost::shared_ptr<PosBookieIf> > ifaces_;
PosBookieMultiface() {}
void add(boost::shared_ptr<PosBookieIf> iface) {
ifaces_.push_back(iface);
}
public:
void ping() {
size_t sz = ifaces_.size();
size_t i = 0;
for (; i < (sz - 1); ++i) {
ifaces_[i]->ping();
}
ifaces_[i]->ping();
}
void getSalt(std::string& _return) {
size_t sz = ifaces_.size();
size_t i = 0;
for (; i < (sz - 1); ++i) {
ifaces_[i]->getSalt(_return);
}
ifaces_[i]->getSalt(_return);
return;
}
E_PURCHASE_STATUS::type purchaseItems(const std::string& auth, const std::string& dataToHash, const std::vector<int64_t> & upcs) {
size_t sz = ifaces_.size();
size_t i = 0;
for (; i < (sz - 1); ++i) {
ifaces_[i]->purchaseItems(auth, dataToHash, upcs);
}
return ifaces_[i]->purchaseItems(auth, dataToHash, upcs);
}
int32_t getUPCPrice(const int64_t upc) {
size_t sz = ifaces_.size();
size_t i = 0;
for (; i < (sz - 1); ++i) {
ifaces_[i]->getUPCPrice(upc);
}
return ifaces_[i]->getUPCPrice(upc);
}
int32_t getStock(const int64_t upc) {
size_t sz = ifaces_.size();
size_t i = 0;
for (; i < (sz - 1); ++i) {
ifaces_[i]->getStock(upc);
}
return ifaces_[i]->getStock(upc);
}
};
} // namespace
#endif