30 #include <boost/archive/text_oarchive.hpp> 31 #include <boost/archive/text_iarchive.hpp> 32 #include <boost/serialization/string.hpp> 33 #include <boost/serialization/vector.hpp> 41 std::vector<uint8_t> vec;
46 vec.resize(serial_size);
47 std::copy(buffer.get(), buffer.get() + serial_size, vec.begin());
55 uint32_t serial_size = vec.size();
56 std::vector<uint8_t> buffer(serial_size);
57 std::copy(vec.begin(), vec.begin() + serial_size, buffer.begin());
67 std::ostringstream archiveStream;
68 boost::archive::text_oarchive archive(archiveStream);
70 return archiveStream.str();
77 std::istringstream archiveStream(str);
78 boost::archive::text_iarchive archive(archiveStream);
T deserialize_ros(const std::vector< uint8_t > &vec)
std::string serialize_boost(T t)
T deserialize_boost(std::string str)
std::vector< uint8_t > serialize_ros(T t)
void serialize(Stream &stream, const T &t)
static void read(Stream &stream, typename boost::call_traits< T >::reference t)
uint32_t serializationLength(const T &t)