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 "PlotJuggler/plotdata.h"
13 #include "PlotJuggler/pj_plugin.h"
15 
16 namespace PJ
17 {
19 {
21  QString filename;
23  QString prefix;
25  QDomDocument plugin_config;
26 };
27 
35 {
36 public:
37  DataLoader() = default;
38 
39  virtual ~DataLoader() = default;
40 
42  virtual const std::vector<const char*>& compatibleFileExtensions() const = 0;
43 
44  virtual bool readDataFromFile(FileLoadInfo* fileload_info,
45  PlotDataMapRef& destination) = 0;
46 
48  {
49  _parser_factories = parsers;
50  }
51 
53  {
54  return _parser_factories;
55  }
56 
57 private:
59 };
60 
61 using DataLoaderPtr = std::shared_ptr<DataLoader>;
62 
63 } // namespace PJ
64 
65 QT_BEGIN_NAMESPACE
66 #define DataRead_iid "facontidavide.PlotJuggler3.DataLoader"
67 Q_DECLARE_INTERFACE(PJ::DataLoader, DataRead_iid)
68 QT_END_NAMESPACE
69 
70 #endif
PJ::DataLoader::~DataLoader
virtual ~DataLoader()=default
PJ::FileLoadInfo
Definition: dataloader_base.h:18
PJ::DataLoader::readDataFromFile
virtual bool readDataFromFile(FileLoadInfo *fileload_info, PlotDataMapRef &destination)=0
PJ::FileLoadInfo::plugin_config
QDomDocument plugin_config
Saved configuration from a previous run or a Layout file.
Definition: dataloader_base.h:25
PJ::DataLoader::setParserFactories
void setParserFactories(ParserFactories *parsers)
Definition: dataloader_base.h:47
PJ::PlotJugglerPlugin
The PlotJugglerPlugin is the base class of all the plugins.
Definition: pj_plugin.h:22
PJ::DataLoader::_parser_factories
ParserFactories * _parser_factories
Definition: dataloader_base.h:58
plotdata.h
pj_plugin.h
PJ::DataLoader::DataLoader
DataLoader()=default
PJ::FileLoadInfo::prefix
QString prefix
prefix to be added to the name of the series (optional)
Definition: dataloader_base.h:23
PJ::DataLoader
The DataLoader plugin type is used to load files.
Definition: dataloader_base.h:34
PJ::ParserFactories
std::map< QString, std::shared_ptr< ParserFactoryPlugin > > ParserFactories
Definition: messageparser_base.h:157
PJ::DataLoaderPtr
std::shared_ptr< DataLoader > DataLoaderPtr
Definition: dataloader_base.h:61
DataRead_iid
#define DataRead_iid
Definition: dataloader_base.h:66
PJ
Definition: dataloader_base.h:16
PJ::PlotDataMapRef
Definition: plotdata.h:34
PJ::DataLoader::compatibleFileExtensions
virtual const std::vector< const char * > & compatibleFileExtensions() const =0
Provide a list of file extensions that this plugin can open.
messageparser_base.h
PJ::DataLoader::parserFactories
const ParserFactories * parserFactories() const
Definition: dataloader_base.h:52
PJ::FileLoadInfo::filename
QString filename
name of the file to open
Definition: dataloader_base.h:21


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