protobuf_factory.h
Go to the documentation of this file.
1 #ifndef PROTOBUF_FACTORY_H
2 #define PROTOBUF_FACTORY_H
3 
5 
6 #include "protobuf_parser.h"
7 #include "ui_protobuf_parser.h"
8 
10 {
11  Q_OBJECT
12  Q_PLUGIN_METADATA(IID "facontidavide.PlotJuggler3.ParserFactoryPlugin")
13  Q_INTERFACES(PJ::ParserFactoryPlugin)
14 
15 public:
17 
18  ~ParserFactoryProtobuf() override;
19 
20  const char* name() const override
21  {
22  return "ParserFactoryProtobuf";
23  }
24  const char* encoding() const override
25  {
26  return "protobuf";
27  }
28 
29  MessageParserPtr createParser(const std::string& topic_name,
30  const std::string& type_name,
31  const std::string& schema,
32  PlotDataMapRef& data) override;
33 
34  QWidget* optionsWidget() override
35  {
36  return _widget;
37  }
38 
39 protected:
40 
41  Ui::ProtobufLoader* ui;
42  QWidget* _widget;
43 
44  google::protobuf::compiler::DiskSourceTree _source_tree;
45  std::unique_ptr<google::protobuf::compiler::Importer> _importer;
46 
47  struct FileInfo
48  {
49  QString file_path;
50  QByteArray proto_text;
51  const google::protobuf::FileDescriptor* file_descriptor = nullptr;
52  std::map<QString,const google::protobuf::Descriptor*> descriptors;
53  };
55 
56  bool updateUI();
57 
58  void loadSettings();
59 
60  void saveSettings();
61 
62  void importFile(QString filename);
63 
64 private slots:
65 
66  void onIncludeDirectory();
67 
68  void onLoadFile();
69 
70  void onRemoveInclude();
71 
72  void onComboChanged(const QString &text);
73 };
74 
75 
76 #endif // PROTOBUF_FACTORY_H
MessageParserPtr createParser(const std::string &topic_name, const std::string &type_name, const std::string &schema, PlotDataMapRef &data) override
google::protobuf::compiler::DiskSourceTree _source_tree
std::shared_ptr< MessageParser > MessageParserPtr
const char * name() const override
Name of the plugin type, NOT the particular instance.
void importFile(QString filename)
std::string type_name(lua_State *L, type t)
Definition: sol.hpp:8079
std::unique_ptr< google::protobuf::compiler::Importer > _importer
const char * encoding() const override
QWidget * optionsWidget() override
optionsWidget pointer to a persistent widget used to set the plugin options .
std::map< QString, const google::protobuf::Descriptor * > descriptors
Ui::ProtobufLoader * ui
Definition: format.h:895
const google::protobuf::FileDescriptor * file_descriptor
void onComboChanged(const QString &text)


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