25 #ifndef GOBY_MOOS_MOOS_SERIALIZER_H
26 #define GOBY_MOOS_MOOS_SERIALIZER_H
39 static void serialize(
const CMOOSMsg& const_msg, std::string* data)
42 CMOOSMsg
msg(const_msg);
44 int serialized_size =
msg.GetSizeInBytesWhenSerialised();
45 data->resize(serialized_size);
47 msg.Serialize(
reinterpret_cast<unsigned char*
>(&(*data)[0]), serialized_size);
48 data->resize(serialized_size);
51 static void parse(CMOOSMsg*
msg, std::string data)
53 msg->Serialize(
reinterpret_cast<unsigned char*
>(&data[0]), data.size(),
false);
static void serialize(const CMOOSMsg &const_msg, std::string *data)
static void parse(CMOOSMsg *msg, std::string data)
The global namespace for the Goby project.
extern ::PROTOBUF_NAMESPACE_ID::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions, ::PROTOBUF_NAMESPACE_ID::internal::MessageTypeTraits< ::goby::GobyMessageOptions >, 11, false > msg