GemaCoreLib
The GeMA Core library
Public Member Functions | List of all members
GmPropertySet Class Referenceabstract

Interface storing property descriptions and values. More...

#include <gmPropertySet.h>

Inheritance diagram for GmPropertySet:
Inheritance graph
[legend]
Collaboration diagram for GmPropertySet:
Collaboration graph
[legend]

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 GmValueInfopropertyInfo (QString propertyId) const =0
 Returns metadata information about a property or NULL if the property doesn't exists.
 
virtual GmValueAccessorpropertyAccessor (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.
 
- Public Member Functions inherited from GmPluginObject
 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

- Protected Member Functions inherited from GmPluginObject
virtual const GmLogCategorylogger () const
 Returns the internal logger used by the plugin to emmit messages.
 
GmSimulationDatasimulationData () const
 Returns a reference to the simulation data object keeping global simulation information.
 

Detailed Description

Interface storing property descriptions and values.

Constructor & Destructor Documentation

◆ GmPropertySet()

GmPropertySet::GmPropertySet ( GmSimulationData simulation,
QString  id,
QString  description,
const GmLogCategory logger 
)

Constructor.

Parameters
simulationReference to the simulation object.
idProperty set id.
descriptionProperty set description.
loggerPlugin logger object used to emmit messages

Member Function Documentation

◆ addValues()

virtual int GmPropertySet::addValues ( int  numValues,
const QStringList ids = QStringList() 
)
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.

◆ propertyAccessor()

virtual GmValueAccessor* GmPropertySet::propertyAccessor ( QString  propertyId,
Unit  desiredUnit,
const GmLogCategory logger,
const GmMesh mesh 
) const
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.

◆ valueIds()

virtual QStringList GmPropertySet::valueIds ( ) const
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.


The documentation for this class was generated from the following files: