GemaPropertySet
The GeMA Property Set Plugin
Loading...
Searching...
No Matches
gmpGemaPropertySet.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_PLUGIN_GEMA_PROPERTYSET_H_
25#define _GEMA_PLUGIN_GEMA_PROPERTYSET_H_
26
27#include <gmPropertySet.h>
28#include <gmValueSetGroup.h>
29
33{
34public:
36
37 virtual ~GmpGemaPropertySet();
38
39 // Comments on the base class
40 virtual const char* pluginName() const { return "GemaPropertySet"; }
41
42 // Comments on the base class
43 virtual const char* pluginType() const { return "ps"; }
44
45 virtual bool loadPrivateData(LuaTable& table);
46
47 // Comments on the base class
48 virtual int numProperties() const { return _valuesGroup.numSets(); }
49
50 // Comments on the base class
51 virtual int numValues() const { return _valuesMap.size(); }
52
53 // Comments on the base class
54 virtual QStringList propertyIds() const { return _valuesGroup.dataMap().keys(); }
55
56 virtual QStringList valueIds() const;
57
58 virtual GmValueInfo* propertyInfo (QString propertyId) const;
59 virtual GmValueAccessor* propertyAccessor(QString propertyId, Unit desiredUnit,
60 const GmLogCategory& logger, const GmMesh* mesh) const;
61
62 // Comments on the base class
63 virtual int valueIndex(QString valueId) const { return _valuesMap.value(valueId, -1); }
64
65 virtual int addValues(int numValues, const QStringList& ids = QStringList());
66private:
67 bool prepareValueSets(const QList<GmValueInfo*>& infoList, int nvalues, QList<GmValueAccessor*>& acList);
68
71};
72
73#endif
virtual const GmLogCategory & logger() const
QString description() const
int numSets() const
const QMap< QString, int > & dataMap() const
Basic class for the GemaPropertySet plugin object.
Definition gmpGemaPropertySet.h:33
virtual ~GmpGemaPropertySet()
Destructor.
Definition gmpGemaPropertySet.cpp:44
bool prepareValueSets(const QList< GmValueInfo * > &infoList, int nvalues, QList< GmValueAccessor * > &acList)
Prepare value sets and accessor objects for reading data.
Definition gmpGemaPropertySet.cpp:131
QMap< QString, int > _valuesMap
Map translating a value Id (name) into the line number of that property inside ValueSets.
Definition gmpGemaPropertySet.h:70
GmpGemaPropertySet(GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger)
Constructor. See comments on the base class.
Definition gmpGemaPropertySet.cpp:38
GmValueSetGroup _valuesGroup
Value set Group with property data.
Definition gmpGemaPropertySet.h:69
QList< Key > keys() const const
int size() const const
const T value(const Key &key, const T &defaultValue) const const