Note: Goby version 1 (shown here) is now considered obsolete. Please use version 2 for new projects, and consider upgrading old projects.

Goby Underwater Autonomy Project  Series: 1.1, revision: 163, released on 2013-02-06 14:23:27 -0500
Functions
moos/libmoos_util/moos_protobuf_helpers.h File Reference

Helpers for MOOS applications for serializing and parsed Google Protocol buffers messages. More...

#include "google/protobuf/io/printer.h"
#include <google/protobuf/io/tokenizer.h>
#include "goby/util/liblogger/flex_ostream.h"
#include "goby/util/string.h"

Go to the source code of this file.

Functions

void serialize_for_moos (std::string *out, const google::protobuf::Message &msg)
 Converts the Google Protocol Buffers message `msg` into a suitable (human readable) string `out` for sending via MOOS.
void parse_for_moos (const std::string &in, google::protobuf::Message *msg)
 Parses the string `in` to Google Protocol Buffers message `msg`. All errors are written to the goby::util::glogger().
void from_moos_comma_equals_string_field (google::protobuf::Message *proto_msg, const google::protobuf::FieldDescriptor *field_desc, const std::vector< std::string > &values, int value_key=0)
void from_moos_comma_equals_string (google::protobuf::Message *proto_msg, const std::string &in)
std::string to_moos_comma_equals_string_field (const google::protobuf::Message &proto_msg, const google::protobuf::FieldDescriptor *field_desc, bool write_key=true)
void to_moos_comma_equals_string (const google::protobuf::Message &proto_msg, std::string *out)

Detailed Description

Helpers for MOOS applications for serializing and parsed Google Protocol buffers messages.

Definition in file moos_protobuf_helpers.h.


Function Documentation

void parse_for_moos ( const std::string &  in,
google::protobuf::Message *  msg 
) [inline]

Parses the string `in` to Google Protocol Buffers message `msg`. All errors are written to the goby::util::glogger().

Parameters:
instd::string to parse
msgGoogle Protocol buffers message to store result

Definition at line 44 of file moos_protobuf_helpers.h.

void serialize_for_moos ( std::string *  out,
const google::protobuf::Message &  msg 
) [inline]

Converts the Google Protocol Buffers message `msg` into a suitable (human readable) string `out` for sending via MOOS.

Parameters:
outpointer to std::string to store serialized result
msgGoogle Protocol buffers message to serialize

Definition at line 32 of file moos_protobuf_helpers.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends