31 #include <boost/shared_ptr.hpp>
33 #include <rsc/runtime/TypeStringTools.h>
36 #include "rsb/rsbexports.h"
49 template<
typename ProtocolBuffer>
60 deserialize(
const std::string& wireType,
const std::string& wire);
65 template<
typename ProtocolBuffer>
67 Converter<std::string> (rsc::runtime::typeName<ProtocolBuffer>(),
72 template<
typename ProtocolBuffer>
76 template<
typename ProtocolBuffer>
79 assert(data.first == getDataType());
81 boost::shared_ptr<ProtocolBuffer> s = boost::static_pointer_cast<
82 ProtocolBuffer>(data.second);
83 s->SerializeToString(&wireData);
84 return getWireSchema();
87 template<
typename ProtocolBuffer>
89 const std::string& wireSchema,
const std::string& wireData) {
90 assert(wireSchema == getWireSchema());
92 boost::shared_ptr<ProtocolBuffer> result(
new ProtocolBuffer());
93 result->ParseFromString(wireData);
94 return std::make_pair(getDataType(), result);