dataloader_base.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef DATALOAD_TEMPLATE_H
8 #define DATALOAD_TEMPLATE_H
9 
10 #include <QFile>
11 
12 #include <functional>
13 #include "PlotJuggler/plotdata.h"
14 #include "PlotJuggler/pj_plugin.h"
16 
17 namespace PJ
18 {
20 {
22  QString filename;
24  QString prefix;
26  QStringList selected_datasources;
28  QDomDocument plugin_config;
29 };
30 
38 {
39 public:
40  DataLoader() = default;
41 
42  virtual ~DataLoader() = default;
43 
45  virtual const std::vector<const char*>& compatibleFileExtensions() const = 0;
46 
47  virtual bool readDataFromFile(FileLoadInfo* fileload_info,
48  PlotDataMapRef& destination) = 0;
49 
51  {
52  _parser_factories = parsers;
53  }
54 
56  {
57  return _parser_factories;
58  }
59 
60 private:
61  ParserFactories* _parser_factories = nullptr;
62 };
63 
64 using DataLoaderPtr = std::shared_ptr<DataLoader>;
65 
66 } // namespace PJ
67 
68 QT_BEGIN_NAMESPACE
69 #define DataRead_iid "facontidavide.PlotJuggler3.DataLoader"
70 Q_DECLARE_INTERFACE(PJ::DataLoader, DataRead_iid)
71 QT_END_NAMESPACE
72 
73 #endif
#define DataRead_iid
std::map< QString, std::shared_ptr< ParserFactoryPlugin > > ParserFactories
The DataLoader plugin type is used to load files.
QStringList selected_datasources
Optional list of pre-selected datasource.
QString filename
name of the file to open
const ParserFactories * parserFactories() const
QString prefix
prefix to be added to the name of the series (optional)
QDomDocument plugin_config
Saved configuration from a previous run or a Layout file.
void setParserFactories(ParserFactories *parsers)
std::shared_ptr< DataLoader > DataLoaderPtr
The PlotJugglerPlugin is the base class of all the plugins.
Definition: pj_plugin.h:22


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