GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmResultsTimeSet.h
Go to the documentation of this file.
1/************************************************************************
2**
3** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4** All rights reserved.
5**
6** This file is part of the "GeMA" software. It's use should respect
7** the terms in the license agreement that can be found together
8** with this source code.
9** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11** A PARTICULAR PURPOSE.
12**
13************************************************************************/
14
24#ifndef _GEMA_RESULTS_TIME_SET_H_
25#define _GEMA_RESULTS_TIME_SET_H_
26
27#include "gmCoreConfig.h"
28#include "gmLog.h"
29
30#include <QString>
31#include <QVector>
32#include <QMap>
33
34class LuaTable;
35
36
39{
40public:
41 struct Interval
42 {
43 double _start;
44 double _stop;
45 double _inc;
46 };
47
48 struct IntervalUnit : public Interval
49 {
51 };
52
58
68
70 QString id() const { return _id; }
71
73 QString description() const { return _description; }
74
76 QStringList attributes() const { return _data.keys(); }
77
79 const TimeData* attributeData(QString attribute) const
80 {
81 QMap<QString, TimeData>::const_iterator it = _data.constFind(attribute);
82 if(it == _data.constEnd())
83 return NULL;
84 return &it.value();
85 }
86
87 void print(const GmLogCategory& logger, GmLogLevel level) const;
88
89 static GmResultsTimeSet* loadFromTable(LuaTable& tab, const GmLogCategory& parseLogger);
90
91private:
92 Q_DISABLE_COPY(GmResultsTimeSet);
93
94 GmResultsTimeSet(QString id, QString description);
95
99};
100#endif
Class representing a category with multiple logging levels.
Definition gmLog.h:58
A rule specifying the execution moments (time, iterations, etc) that a result rule should be executed...
Definition gmResultsTimeSet.h:39
QMap< QString, TimeData > _data
The configured time data map, keyed by attribute name.
Definition gmResultsTimeSet.h:98
QString id() const
Returns the time set name.
Definition gmResultsTimeSet.h:70
QString description() const
Returns the time set description.
Definition gmResultsTimeSet.h:73
QString _description
A description of the time set.
Definition gmResultsTimeSet.h:97
QStringList attributes() const
The set of associated attributes.
Definition gmResultsTimeSet.h:76
QString _id
The time set id (name)
Definition gmResultsTimeSet.h:96
const TimeData * attributeData(QString attribute) const
Return the user-given time data associated with the given attribute name, NULL if there is none.
Definition gmResultsTimeSet.h:79
Declaration of useful configuration definitions for the Core library.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Declaration of support functions and macros for information logging.
GmLogLevel
Available log levels list.
Definition gmLog.h:36
const T & value() const const
Definition gmResultsTimeSet.h:42
double _inc
The increment.
Definition gmResultsTimeSet.h:45
double _start
The start of the interval (inclusive)
Definition gmResultsTimeSet.h:43
double _stop
The end of the interval (inclusive)
Definition gmResultsTimeSet.h:44
Definition gmResultsTimeSet.h:49
QString _unit
The unit in which the interval data is given.
Definition gmResultsTimeSet.h:50
Definition gmResultsTimeSet.h:54
QVector< double > _moments
The ordered list of user-provided "moments" (time, iteration, etc, depending on the associated attrib...
Definition gmResultsTimeSet.h:55
QString _momentsUnit
The unit in which the moments data is given.
Definition gmResultsTimeSet.h:56
The time data internal structure.Notice that QVectors are implicitely copied, so we don't have proble...
Definition gmResultsTimeSet.h:63
QVector< Moments > _momentsList
The user-given defined moments list for this attribute.
Definition gmResultsTimeSet.h:66
QString _attribute
The associated time/iteration/etc attribute.
Definition gmResultsTimeSet.h:64
QVector< IntervalUnit > _intervalList
The user-given interval list for this attribute. Unordered since each interval can be in a different ...
Definition gmResultsTimeSet.h:65