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

Specialization for runtime introspection of DCCL messages using google::protobuf::Message base class (works for publish and subscribe_regex only) More...

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

Inheritance diagram for goby::middleware::SerializerParserHelper< google::protobuf::Message, MarshallingScheme::DCCL >:
goby::middleware::detail::DCCLSerializerParserHelperBase

Static Public Member Functions

static std::vector< charserialize (const google::protobuf::Message &msg)
 Serialize DCCL/Protobuf message (using DCCL 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 DCCL/Protobuf message (using DCCL decoding) given the Protobuf type name and assuming the message descriptor is loaded into dccl::DynamicProtobufManage. More...
 
static unsigned id (const google::protobuf::Descriptor *desc)
 Returns the DCCL ID given a Protobuf Descriptor. More...
 
static unsigned id (const google::protobuf::Message &d)
 Returns the DCCL ID given an instantiated message. More...
 
- Static Public Member Functions inherited from goby::middleware::detail::DCCLSerializerParserHelperBase
template<typename CharIterator >
static unsigned id (CharIterator begin, CharIterator end)
 
static unsigned id (const std::string &full_name)
 
static void load_metadata (const goby::middleware::protobuf::SerializerProtobufMetadata &meta)
 
static goby::middleware::intervehicle::protobuf::DCCLForwardedData unpack (const std::string &bytes)
 
static void load_library (const std::string &library)
 
static void setup_dlog ()
 Enable dlog output to glog using same verbosity settings as glog. More...
 

Additional Inherited Members

- Public Member Functions inherited from goby::middleware::detail::DCCLSerializerParserHelperBase
 DCCLSerializerParserHelperBase ()=default
 
virtual ~DCCLSerializerParserHelperBase ()=default
 
- Static Public Attributes inherited from goby::middleware::detail::DCCLSerializerParserHelperBase
constexpr static int INVALID_DCCL_ID {0}
 
- Static Protected Member Functions inherited from goby::middleware::detail::DCCLSerializerParserHelperBase
template<typename DataType >
static void check_load ()
 
static void check_load (const google::protobuf::Descriptor *desc)
 
static dccl::Codec & codec ()
 
static dccl::Codec & set_codec (dccl::Codec *new_codec)
 
- Static Protected Attributes inherited from goby::middleware::detail::DCCLSerializerParserHelperBase
static std::mutex dccl_mutex_
 
static std::unordered_map< const google::protobuf::Descriptor *, std::unique_ptr< LoaderBase > > loader_map_
 
static std::set< std::string > loaded_proto_files_
 

Detailed Description

Specialization for runtime introspection of DCCL messages using google::protobuf::Message base class (works for publish and subscribe_regex only)

Definition at line 108 of file dccl.h.

Member Function Documentation

◆ id() [1/2]

static unsigned goby::middleware::SerializerParserHelper< google::protobuf::Message, MarshallingScheme::DCCL >::id ( const google::protobuf::Descriptor *  desc)
inlinestatic

Returns the DCCL ID given a Protobuf Descriptor.

Definition at line 161 of file dccl.h.

◆ id() [2/2]

Returns the DCCL ID given an instantiated message.

Definition at line 169 of file dccl.h.

◆ parse()

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

Parse DCCL/Protobuf message (using DCCL 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. Useful for concatenated messages as you can pass "actual_end" of one call into "bytes_begin" of the next
Returns
Parsed Protobuf message

Definition at line 147 of file dccl.h.

◆ serialize()

Serialize DCCL/Protobuf message (using DCCL encoding)

Definition at line 113 of file dccl.h.

◆ type_name() [1/2]

static std::string goby::middleware::SerializerParserHelper< google::protobuf::Message, MarshallingScheme::DCCL >::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 133 of file dccl.h.

◆ type_name() [2/2]

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

Parameters
dProtobuf message

Definition at line 125 of file dccl.h.


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