##// END OF EJS Templates
Parser refactoring (1)...
Alexandre Leroux -
r944:e1494a5194f1
parent child
Show More
@@ -0,0 +1,46
1 #ifndef SCIQLOP_AMDARESULTPARSERHELPER_H
2 #define SCIQLOP_AMDARESULTPARSERHELPER_H
3
4 #include <QtCore/QLoggingCategory>
5 #include <QtCore/QString>
6
7 #include <memory>
8
9 class IDataSeries;
10
11 Q_DECLARE_LOGGING_CATEGORY(LOG_AmdaResultParserHelper)
12
13 /**
14 * Helper used to interpret the data of an AMDA result file and generate the corresponding data
15 * series.
16 *
17 * It proposes methods allowing to read line by line an AMDA file and to extract the properties
18 * (from the header) and the values corresponding to the data series
19 *
20 * @sa DataSeries
21 */
22 struct IAmdaResultParserHelper {
23 virtual ~IAmdaResultParserHelper() noexcept = default;
24
25 /// Verifies that the extracted properties are well formed and possibly applies other treatments
26 /// on them
27 /// @return true if the properties are well formed, false otherwise
28 virtual bool checkProperties() = 0;
29
30 /// Creates the data series from the properties and values extracted from the AMDA file.
31 /// @warning as the data are moved in the data series, the helper shouldn't be used after
32 /// calling this method
33 /// @return the data series created
34 virtual std::shared_ptr<IDataSeries> createSeries() = 0;
35
36 /// Reads a line from the AMDA file to extract a property that will be used to generate the data
37 /// series
38 /// @param line tahe line to interpret
39 virtual void readPropertyLine(const QString &line) = 0;
40
41 /// Reads a line from the AMDA file to extract a value that will be set in the data series
42 /// @param line the line to interpret
43 virtual void readResultLine(const QString &line) = 0;
44 };
45
46 #endif // SCIQLOP_AMDARESULTPARSERHELPER_H
General Comments 0
You need to be logged in to leave comments. Login now