Goby3  3.1.4
2024.02.22
goby::middleware::SerializerParserHelper< google::protobuf::Message, MarshallingScheme::PROTOBUF > Struct Reference

Specialization for runtime introspection using google::protobuf::Message base class (works for publish and subscribe_type_regex only) More...

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

Static Public Member Functions

static std::vector< charserialize (const google::protobuf::Message &msg)
 Serialize Protobuf message (standard Protobuf encoding) More...
 
static std::string type_name (const google::protobuf::Message &d)
 Full protobuf name from message instantiation, including package (if one is defined). More...
 
static std::string type_name (const google::protobuf::Descriptor *desc)
 Full protobuf name from descriptor, including package (if one is defined). More...
 
template<typename CharIterator >
static std::shared_ptr< google::protobuf::Messageparse (CharIterator bytes_begin, CharIterator bytes_end, CharIterator &actual_end, const std::string &type, bool user_pool_first=false)
 Parse Protobuf message (using standard Protobuf decoding) given the Protobuf type name and assuming the message descriptor is loaded into dccl::DynamicProtobufManage. More...
 

Detailed Description

Specialization for runtime introspection using google::protobuf::Message base class (works for publish and subscribe_type_regex only)

Definition at line 84 of file protobuf.h.

Member Function Documentation

◆ parse()

template<typename CharIterator >
static std::shared_ptr<google::protobuf::Message> goby::middleware::SerializerParserHelper< google::protobuf::Message, MarshallingScheme::PROTOBUF >::parse ( CharIterator  bytes_begin,
CharIterator  bytes_end,
CharIterator &  actual_end,
const std::string &  type,
bool  user_pool_first = false 
)
inlinestatic

Parse Protobuf message (using standard Protobuf decoding) given the Protobuf type name and assuming the message descriptor is loaded into dccl::DynamicProtobufManage.

Template Parameters
CharIteratoran iterator to a container of bytes (char), e.g. std::vector<char>::iterator, or std::string::iterator
Parameters
bytes_beginIterator to the beginning of a container of bytes
bytes_endIterator to the end of a container of bytes
actual_endWill be set to the actual end of parsing.
Returns
Parsed Protobuf message

Definition at line 119 of file protobuf.h.

◆ serialize()

Serialize Protobuf message (standard Protobuf encoding)

Definition at line 87 of file protobuf.h.

◆ type_name() [1/2]

static std::string goby::middleware::SerializerParserHelper< google::protobuf::Message, MarshallingScheme::PROTOBUF >::type_name ( const google::protobuf::Descriptor *  desc)
inlinestatic

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

Parameters
descProtobuf descriptor

Definition at line 105 of file protobuf.h.

◆ type_name() [2/2]

Full protobuf name from message instantiation, including package (if one is defined).

Parameters
dProtobuf message

Definition at line 97 of file protobuf.h.


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