Add intermediate layer. Ugh.
authorMarc Burns <m4burns@uwaterloo.ca>
Mon, 19 Nov 2012 23:46:18 +0000 (18:46 -0500)
committerMarc Burns <m4burns@uwaterloo.ca>
Mon, 19 Nov 2012 23:46:18 +0000 (18:46 -0500)
database/gen-cpp/PosBookie.cpp [new file with mode: 0644]
database/gen-cpp/PosBookie.h [new file with mode: 0644]
database/gen-cpp/PosBookie_server.skeleton.cpp [new file with mode: 0644]
database/gen-cpp/pos-bookie_constants.cpp [new file with mode: 0644]
database/gen-cpp/pos-bookie_constants.h [new file with mode: 0644]
database/gen-cpp/pos-bookie_types.cpp [new file with mode: 0644]
database/gen-cpp/pos-bookie_types.h [new file with mode: 0644]
database/pos-bookie.thrift [new file with mode: 0644]

diff --git a/database/gen-cpp/PosBookie.cpp b/database/gen-cpp/PosBookie.cpp
new file mode 100644 (file)
index 0000000..9bf8fc3
--- /dev/null
@@ -0,0 +1,1392 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+#include "PosBookie.h"
+
+namespace posbookie {
+
+uint32_t PosBookie_ping_args::read(::apache::thrift::protocol::TProtocol* 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;
+    }
+    xfer += iprot->skip(ftype);
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_ping_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_ping_args");
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_ping_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_ping_pargs");
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_ping_result::read(::apache::thrift::protocol::TProtocol* 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;
+    }
+    xfer += iprot->skip(ftype);
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_ping_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+  uint32_t xfer = 0;
+
+  xfer += oprot->writeStructBegin("PosBookie_ping_result");
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_ping_presult::read(::apache::thrift::protocol::TProtocol* 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;
+    }
+    xfer += iprot->skip(ftype);
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getSalt_args::read(::apache::thrift::protocol::TProtocol* 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;
+    }
+    xfer += iprot->skip(ftype);
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getSalt_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_getSalt_args");
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getSalt_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_getSalt_pargs");
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getSalt_result::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->success);
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getSalt_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+  uint32_t xfer = 0;
+
+  xfer += oprot->writeStructBegin("PosBookie_getSalt_result");
+
+  if (this->__isset.success) {
+    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_STRING, 0);
+    xfer += oprot->writeString(this->success);
+    xfer += oprot->writeFieldEnd();
+  }
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getSalt_presult::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString((*(this->success)));
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_purchaseItems_args::read(::apache::thrift::protocol::TProtocol* 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_STRING) {
+          xfer += iprot->readString(this->auth);
+          this->__isset.auth = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 2:
+        if (ftype == ::apache::thrift::protocol::T_STRING) {
+          xfer += iprot->readString(this->dataToHash);
+          this->__isset.dataToHash = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      case 3:
+        if (ftype == ::apache::thrift::protocol::T_LIST) {
+          {
+            this->upcs.clear();
+            uint32_t _size0;
+            ::apache::thrift::protocol::TType _etype3;
+            xfer += iprot->readListBegin(_etype3, _size0);
+            this->upcs.resize(_size0);
+            uint32_t _i4;
+            for (_i4 = 0; _i4 < _size0; ++_i4)
+            {
+              xfer += iprot->readI64(this->upcs[_i4]);
+            }
+            xfer += iprot->readListEnd();
+          }
+          this->__isset.upcs = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_purchaseItems_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_purchaseItems_args");
+
+  xfer += oprot->writeFieldBegin("auth", ::apache::thrift::protocol::T_STRING, 1);
+  xfer += oprot->writeString(this->auth);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("dataToHash", ::apache::thrift::protocol::T_STRING, 2);
+  xfer += oprot->writeString(this->dataToHash);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("upcs", ::apache::thrift::protocol::T_LIST, 3);
+  {
+    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast<uint32_t>(this->upcs.size()));
+    std::vector<int64_t> ::const_iterator _iter5;
+    for (_iter5 = this->upcs.begin(); _iter5 != this->upcs.end(); ++_iter5)
+    {
+      xfer += oprot->writeI64((*_iter5));
+    }
+    xfer += oprot->writeListEnd();
+  }
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_purchaseItems_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_purchaseItems_pargs");
+
+  xfer += oprot->writeFieldBegin("auth", ::apache::thrift::protocol::T_STRING, 1);
+  xfer += oprot->writeString((*(this->auth)));
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("dataToHash", ::apache::thrift::protocol::T_STRING, 2);
+  xfer += oprot->writeString((*(this->dataToHash)));
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldBegin("upcs", ::apache::thrift::protocol::T_LIST, 3);
+  {
+    xfer += oprot->writeListBegin(::apache::thrift::protocol::T_I64, static_cast<uint32_t>((*(this->upcs)).size()));
+    std::vector<int64_t> ::const_iterator _iter6;
+    for (_iter6 = (*(this->upcs)).begin(); _iter6 != (*(this->upcs)).end(); ++_iter6)
+    {
+      xfer += oprot->writeI64((*_iter6));
+    }
+    xfer += oprot->writeListEnd();
+  }
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_purchaseItems_result::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          int32_t ecast7;
+          xfer += iprot->readI32(ecast7);
+          this->success = (E_PURCHASE_STATUS::type)ecast7;
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_purchaseItems_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+  uint32_t xfer = 0;
+
+  xfer += oprot->writeStructBegin("PosBookie_purchaseItems_result");
+
+  if (this->__isset.success) {
+    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0);
+    xfer += oprot->writeI32((int32_t)this->success);
+    xfer += oprot->writeFieldEnd();
+  }
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_purchaseItems_presult::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          int32_t ecast8;
+          xfer += iprot->readI32(ecast8);
+          (*(this->success)) = (E_PURCHASE_STATUS::type)ecast8;
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getUPCPrice_args::read(::apache::thrift::protocol::TProtocol* 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_I64) {
+          xfer += iprot->readI64(this->upc);
+          this->__isset.upc = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getUPCPrice_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_getUPCPrice_args");
+
+  xfer += oprot->writeFieldBegin("upc", ::apache::thrift::protocol::T_I64, 1);
+  xfer += oprot->writeI64(this->upc);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getUPCPrice_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_getUPCPrice_pargs");
+
+  xfer += oprot->writeFieldBegin("upc", ::apache::thrift::protocol::T_I64, 1);
+  xfer += oprot->writeI64((*(this->upc)));
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getUPCPrice_result::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          xfer += iprot->readI32(this->success);
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getUPCPrice_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+  uint32_t xfer = 0;
+
+  xfer += oprot->writeStructBegin("PosBookie_getUPCPrice_result");
+
+  if (this->__isset.success) {
+    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0);
+    xfer += oprot->writeI32(this->success);
+    xfer += oprot->writeFieldEnd();
+  }
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getUPCPrice_presult::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          xfer += iprot->readI32((*(this->success)));
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getStock_args::read(::apache::thrift::protocol::TProtocol* 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_I64) {
+          xfer += iprot->readI64(this->upc);
+          this->__isset.upc = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getStock_args::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_getStock_args");
+
+  xfer += oprot->writeFieldBegin("upc", ::apache::thrift::protocol::T_I64, 1);
+  xfer += oprot->writeI64(this->upc);
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getStock_pargs::write(::apache::thrift::protocol::TProtocol* oprot) const {
+  uint32_t xfer = 0;
+  xfer += oprot->writeStructBegin("PosBookie_getStock_pargs");
+
+  xfer += oprot->writeFieldBegin("upc", ::apache::thrift::protocol::T_I64, 1);
+  xfer += oprot->writeI64((*(this->upc)));
+  xfer += oprot->writeFieldEnd();
+
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getStock_result::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          xfer += iprot->readI32(this->success);
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+uint32_t PosBookie_getStock_result::write(::apache::thrift::protocol::TProtocol* oprot) const {
+
+  uint32_t xfer = 0;
+
+  xfer += oprot->writeStructBegin("PosBookie_getStock_result");
+
+  if (this->__isset.success) {
+    xfer += oprot->writeFieldBegin("success", ::apache::thrift::protocol::T_I32, 0);
+    xfer += oprot->writeI32(this->success);
+    xfer += oprot->writeFieldEnd();
+  }
+  xfer += oprot->writeFieldStop();
+  xfer += oprot->writeStructEnd();
+  return xfer;
+}
+
+uint32_t PosBookie_getStock_presult::read(::apache::thrift::protocol::TProtocol* 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 0:
+        if (ftype == ::apache::thrift::protocol::T_I32) {
+          xfer += iprot->readI32((*(this->success)));
+          this->__isset.success = true;
+        } else {
+          xfer += iprot->skip(ftype);
+        }
+        break;
+      default:
+        xfer += iprot->skip(ftype);
+        break;
+    }
+    xfer += iprot->readFieldEnd();
+  }
+
+  xfer += iprot->readStructEnd();
+
+  return xfer;
+}
+
+void PosBookieClient::ping()
+{
+  send_ping();
+  recv_ping();
+}
+
+void PosBookieClient::send_ping()
+{
+  int32_t cseqid = 0;
+  oprot_->writeMessageBegin("ping", ::apache::thrift::protocol::T_CALL, cseqid);
+
+  PosBookie_ping_pargs args;
+  args.write(oprot_);
+
+  oprot_->writeMessageEnd();
+  oprot_->getTransport()->writeEnd();
+  oprot_->getTransport()->flush();
+}
+
+void PosBookieClient::recv_ping()
+{
+
+  int32_t rseqid = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TMessageType mtype;
+
+  iprot_->readMessageBegin(fname, mtype, rseqid);
+  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+    ::apache::thrift::TApplicationException x;
+    x.read(iprot_);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+    throw x;
+  }
+  if (mtype != ::apache::thrift::protocol::T_REPLY) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  if (fname.compare("ping") != 0) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  PosBookie_ping_presult result;
+  result.read(iprot_);
+  iprot_->readMessageEnd();
+  iprot_->getTransport()->readEnd();
+
+  return;
+}
+
+void PosBookieClient::getSalt(std::string& _return)
+{
+  send_getSalt();
+  recv_getSalt(_return);
+}
+
+void PosBookieClient::send_getSalt()
+{
+  int32_t cseqid = 0;
+  oprot_->writeMessageBegin("getSalt", ::apache::thrift::protocol::T_CALL, cseqid);
+
+  PosBookie_getSalt_pargs args;
+  args.write(oprot_);
+
+  oprot_->writeMessageEnd();
+  oprot_->getTransport()->writeEnd();
+  oprot_->getTransport()->flush();
+}
+
+void PosBookieClient::recv_getSalt(std::string& _return)
+{
+
+  int32_t rseqid = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TMessageType mtype;
+
+  iprot_->readMessageBegin(fname, mtype, rseqid);
+  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+    ::apache::thrift::TApplicationException x;
+    x.read(iprot_);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+    throw x;
+  }
+  if (mtype != ::apache::thrift::protocol::T_REPLY) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  if (fname.compare("getSalt") != 0) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  PosBookie_getSalt_presult result;
+  result.success = &_return;
+  result.read(iprot_);
+  iprot_->readMessageEnd();
+  iprot_->getTransport()->readEnd();
+
+  if (result.__isset.success) {
+    // _return pointer has now been filled
+    return;
+  }
+  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getSalt failed: unknown result");
+}
+
+E_PURCHASE_STATUS::type PosBookieClient::purchaseItems(const std::string& auth, const std::string& dataToHash, const std::vector<int64_t> & upcs)
+{
+  send_purchaseItems(auth, dataToHash, upcs);
+  return recv_purchaseItems();
+}
+
+void PosBookieClient::send_purchaseItems(const std::string& auth, const std::string& dataToHash, const std::vector<int64_t> & upcs)
+{
+  int32_t cseqid = 0;
+  oprot_->writeMessageBegin("purchaseItems", ::apache::thrift::protocol::T_CALL, cseqid);
+
+  PosBookie_purchaseItems_pargs args;
+  args.auth = &auth;
+  args.dataToHash = &dataToHash;
+  args.upcs = &upcs;
+  args.write(oprot_);
+
+  oprot_->writeMessageEnd();
+  oprot_->getTransport()->writeEnd();
+  oprot_->getTransport()->flush();
+}
+
+E_PURCHASE_STATUS::type PosBookieClient::recv_purchaseItems()
+{
+
+  int32_t rseqid = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TMessageType mtype;
+
+  iprot_->readMessageBegin(fname, mtype, rseqid);
+  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+    ::apache::thrift::TApplicationException x;
+    x.read(iprot_);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+    throw x;
+  }
+  if (mtype != ::apache::thrift::protocol::T_REPLY) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  if (fname.compare("purchaseItems") != 0) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  E_PURCHASE_STATUS::type _return;
+  PosBookie_purchaseItems_presult result;
+  result.success = &_return;
+  result.read(iprot_);
+  iprot_->readMessageEnd();
+  iprot_->getTransport()->readEnd();
+
+  if (result.__isset.success) {
+    return _return;
+  }
+  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "purchaseItems failed: unknown result");
+}
+
+int32_t PosBookieClient::getUPCPrice(const int64_t upc)
+{
+  send_getUPCPrice(upc);
+  return recv_getUPCPrice();
+}
+
+void PosBookieClient::send_getUPCPrice(const int64_t upc)
+{
+  int32_t cseqid = 0;
+  oprot_->writeMessageBegin("getUPCPrice", ::apache::thrift::protocol::T_CALL, cseqid);
+
+  PosBookie_getUPCPrice_pargs args;
+  args.upc = &upc;
+  args.write(oprot_);
+
+  oprot_->writeMessageEnd();
+  oprot_->getTransport()->writeEnd();
+  oprot_->getTransport()->flush();
+}
+
+int32_t PosBookieClient::recv_getUPCPrice()
+{
+
+  int32_t rseqid = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TMessageType mtype;
+
+  iprot_->readMessageBegin(fname, mtype, rseqid);
+  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+    ::apache::thrift::TApplicationException x;
+    x.read(iprot_);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+    throw x;
+  }
+  if (mtype != ::apache::thrift::protocol::T_REPLY) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  if (fname.compare("getUPCPrice") != 0) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  int32_t _return;
+  PosBookie_getUPCPrice_presult result;
+  result.success = &_return;
+  result.read(iprot_);
+  iprot_->readMessageEnd();
+  iprot_->getTransport()->readEnd();
+
+  if (result.__isset.success) {
+    return _return;
+  }
+  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getUPCPrice failed: unknown result");
+}
+
+int32_t PosBookieClient::getStock(const int64_t upc)
+{
+  send_getStock(upc);
+  return recv_getStock();
+}
+
+void PosBookieClient::send_getStock(const int64_t upc)
+{
+  int32_t cseqid = 0;
+  oprot_->writeMessageBegin("getStock", ::apache::thrift::protocol::T_CALL, cseqid);
+
+  PosBookie_getStock_pargs args;
+  args.upc = &upc;
+  args.write(oprot_);
+
+  oprot_->writeMessageEnd();
+  oprot_->getTransport()->writeEnd();
+  oprot_->getTransport()->flush();
+}
+
+int32_t PosBookieClient::recv_getStock()
+{
+
+  int32_t rseqid = 0;
+  std::string fname;
+  ::apache::thrift::protocol::TMessageType mtype;
+
+  iprot_->readMessageBegin(fname, mtype, rseqid);
+  if (mtype == ::apache::thrift::protocol::T_EXCEPTION) {
+    ::apache::thrift::TApplicationException x;
+    x.read(iprot_);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+    throw x;
+  }
+  if (mtype != ::apache::thrift::protocol::T_REPLY) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  if (fname.compare("getStock") != 0) {
+    iprot_->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot_->readMessageEnd();
+    iprot_->getTransport()->readEnd();
+  }
+  int32_t _return;
+  PosBookie_getStock_presult result;
+  result.success = &_return;
+  result.read(iprot_);
+  iprot_->readMessageEnd();
+  iprot_->getTransport()->readEnd();
+
+  if (result.__isset.success) {
+    return _return;
+  }
+  throw ::apache::thrift::TApplicationException(::apache::thrift::TApplicationException::MISSING_RESULT, "getStock failed: unknown result");
+}
+
+bool PosBookieProcessor::dispatchCall(::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, const std::string& fname, int32_t seqid, void* callContext) {
+  ProcessMap::iterator pfn;
+  pfn = processMap_.find(fname);
+  if (pfn == processMap_.end()) {
+    iprot->skip(::apache::thrift::protocol::T_STRUCT);
+    iprot->readMessageEnd();
+    iprot->getTransport()->readEnd();
+    ::apache::thrift::TApplicationException x(::apache::thrift::TApplicationException::UNKNOWN_METHOD, "Invalid method name: '"+fname+"'");
+    oprot->writeMessageBegin(fname, ::apache::thrift::protocol::T_EXCEPTION, seqid);
+    x.write(oprot);
+    oprot->writeMessageEnd();
+    oprot->getTransport()->writeEnd();
+    oprot->getTransport()->flush();
+    return true;
+  }
+  (this->*(pfn->second))(seqid, iprot, oprot, callContext);
+  return true;
+}
+
+void PosBookieProcessor::process_ping(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+  void* ctx = NULL;
+  if (this->eventHandler_.get() != NULL) {
+    ctx = this->eventHandler_->getContext("PosBookie.ping", callContext);
+  }
+  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "PosBookie.ping");
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preRead(ctx, "PosBookie.ping");
+  }
+
+  PosBookie_ping_args args;
+  args.read(iprot);
+  iprot->readMessageEnd();
+  uint32_t bytes = iprot->getTransport()->readEnd();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postRead(ctx, "PosBookie.ping", bytes);
+  }
+
+  PosBookie_ping_result result;
+  try {
+    iface_->ping();
+  } catch (const std::exception& e) {
+    if (this->eventHandler_.get() != NULL) {
+      this->eventHandler_->handlerError(ctx, "PosBookie.ping");
+    }
+
+    ::apache::thrift::TApplicationException x(e.what());
+    oprot->writeMessageBegin("ping", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+    x.write(oprot);
+    oprot->writeMessageEnd();
+    oprot->getTransport()->writeEnd();
+    oprot->getTransport()->flush();
+    return;
+  }
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preWrite(ctx, "PosBookie.ping");
+  }
+
+  oprot->writeMessageBegin("ping", ::apache::thrift::protocol::T_REPLY, seqid);
+  result.write(oprot);
+  oprot->writeMessageEnd();
+  bytes = oprot->getTransport()->writeEnd();
+  oprot->getTransport()->flush();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postWrite(ctx, "PosBookie.ping", bytes);
+  }
+}
+
+void PosBookieProcessor::process_getSalt(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+  void* ctx = NULL;
+  if (this->eventHandler_.get() != NULL) {
+    ctx = this->eventHandler_->getContext("PosBookie.getSalt", callContext);
+  }
+  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "PosBookie.getSalt");
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preRead(ctx, "PosBookie.getSalt");
+  }
+
+  PosBookie_getSalt_args args;
+  args.read(iprot);
+  iprot->readMessageEnd();
+  uint32_t bytes = iprot->getTransport()->readEnd();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postRead(ctx, "PosBookie.getSalt", bytes);
+  }
+
+  PosBookie_getSalt_result result;
+  try {
+    iface_->getSalt(result.success);
+    result.__isset.success = true;
+  } catch (const std::exception& e) {
+    if (this->eventHandler_.get() != NULL) {
+      this->eventHandler_->handlerError(ctx, "PosBookie.getSalt");
+    }
+
+    ::apache::thrift::TApplicationException x(e.what());
+    oprot->writeMessageBegin("getSalt", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+    x.write(oprot);
+    oprot->writeMessageEnd();
+    oprot->getTransport()->writeEnd();
+    oprot->getTransport()->flush();
+    return;
+  }
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preWrite(ctx, "PosBookie.getSalt");
+  }
+
+  oprot->writeMessageBegin("getSalt", ::apache::thrift::protocol::T_REPLY, seqid);
+  result.write(oprot);
+  oprot->writeMessageEnd();
+  bytes = oprot->getTransport()->writeEnd();
+  oprot->getTransport()->flush();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postWrite(ctx, "PosBookie.getSalt", bytes);
+  }
+}
+
+void PosBookieProcessor::process_purchaseItems(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+  void* ctx = NULL;
+  if (this->eventHandler_.get() != NULL) {
+    ctx = this->eventHandler_->getContext("PosBookie.purchaseItems", callContext);
+  }
+  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "PosBookie.purchaseItems");
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preRead(ctx, "PosBookie.purchaseItems");
+  }
+
+  PosBookie_purchaseItems_args args;
+  args.read(iprot);
+  iprot->readMessageEnd();
+  uint32_t bytes = iprot->getTransport()->readEnd();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postRead(ctx, "PosBookie.purchaseItems", bytes);
+  }
+
+  PosBookie_purchaseItems_result result;
+  try {
+    result.success = iface_->purchaseItems(args.auth, args.dataToHash, args.upcs);
+    result.__isset.success = true;
+  } catch (const std::exception& e) {
+    if (this->eventHandler_.get() != NULL) {
+      this->eventHandler_->handlerError(ctx, "PosBookie.purchaseItems");
+    }
+
+    ::apache::thrift::TApplicationException x(e.what());
+    oprot->writeMessageBegin("purchaseItems", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+    x.write(oprot);
+    oprot->writeMessageEnd();
+    oprot->getTransport()->writeEnd();
+    oprot->getTransport()->flush();
+    return;
+  }
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preWrite(ctx, "PosBookie.purchaseItems");
+  }
+
+  oprot->writeMessageBegin("purchaseItems", ::apache::thrift::protocol::T_REPLY, seqid);
+  result.write(oprot);
+  oprot->writeMessageEnd();
+  bytes = oprot->getTransport()->writeEnd();
+  oprot->getTransport()->flush();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postWrite(ctx, "PosBookie.purchaseItems", bytes);
+  }
+}
+
+void PosBookieProcessor::process_getUPCPrice(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+  void* ctx = NULL;
+  if (this->eventHandler_.get() != NULL) {
+    ctx = this->eventHandler_->getContext("PosBookie.getUPCPrice", callContext);
+  }
+  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "PosBookie.getUPCPrice");
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preRead(ctx, "PosBookie.getUPCPrice");
+  }
+
+  PosBookie_getUPCPrice_args args;
+  args.read(iprot);
+  iprot->readMessageEnd();
+  uint32_t bytes = iprot->getTransport()->readEnd();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postRead(ctx, "PosBookie.getUPCPrice", bytes);
+  }
+
+  PosBookie_getUPCPrice_result result;
+  try {
+    result.success = iface_->getUPCPrice(args.upc);
+    result.__isset.success = true;
+  } catch (const std::exception& e) {
+    if (this->eventHandler_.get() != NULL) {
+      this->eventHandler_->handlerError(ctx, "PosBookie.getUPCPrice");
+    }
+
+    ::apache::thrift::TApplicationException x(e.what());
+    oprot->writeMessageBegin("getUPCPrice", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+    x.write(oprot);
+    oprot->writeMessageEnd();
+    oprot->getTransport()->writeEnd();
+    oprot->getTransport()->flush();
+    return;
+  }
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preWrite(ctx, "PosBookie.getUPCPrice");
+  }
+
+  oprot->writeMessageBegin("getUPCPrice", ::apache::thrift::protocol::T_REPLY, seqid);
+  result.write(oprot);
+  oprot->writeMessageEnd();
+  bytes = oprot->getTransport()->writeEnd();
+  oprot->getTransport()->flush();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postWrite(ctx, "PosBookie.getUPCPrice", bytes);
+  }
+}
+
+void PosBookieProcessor::process_getStock(int32_t seqid, ::apache::thrift::protocol::TProtocol* iprot, ::apache::thrift::protocol::TProtocol* oprot, void* callContext)
+{
+  void* ctx = NULL;
+  if (this->eventHandler_.get() != NULL) {
+    ctx = this->eventHandler_->getContext("PosBookie.getStock", callContext);
+  }
+  ::apache::thrift::TProcessorContextFreer freer(this->eventHandler_.get(), ctx, "PosBookie.getStock");
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preRead(ctx, "PosBookie.getStock");
+  }
+
+  PosBookie_getStock_args args;
+  args.read(iprot);
+  iprot->readMessageEnd();
+  uint32_t bytes = iprot->getTransport()->readEnd();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postRead(ctx, "PosBookie.getStock", bytes);
+  }
+
+  PosBookie_getStock_result result;
+  try {
+    result.success = iface_->getStock(args.upc);
+    result.__isset.success = true;
+  } catch (const std::exception& e) {
+    if (this->eventHandler_.get() != NULL) {
+      this->eventHandler_->handlerError(ctx, "PosBookie.getStock");
+    }
+
+    ::apache::thrift::TApplicationException x(e.what());
+    oprot->writeMessageBegin("getStock", ::apache::thrift::protocol::T_EXCEPTION, seqid);
+    x.write(oprot);
+    oprot->writeMessageEnd();
+    oprot->getTransport()->writeEnd();
+    oprot->getTransport()->flush();
+    return;
+  }
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->preWrite(ctx, "PosBookie.getStock");
+  }
+
+  oprot->writeMessageBegin("getStock", ::apache::thrift::protocol::T_REPLY, seqid);
+  result.write(oprot);
+  oprot->writeMessageEnd();
+  bytes = oprot->getTransport()->writeEnd();
+  oprot->getTransport()->flush();
+
+  if (this->eventHandler_.get() != NULL) {
+    this->eventHandler_->postWrite(ctx, "PosBookie.getStock", bytes);
+  }
+}
+
+::boost::shared_ptr< ::apache::thrift::TProcessor > PosBookieProcessorFactory::getProcessor(const ::apache::thrift::TConnectionInfo& connInfo) {
+  ::apache::thrift::ReleaseHandler< PosBookieIfFactory > cleanup(handlerFactory_);
+  ::boost::shared_ptr< PosBookieIf > handler(handlerFactory_->getHandler(connInfo), cleanup);
+  ::boost::shared_ptr< ::apache::thrift::TProcessor > processor(new PosBookieProcessor(handler));
+  return processor;
+}
+} // namespace
+
diff --git a/database/gen-cpp/PosBookie.h b/database/gen-cpp/PosBookie.h
new file mode 100644 (file)
index 0000000..46bc2be
--- /dev/null
@@ -0,0 +1,723 @@
+/**
+ * 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 "pos-bookie_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
diff --git a/database/gen-cpp/PosBookie_server.skeleton.cpp b/database/gen-cpp/PosBookie_server.skeleton.cpp
new file mode 100644 (file)
index 0000000..042e916
--- /dev/null
@@ -0,0 +1,64 @@
+// This autogenerated skeleton file illustrates how to build a server.
+// You should copy it to another filename to avoid overwriting it.
+
+#include "PosBookie.h"
+#include <thrift/protocol/TBinaryProtocol.h>
+#include <thrift/server/TSimpleServer.h>
+#include <thrift/transport/TServerSocket.h>
+#include <thrift/transport/TBufferTransports.h>
+
+using namespace ::apache::thrift;
+using namespace ::apache::thrift::protocol;
+using namespace ::apache::thrift::transport;
+using namespace ::apache::thrift::server;
+
+using boost::shared_ptr;
+
+using namespace  ::posbookie;
+
+class PosBookieHandler : virtual public PosBookieIf {
+ public:
+  PosBookieHandler() {
+    // Your initialization goes here
+  }
+
+  void ping() {
+    // Your implementation goes here
+    printf("ping\n");
+  }
+
+  void getSalt(std::string& _return) {
+    // Your implementation goes here
+    printf("getSalt\n");
+  }
+
+  E_PURCHASE_STATUS::type purchaseItems(const std::string& auth, const std::string& dataToHash, const std::vector<int64_t> & upcs) {
+    // Your implementation goes here
+    printf("purchaseItems\n");
+  }
+
+  int32_t getUPCPrice(const int64_t upc) {
+    // Your implementation goes here
+    printf("getUPCPrice\n");
+  }
+
+  int32_t getStock(const int64_t upc) {
+    // Your implementation goes here
+    printf("getStock\n");
+  }
+
+};
+
+int main(int argc, char **argv) {
+  int port = 9090;
+  shared_ptr<PosBookieHandler> handler(new PosBookieHandler());
+  shared_ptr<TProcessor> processor(new PosBookieProcessor(handler));
+  shared_ptr<TServerTransport> serverTransport(new TServerSocket(port));
+  shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
+  shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
+
+  TSimpleServer server(processor, serverTransport, transportFactory, protocolFactory);
+  server.serve();
+  return 0;
+}
+
diff --git a/database/gen-cpp/pos-bookie_constants.cpp b/database/gen-cpp/pos-bookie_constants.cpp
new file mode 100644 (file)
index 0000000..97f75c5
--- /dev/null
@@ -0,0 +1,17 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+#include "pos-bookie_constants.h"
+
+namespace posbookie {
+
+const pos-bookieConstants g_pos-bookie_constants;
+
+pos-bookieConstants::pos-bookieConstants() {
+}
+
+} // namespace
+
diff --git a/database/gen-cpp/pos-bookie_constants.h b/database/gen-cpp/pos-bookie_constants.h
new file mode 100644 (file)
index 0000000..6d16960
--- /dev/null
@@ -0,0 +1,24 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+#ifndef pos-bookie_CONSTANTS_H
+#define pos-bookie_CONSTANTS_H
+
+#include "pos-bookie_types.h"
+
+namespace posbookie {
+
+class pos-bookieConstants {
+ public:
+  pos-bookieConstants();
+
+};
+
+extern const pos-bookieConstants g_pos-bookie_constants;
+
+} // namespace
+
+#endif
diff --git a/database/gen-cpp/pos-bookie_types.cpp b/database/gen-cpp/pos-bookie_types.cpp
new file mode 100644 (file)
index 0000000..308ca59
--- /dev/null
@@ -0,0 +1,25 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+#include "pos-bookie_types.h"
+
+#include <algorithm>
+
+namespace posbookie {
+
+int _kE_PURCHASE_STATUSValues[] = {
+  E_PURCHASE_STATUS::EPS_FAIL,
+  E_PURCHASE_STATUS::EPS_NOMONEY,
+  E_PURCHASE_STATUS::EPS_SUCCESS
+};
+const char* _kE_PURCHASE_STATUSNames[] = {
+  "EPS_FAIL",
+  "EPS_NOMONEY",
+  "EPS_SUCCESS"
+};
+const std::map<int, const char*> _E_PURCHASE_STATUS_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(3, _kE_PURCHASE_STATUSValues, _kE_PURCHASE_STATUSNames), ::apache::thrift::TEnumIterator(-1, NULL, NULL));
+
+} // namespace
diff --git a/database/gen-cpp/pos-bookie_types.h b/database/gen-cpp/pos-bookie_types.h
new file mode 100644 (file)
index 0000000..034794f
--- /dev/null
@@ -0,0 +1,31 @@
+/**
+ * Autogenerated by Thrift Compiler (0.9.0)
+ *
+ * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
+ *  @generated
+ */
+#ifndef pos-bookie_TYPES_H
+#define pos-bookie_TYPES_H
+
+#include <thrift/Thrift.h>
+#include <thrift/TApplicationException.h>
+#include <thrift/protocol/TProtocol.h>
+#include <thrift/transport/TTransport.h>
+
+
+
+namespace posbookie {
+
+struct E_PURCHASE_STATUS {
+  enum type {
+    EPS_FAIL = 0,
+    EPS_NOMONEY = 1,
+    EPS_SUCCESS = 2
+  };
+};
+
+extern const std::map<int, const char*> _E_PURCHASE_STATUS_VALUES_TO_NAMES;
+
+} // namespace
+
+#endif
diff --git a/database/pos-bookie.thrift b/database/pos-bookie.thrift
new file mode 100644 (file)
index 0000000..a985c68
--- /dev/null
@@ -0,0 +1,44 @@
+namespace cpp posbookie
+
+enum E_PURCHASE_STATUS { EPS_FAIL, EPS_NOMONEY, EPS_SUCCESS }
+
+service PosBookie {
+       void ping(),
+
+       string getSalt(),
+
+  E_PURCHASE_STATUS
+    purchaseItems(1:string auth, 2:string dataToHash, 3:list<i64> upcs),
+
+
+       i32 getUPCPrice(1:i64 upc),
+  i32 getStock(1:i64 upc)
+}
+
+/* POS interface :
+       i32 getAccountFromHash(1:string dataToHash),
+       list<string> getHashesFromAccountId(1:i32 account),
+       list<string> getHashesFromAccountName(1:string account),
+
+       i32 getHashAccountBalance(1:string dataToHash),
+       i32 getIdAccountBalance(1:i32 account),
+       i32 getNameAccountBalance(1:string account),
+
+       i64 associateHashWithId(1:string auth, 2:string dataToHash, 3:i32 account),
+       i64 associateHashWithName(1:string auth, 2:string dataToHash, 3:string account),
+       i64 deassociateHash(1:string auth, 2:string dataToHash),
+
+       i32 getUPCPrice(1:i64 upc),
+       i64 setUPCPrice(1:string auth, 2:i64 upc, 3:i32 price),
+
+       i64 doTransactionOnHash(1:string auth, 2:string dataToHash, 3:i32 delta),
+       i64 doTransactionOnId(1:string auth, 2:i32 account, 3:i32 delta),
+       i64 doTransactionOnName(1:string auth, 2:string account, 3:i32 delta),
+       i64 revertTransaction(1:string auth, 2:i64 serial),
+
+       i32 getStock(1:i64 upc),
+       i64 doStockChange(1:string auth, 2:i64 upc, 3:i32 delta),
+
+       list<string> toString()
+*/
+