30 #include <boost/cstdint.hpp>
36 using namespace boost;
41 const string Uint32Converter::WIRE_SCHEMA =
"uint32";
43 Uint32Converter::Uint32Converter() :
51 assert(data.first == this->getDataType());
53 boost::shared_ptr<uint32_t> number = boost::static_pointer_cast<uint32_t>(data.second);
55 for (uint32_t i = 0; i < 4; ++i) {
56 wire[i] = (
unsigned char) ((*number & (0xfful << (i * 8ul))) >> (i * 8ul));
64 assert(wire.size() == 4);
66 boost::shared_ptr<uint32_t> number(
new uint32_t(0));
67 for (uint32_t i = 0; i < 4; ++i) {
68 *number |= ((uint32_t) ((
unsigned char) wire[i]) << (i * 8ul));