32 #include <boost/cstdint.hpp>
33 #include <boost/lexical_cast.hpp>
39 using namespace boost;
44 const string Uint64Converter::WIRE_SCHEMA =
"uint64";
46 Uint64Converter::Uint64Converter() :
54 assert(data.first == this->getDataType());
56 boost::shared_ptr<uint64_t> number = boost::static_pointer_cast<uint64_t>(data.second);
58 for (uint64_t i = 0; i < 8; ++i) {
59 wire[i] = (
unsigned char) ((*number & (0xffull << (i * 8ull))) >> (i * 8ull));
67 assert(wire.size() == 8);
69 boost::shared_ptr<uint64_t> number(
new uint64_t(0));
70 for (uint64_t i = 0; i < 8; ++i) {
71 *number |= ((uint64_t) ((
unsigned char) wire[i]) << (i * 8ull));