Goby3  3.1.4
2024.02.22
goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL > Struct Template Reference

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

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

Inheritance diagram for goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL >:
goby::middleware::detail::DCCLSerializerParserHelperBase

Static Public Member Functions

static std::vector< charserialize (const DataType &msg)
 Serialize message using DCCL encoding. More...
 
static std::string type_name (const DataType &d=DataType())
 Full protobuf Message name (identical to Protobuf specialization) 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 one DCCL message. More...
 
static unsigned id ()
 Returns the DCCL ID. More...
 
static unsigned id (const google::protobuf::Message &d)
 
- 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

template<typename DataType>
struct goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL >

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

DCCL is defined as distinct from the PROTOBUF Marshalling scheme if the DataTYpe has the DCCLParameters enumeration, as output by the protoc-gen-dccl plugin to protoc. If this plugin isn't used when compiling your .proto files, DCCL types will be identified as Protobuf types.

Definition at line 44 of file dccl.h.

Member Function Documentation

◆ id() [1/2]

template<typename DataType >
static unsigned goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL >::id ( )
inlinestatic

Returns the DCCL ID.

This is the ID as defined in the protobuf message, e.g. 5 for

message Foo
{
option (dccl.msg).id = 5;
}

Definition at line 94 of file dccl.h.

◆ id() [2/2]

template<typename DataType >
static unsigned goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL >::id ( const google::protobuf::Message d)
inlinestatic

Definition at line 101 of file dccl.h.

◆ parse()

template<typename DataType >
template<typename CharIterator >
static std::shared_ptr<DataType> goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL >::parse ( CharIterator  bytes_begin,
CharIterator  bytes_end,
CharIterator &  actual_end,
const std::string &  type = type_name() 
)
inlinestatic

Parse one DCCL message.

If DCCL messages are concatentated, you can pass "actual_end" back into parse() as the new "bytes_begin" until it reaches "bytes_end"

Definition at line 74 of file dccl.h.

◆ serialize()

template<typename DataType >
static std::vector<char> goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL >::serialize ( const DataType &  msg)
inlinestatic

Serialize message using DCCL encoding.

Definition at line 49 of file dccl.h.

◆ type_name()

template<typename DataType >
static std::string goby::middleware::SerializerParserHelper< DataType, MarshallingScheme::DCCL >::type_name ( const DataType &  d = DataType())
inlinestatic

Full protobuf Message name (identical to Protobuf specialization)

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

package foo
message Bar { ... }

Definition at line 65 of file dccl.h.


The documentation for this struct was generated from the following file:
dccl
Definition: mm_driver.h:44