![]() |
GemaCoreLib
The GeMA Core library
|
Interface storing property descriptions and values. More...
#include <gmPropertySet.h>
Public Member Functions | |
GmPropertySet (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) | |
Constructor. More... | |
virtual | ~GmPropertySet () |
Destructor. | |
virtual const char * | pluginCategory () const |
Returns the plugin category. | |
virtual int | numProperties () const =0 |
Returns the number of properties (columns) stored in the set. | |
virtual int | numValues () const =0 |
Returns the number of property values (lines) stored in the set. | |
virtual QStringList | propertyIds () const =0 |
Returns the ids of the properties stored in the set (no special order is enforced) | |
virtual QStringList | valueIds () const =0 |
Returns the ids of the values stored in the set, ordered in the same order as the values appear when traversing property accessors. More... | |
virtual GmValueInfo * | propertyInfo (QString propertyId) const =0 |
Returns metadata information about a property or NULL if the property doesn't exists. | |
virtual GmValueAccessor * | propertyAccessor (QString propertyId, Unit desiredUnit, const GmLogCategory &logger, const GmMesh *mesh) const =0 |
Returns an accessor for property values in the desired unit (can be a default unit for no unit conversion). More... | |
virtual int | valueIndex (QString valueId) const =0 |
Returns the line index of the named property set or -1 if not found. | |
virtual int | addValues (int numValues, const QStringList &ids=QStringList()) |
Adds numValues lines to the property set, initializing their columns with default values. More... | |
virtual void | printParameters (const GmLogCategory &logger) |
Asks the property set to print basic information about properties using the provided logger. | |
virtual void | printValues (const GmLogCategory &logger) |
Asks the property set to print all of its properties data using the provided logger. | |
![]() | |
GmPluginObject (GmSimulationData *simulation, QString id, QString description, const GmLogCategory &logger) | |
Constructor. More... | |
virtual | ~GmPluginObject () |
Destructor. | |
QString | id () const |
Returns the object id. | |
QString | description () const |
Returns the object description. | |
QString | pluginTypeName () const |
Returns the hierarchical type name for the plugin object type. See also pluginName() and pluginType(). | |
virtual const char * | pluginName () const =0 |
Returns a string identifying the plugin which implements this object. Should return the SAME string as the one read from the plugin information file in the pluginName field. | |
virtual const char * | pluginType () const =0 |
Returns the string identifying the plugin object type. Should return the SAME string as the one read from the plugin information file in the objectTypes table. More... | |
virtual bool | loadPrivateData (LuaTable &table)=0 |
Function called by the model loader to give the object acess to it's private parameters. Should return false only if the received parameter set makes the use of this object impossible. | |
Additional Inherited Members | |
![]() | |
virtual const GmLogCategory & | logger () const |
Returns the internal logger used by the plugin to emmit messages. | |
GmSimulationData * | simulationData () const |
Returns a reference to the simulation data object keeping global simulation information. | |
Interface storing property descriptions and values.
GmPropertySet::GmPropertySet | ( | GmSimulationData * | simulation, |
QString | id, | ||
QString | description, | ||
const GmLogCategory & | logger | ||
) |
Constructor.
simulation | Reference to the simulation object. |
id | Property set id. |
description | Property set description. |
logger | Plugin logger object used to emmit messages |
|
inlinevirtual |
Adds numValues lines to the property set, initializing their columns with default values.
This function should be reimplemented by property set implementations that support adding new values. If not empty, the ids list should have size equal to numValues, storing the ids of the new table lines. If empty, new ids will be created based on line numbering. Either way, this function should check that the resulting table still have unique ids for each line.
On error, this function should leave the property set unchanged and return -1. On success, it should return the index of the first new node.
IMPORTANT: This function might invalidate any data pointer returned by previous accessors. The accessor themselves remain valid, but any pointers returned by calls to value() / other functions might become invalid.
|
pure virtual |
Returns an accessor for property values in the desired unit (can be a default unit for no unit conversion).
The returned pointer must be deallocated by the caller. Returns NULL if the property doesn't exists or an accessor can't be created (can't convert to the desired unit, for example).
The logger parameter exists to allow for the accessor to use a different logger than the property set one to report errors. For example, in an analysis context it might be interesting to report errors through the physics plugin logger instead of by the mesh logger.
The mesh parameter is needed when the property set might contain functions. This allows for the function evaluation in the context of the mesh.
|
pure virtual |
Returns the ids of the values stored in the set, ordered in the same order as the values appear when traversing property accessors.
All values should have an id, so the size of the returned list must be equal to the result of numValues(). By default, if a value line does not have an user given id, a default id based on its numerical line index should be constructed.