Goby3  3.1.4
2024.02.22
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< charserialize (const DataType &msg)
 Serialize Protobuf message (standard Protobuf encoding) More...
 
static std::string type_name (const DataType &d=DataType())
 Full protobuf Message name, including package (if one is defined). More...
 
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) More...
 

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 46 of file protobuf.h.

Member Function Documentation

◆ parse()

template<typename DataType >
template<typename CharIterator >
static 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 72 of file protobuf.h.

◆ serialize()

template<typename DataType >
static 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 51 of file protobuf.h.

◆ type_name()

template<typename DataType >
static 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 65 of file protobuf.h.


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