GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmResultsRule Class Referenceabstract

A result rule represents an action that will be executed over one or more data sets at the moments (times, iterations, etc) defined by one or more time sets. This action can be, for example, saving the data to a file, printing the data or sending it through the monitor server. This base class implements the common part for any action, loading and managing the data sets list and the time sets list. The executed action is delegated to the corresponding derived class. More...

#include <gmResultsRule.h>

Inheritance diagram for GmResultsRule:
Collaboration diagram for GmResultsRule:

Public Member Functions

virtual ~GmResultsRule ()
 Destructor.
 
QString id () const
 Returns the result rule name.
 
QString description () const
 Returns the result rule description.
 
virtual GmResultsRuleType type () const =0
 Returns the result rule type.
 
const QVector< GmResultsDataSet * > & dataSets () const
 Returns the list of data sets acted upon by this rule.
 
const QVector< GmResultsTimeSet * > & timeSets () const
 Returns the list of time sets defining when this rule should be acted upon.
 
bool hasTimeSet () const
 Returns true if this rule is associated with a time set.
 
virtual void print (const GmLogCategory &logger, GmLogLevel level) const
 Prints the rule description to the appointed logger / level.
 
virtual bool run (const GmLogCategory &logger)=0
 The virtual method responsible for executing this rule's actions.
 

Protected Member Functions

 GmResultsRule (QString id, QString description, const QVector< GmResultsDataSet * > &dataSets, const QVector< GmResultsTimeSet * > &timeSets, bool trackObj, const GmSimulationData *simData)
 Constructor. The rule does NOT own the data sets and time sets.
 

Static Protected Member Functions

static bool fillCommonFields (const GmResultsData *data, LuaTable &tab, const GmLogCategory &logger, QString &id, QString &description, QVector< GmResultsDataSet * > &dataSets, QVector< GmResultsTimeSet * > &timeSets, bool &trackObj)
 Helper function for the loadFromTable functions from derived classes. Parses the common fields for every result rule from the given Lua table. The logger is used to emmit messages during rule parsing. The data object is used to find data sets and time sets on the results data object.
 

Protected Attributes

QString _id
 The save rule id (name)
 
QString _description
 A description of the save rule.
 
QVector< GmResultsDataSet * > _dataSets
 The list of associated data sets.
 
QVector< GmResultsTimeSet * > _timeSets
 The list of associated time sets.
 
const GmSimulationData_simData
 The simulation data object.
 
int _itemId
 The run progress item id for result rules of this kind (subclass: save rules, print rules or monitor rules)

 
int _objItemId
 The run progress item for this object if the user requested to monitor the time for this specific result rule.
 

Private Member Functions

 Q_DISABLE_COPY (GmResultsRule)
 

Detailed Description

A result rule represents an action that will be executed over one or more data sets at the moments (times, iterations, etc) defined by one or more time sets. This action can be, for example, saving the data to a file, printing the data or sending it through the monitor server. This base class implements the common part for any action, loading and managing the data sets list and the time sets list. The executed action is delegated to the corresponding derived class.

Member Function Documentation

◆ print()

void GmResultsRule::print ( const GmLogCategory & logger,
GmLogLevel level ) const
virtual

Prints the rule description to the appointed logger / level.

Reimplemented in GmMonitorResultsRule, GmPrintResultsRule, and GmSaveResultsRule.

◆ run()

virtual bool GmResultsRule::run ( const GmLogCategory & logger)
pure virtual

The virtual method responsible for executing this rule's actions.

Implemented in GmMonitorResultsRule, GmPrintResultsRule, and GmSaveResultsRule.

◆ type()

virtual GmResultsRuleType GmResultsRule::type ( ) const
pure virtual

Returns the result rule type.

Implemented in GmMonitorResultsRule, GmPrintResultsRule, and GmSaveResultsRule.


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