Goby3 3.5.1
2026.06.04
Loading...
Searching...
No Matches
goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::PROTOBUF, std::enable_if_t<!std::is_same< DataType, google::protobuf::Message >::value > > Struct Template Reference

Specialization for fully qualified Protobuf message types (static), e.g. DataType == Foo for "message Foo". More...

#include <goby/middleware/marshalling/protobuf.h>

Static Public Member Functions

static std::vector< char > serialize (const DataType &msg)
 Serialize Protobuf message (standard Protobuf encoding).
static std::string type_name (const DataType &d=DataType())
 Full protobuf Message name, including package (if one is defined).
template<typename CharIterator>
static std::shared_ptr< DataType > parse (CharIterator bytes_begin, CharIterator bytes_end, CharIterator &actual_end, const std::string &type=type_name())
 Parse Protobuf message (using standard Protobuf decoding).

Detailed Description

template<typename DataType>
struct goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::PROTOBUF, std::enable_if_t<!std::is_same< DataType, google::protobuf::Message >::value > >

Specialization for fully qualified Protobuf message types (static), e.g. DataType == Foo for "message Foo".

Definition at line 47 of file protobuf.h.

Member Function Documentation

◆ parse()

template<typename DataType>
template<typename CharIterator>
std::shared_ptr< DataType > goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::PROTOBUF, std::enable_if_t<!std::is_same< DataType, google::protobuf::Message >::value > >::parse ( CharIterator bytes_begin,
CharIterator bytes_end,
CharIterator & actual_end,
const std::string & type = type_name() )
inlinestatic

Parse Protobuf message (using standard Protobuf decoding).

Definition at line 73 of file protobuf.h.

◆ serialize()

template<typename DataType>
std::vector< char > goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::PROTOBUF, std::enable_if_t<!std::is_same< DataType, google::protobuf::Message >::value > >::serialize ( const DataType & msg)
inlinestatic

Serialize Protobuf message (standard Protobuf encoding).

Definition at line 52 of file protobuf.h.

◆ type_name()

template<typename DataType>
std::string goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::PROTOBUF, std::enable_if_t<!std::is_same< DataType, google::protobuf::Message >::value > >::type_name ( const DataType & d = DataType())
inlinestatic

Full protobuf Message name, including package (if one is defined).

For example, returns "foo.Bar" for the following .proto:

package foo
message Bar { ... }

Definition at line 66 of file protobuf.h.


The documentation for this struct was generated from the following file: