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


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:45