GemaCoreLib
The GeMA Core library
gmResultDataSrcInfo.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 
25 #ifndef _GEMA_RESULT_DATASRC_INFO_H_
26 #define _GEMA_RESULT_DATASRC_INFO_H_
27 
28 #include "gmCoreConfig.h"
29 
30 #include <unit.h>
31 #include <QString>
32 
39 
40  // -- Don't add entries below this line --
41  // Also keep in mind that changing the above order can NOT be done lightly
42  // (see GmResultsRule::loadFromTable())
44 };
45 
51 {
52 public:
54  virtual ~GmResultDataSrcInfo() {}
55 
60  virtual int trackId() const = 0;
61 
63  virtual GmResultDataSrcType type() const = 0;
64 
66  virtual QString alias() const = 0;
67 
69  virtual QString description() const = 0;
70 
72  virtual Unit unit() const = 0;
73 
79  virtual int size() const = 0;
80 
86  virtual int nlin() const = 0;
87 
93  virtual int ncol() const = 0;
94 
96  virtual QString formatStr() const = 0;
97 };
98 
101 {
102 public:
104  Unit unit, int nlin, int ncol, QString format)
105  : _type(type), _alias(alias), _description(description), _unit(unit),
106  _nlin(nlin), _ncol(ncol), _formatStr(format) {}
107 
108  void updateData(Unit unit, int nlin, int ncol, QString format)
109  {
110  _unit = unit;
111  _nlin = nlin;
112  _ncol = ncol;
113  _formatStr = format;
114  }
115 
117  virtual int trackId() const { return -1; }
118 
119  virtual GmResultDataSrcType type() const { return _type; }
120  virtual QString alias() const { return _alias; }
121  virtual QString description() const { return _description; }
122  virtual Unit unit() const { return _unit; }
123  virtual int size() const { return _nlin * _ncol; }
124  virtual int nlin() const { return _nlin; }
125  virtual int ncol() const { return _ncol; }
126  virtual QString formatStr() const { return _formatStr; }
127 
128 private:
133  int _nlin;
134  int _ncol;
136 };
137 
138 
139 #endif
140 
QString _description
The data description.
Definition: gmResultDataSrcInfo.h:131
int _nlin
The number of lines in the data (0 for string attributes)
Definition: gmResultDataSrcInfo.h:133
virtual int trackId() const
Returns an invalid trackId since this object is not a real dataSrc, but the metadata for a data src.
Definition: gmResultDataSrcInfo.h:117
A basic interface with the metadata common to all result data src types. This is the information that...
Definition: gmResultDataSrcInfo.h:50
Declaration of usefull configuration definitions for the Core library.
virtual Unit unit() const =0
Returns the unit in which the data is expressed.
Node attributes + State vars.
Definition: gmResultDataSrcInfo.h:36
GmResultDataSrcType
The types of data srcs stored by a rule.
Definition: gmResultDataSrcInfo.h:34
GmResultDataSrcType _type
The data src type.
Definition: gmResultDataSrcInfo.h:129
int _ncol
The number of lines in the data (0 for string attributes)
Definition: gmResultDataSrcInfo.h:134
virtual Unit unit() const
Returns the unit in which the data is expressed.
Definition: gmResultDataSrcInfo.h:122
virtual int nlin() const
The number of lines in the returned result, taking into account any applied transformations or dim fi...
Definition: gmResultDataSrcInfo.h:124
virtual int nlin() const =0
The number of lines in the returned result, taking into account any applied transformations or dim fi...
virtual int ncol() const =0
The number of columns in the returned result, taking into account any applied transformations or dim ...
virtual int ncol() const
The number of columns in the returned result, taking into account any applied transformations or dim ...
Definition: gmResultDataSrcInfo.h:125
The number of data src types above.
Definition: gmResultDataSrcInfo.h:43
Unit _unit
The data unit.
Definition: gmResultDataSrcInfo.h:132
virtual GmResultDataSrcType type() const
Returns the data src type.
Definition: gmResultDataSrcInfo.h:119
virtual QString formatStr() const
How should dataSrc values be formated?
Definition: gmResultDataSrcInfo.h:126
QString _formatStr
The printf style (without the %) format specifier.
Definition: gmResultDataSrcInfo.h:135
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
virtual QString alias() const
Returns the data src "exported" id.
Definition: gmResultDataSrcInfo.h:120
Attribute data.
Definition: gmResultDataSrcInfo.h:35
A basic class used to store meta-data information about result attributes DEFINITIONS.
Definition: gmResultDataSrcInfo.h:100
Gauss attributes.
Definition: gmResultDataSrcInfo.h:38
Cell attributes + properties.
Definition: gmResultDataSrcInfo.h:37
QString _alias
The data src alias (exported name)
Definition: gmResultDataSrcInfo.h:130
virtual ~GmResultDataSrcInfo()
Virtual destructor.
Definition: gmResultDataSrcInfo.h:54
virtual QString description() const
Returns the data src description, when available.
Definition: gmResultDataSrcInfo.h:121
virtual int size() const
Returns the dimension of the data src values, taking into account any applied transformations or dim ...
Definition: gmResultDataSrcInfo.h:123