protobuf_parser.h
Go to the documentation of this file.
1 #pragma once
2 
3 
4 #include <QCheckBox>
5 #include <QDebug>
6 
7 #include <google/protobuf/descriptor.h>
8 #include <google/protobuf/dynamic_message.h>
9 #include <google/protobuf/reflection.h>
10 #include <google/protobuf/io/zero_copy_stream_impl.h>
11 #include <google/protobuf/compiler/parser.h>
12 
13 #include "error_collectors.h"
15 
16 using namespace PJ;
17 
19 {
20 public:
21  ProtobufParser(const std::string& topic_name,
22  const google::protobuf::Descriptor* descriptor,
24  : MessageParser(topic_name, data)
25  , _proto_pool(&_proto_database)
26  , _msg_descriptor(descriptor)
27  {
28  }
29 
30  ProtobufParser(const std::string& topic_name,
31  const std::string type_name,
32  const google::protobuf::FileDescriptorSet& descriptor_set,
34 
35  bool parseMessage(const MessageRef serialized_msg, double& timestamp) override;
36 
37 protected:
38 
39  google::protobuf::SimpleDescriptorDatabase _proto_database;
40  google::protobuf::DescriptorPool _proto_pool;
41 
42  google::protobuf::DynamicMessageFactory _msg_factory;
43  const google::protobuf::Descriptor* _msg_descriptor = nullptr;
44 
45 };
46 
47 
48 
ProtobufParser(const std::string &topic_name, const google::protobuf::Descriptor *descriptor, PlotDataMapRef &data)
google::protobuf::DynamicMessageFactory _msg_factory
std::string type_name(lua_State *L, type t)
Definition: sol.hpp:8079
google::protobuf::SimpleDescriptorDatabase _proto_database
google::protobuf::DescriptorPool _proto_pool
The MessageParser is the base class used to parse a message with a specific encoding+schema.
Definition: format.h:895


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Jun 19 2023 03:01:38