data_exporter_interface.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * Software License Agreement
4  *
5  * Copyright (c) 2020,
6  * TU Dortmund - Institute of Control Theory and Systems Engineering.
7  * All rights reserved.
8  *
9  * This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  *
22  * Authors: Christoph Rösmann
23  *********************************************************************/
24 
25 #ifndef SRC_CORE_INCLUDE_CORBO_CORE_DATA_EXPORTER_INTERFACE_H_
26 #define SRC_CORE_INCLUDE_CORBO_CORE_DATA_EXPORTER_INTERFACE_H_
27 
29 
30 #include <corbo-core/factory.h>
31 
32 #include <memory>
33 #include <string>
34 
35 namespace corbo {
36 
45 class DataExporterInterface
46 {
47  public:
48  using Ptr = std::shared_ptr<DataExporterInterface>;
49  using ConstPtr = std::shared_ptr<const DataExporterInterface>;
50 
51  virtual ~DataExporterInterface() {}
52 
54  virtual Ptr getInstance() const = 0;
55 
57  static Factory<DataExporterInterface>& getFactory() { return Factory<DataExporterInterface>::instance(); }
58 
59  virtual std::string getFormatName() const = 0;
60  virtual std::string getFileSuffix() const = 0;
61 
62  virtual bool isSupportingSignalGroup() const { return false; }
63  virtual bool isSupportingTimeSeriesSignal() const { return false; }
64  virtual bool isSupportingTimeSeries() const { return false; }
65  virtual bool isSupportingTimeSeriesSequenceSignal() const { return false; }
66  virtual bool isSupportingIndexedValuesSignal() const { return false; }
67  virtual bool isSupportingIndexedValuesSetSignal() const { return false; }
68  virtual bool isSupportingMatrixSignal() const { return false; }
69  virtual bool isSupportingMatrixSetSignal() const { return false; }
70 
71  virtual bool exportSignalGroup(const std::string& filename, const CommonSignalTarget::SignalGroup& signal_group);
72  virtual bool exportTimeSeriesSignal(const std::string& filename, const TimeSeriesSignal& signal);
73  virtual bool exportTimeSeries(const std::string& filename, const TimeSeries& time_series);
74  virtual bool exportTimeSeriesSequenceSignal(const std::string& filename, const TimeSeriesSequenceSignal& signal);
75  virtual bool exportIndexedValuesSignal(const std::string& filename, const IndexedValuesSignal& signal);
76  virtual bool exportIndexedValuesSetSignal(const std::string& filename, const IndexedValuesSetSignal& signal);
77  virtual bool exportMatrixSignal(const std::string& filename, const MatrixSignal& signal);
78  virtual bool exportMatrixSetSignal(const std::string& filename, const MatrixSetSignal& signal);
79 };
80 
81 using DataExporterFactory = Factory<DataExporterInterface>;
82 #define FACTORY_REGISTER_DATA_EXPORTER(type) FACTORY_REGISTER_OBJECT(type, DataExporterInterface)
83 
84 } // namespace corbo
85 
86 #endif // SRC_CORE_INCLUDE_CORBO_CORE_DATA_EXPORTER_INTERFACE_H_
corbo::DataExporterInterface::getFormatName
virtual std::string getFormatName() const =0
corbo::DataExporterInterface::isSupportingIndexedValuesSignal
virtual bool isSupportingIndexedValuesSignal() const
Definition: data_exporter_interface.h:110
corbo::DataExporterInterface::isSupportingTimeSeriesSequenceSignal
virtual bool isSupportingTimeSeriesSequenceSignal() const
Definition: data_exporter_interface.h:109
corbo::DataExporterInterface::exportTimeSeriesSignal
virtual bool exportTimeSeriesSignal(const std::string &filename, const TimeSeriesSignal &signal)
Definition: data_exporter_interface.cpp:59
factory.h
corbo::DataExporterInterface::exportMatrixSignal
virtual bool exportMatrixSignal(const std::string &filename, const MatrixSignal &signal)
Definition: data_exporter_interface.cpp:89
corbo
Definition: communication/include/corbo-communication/utilities.h:37
corbo::DataExporterInterface::isSupportingMatrixSignal
virtual bool isSupportingMatrixSignal() const
Definition: data_exporter_interface.h:112
corbo::DataExporterInterface::ConstPtr
std::shared_ptr< const DataExporterInterface > ConstPtr
Definition: data_exporter_interface.h:93
corbo::DataExporterInterface::getFactory
static Factory< DataExporterInterface > & getFactory()
Get access to the associated factory.
Definition: data_exporter_interface.h:101
corbo::DataExporterInterface::isSupportingTimeSeries
virtual bool isSupportingTimeSeries() const
Definition: data_exporter_interface.h:108
corbo::DataExporterInterface::isSupportingMatrixSetSignal
virtual bool isSupportingMatrixSetSignal() const
Definition: data_exporter_interface.h:113
corbo::DataExporterInterface::getInstance
virtual Ptr getInstance() const =0
Return a newly created shared instance of the implemented class.
corbo::Factory::instance
static Factory & instance()
< Retrieve static instance of the factory
Definition: factory.h:116
corbo::DataExporterInterface::isSupportingTimeSeriesSignal
virtual bool isSupportingTimeSeriesSignal() const
Definition: data_exporter_interface.h:107
relicense.filename
filename
Definition: relicense.py:57
corbo::DataExporterInterface::Ptr
std::shared_ptr< DataExporterInterface > Ptr
Definition: data_exporter_interface.h:92
corbo::DataExporterInterface::~DataExporterInterface
virtual ~DataExporterInterface()
Definition: data_exporter_interface.h:95
corbo::DataExporterInterface::isSupportingSignalGroup
virtual bool isSupportingSignalGroup() const
Definition: data_exporter_interface.h:106
corbo::DataExporterInterface::exportIndexedValuesSetSignal
virtual bool exportIndexedValuesSetSignal(const std::string &filename, const IndexedValuesSetSignal &signal)
Definition: data_exporter_interface.cpp:83
corbo::DataExporterInterface::isSupportingIndexedValuesSetSignal
virtual bool isSupportingIndexedValuesSetSignal() const
Definition: data_exporter_interface.h:111
common_signal_target.h
corbo::DataExporterInterface::exportIndexedValuesSignal
virtual bool exportIndexedValuesSignal(const std::string &filename, const IndexedValuesSignal &signal)
Definition: data_exporter_interface.cpp:77
corbo::DataExporterInterface::exportSignalGroup
virtual bool exportSignalGroup(const std::string &filename, const CommonSignalTarget::SignalGroup &signal_group)
Definition: data_exporter_interface.cpp:53
corbo::DataExporterInterface::exportTimeSeriesSequenceSignal
virtual bool exportTimeSeriesSequenceSignal(const std::string &filename, const TimeSeriesSequenceSignal &signal)
Definition: data_exporter_interface.cpp:71
corbo::DataExporterInterface::exportTimeSeries
virtual bool exportTimeSeries(const std::string &filename, const TimeSeries &time_series)
Definition: data_exporter_interface.cpp:65
corbo::DataExporterFactory
Factory< DataExporterInterface > DataExporterFactory
Definition: data_exporter_interface.h:103
corbo::DataExporterInterface::getFileSuffix
virtual std::string getFileSuffix() const =0
corbo::DataExporterInterface::exportMatrixSetSignal
virtual bool exportMatrixSetSignal(const std::string &filename, const MatrixSetSignal &signal)
Definition: data_exporter_interface.cpp:95


control_box_rst
Author(s): Christoph Rösmann
autogenerated on Wed Mar 2 2022 00:05:44