31 #include <boost/cstdint.hpp>
32 #include <boost/lexical_cast.hpp>
38 using namespace boost;
43 const string Uint32Converter::WIRE_SCHEMA =
"uint32";
45 Uint32Converter::Uint32Converter() :
53 assert(data.first == this->getDataType());
55 boost::shared_ptr<uint32_t> number = boost::static_pointer_cast<uint32_t>(data.second);
57 for (uint32_t i = 0; i < 4; ++i) {
58 wire[i] = (
unsigned char) ((*number & (0xffull << (i * 8ull))) >> (i * 8ull));
66 assert(wire.size() == 4);
68 boost::shared_ptr<uint32_t> number(
new uint32_t(0));
69 for (uint32_t i = 0; i < 4; ++i) {
70 *number |= ((uint32_t) ((
unsigned char) wire[i]) << (i * 8ull));