24 #ifndef GOBY_MIDDLEWARE_MARSHALLING_DETAIL_DCCL_SERIALIZER_PARSER_H
25 #define GOBY_MIDDLEWARE_MARSHALLING_DETAIL_DCCL_SERIALIZER_PARSER_H
32 #include <unordered_map>
35 #include <dccl/codec.h>
36 #include <dccl/dynamic_protobuf_manager.h>
55 class SerializerProtobufMetadata;
64 static std::unique_ptr<dccl::Codec> codec_;
90 const google::protobuf::Descriptor* desc_;
93 static std::unordered_map<const google::protobuf::Descriptor*, std::unique_ptr<LoaderBase>>
100 const auto* desc = DataType::descriptor();
106 static void check_load(
const google::protobuf::Descriptor* desc)
110 std::make_pair(desc, std::unique_ptr<LoaderBase>(
new LoaderDynamic(desc))));
117 codec_ = std::make_unique<dccl::Codec>();
123 codec_.reset(new_codec);
134 template <
typename CharIterator>
static unsigned id(CharIterator begin, CharIterator end)
137 return codec().id(begin, end);
140 static unsigned id(
const std::string& full_name)
143 auto* desc = dccl::DynamicProtobufManager::find_descriptor(full_name);
146 return codec().id(desc);
158 unpack(
const std::string& bytes);
163 codec().load_library(library);