SPH
Public Member Functions | List of all members
ITrigger Class Referenceabstract

Interface for triggering generic actions during the run. More...

#include <Trigger.h>

Inheritance diagram for ITrigger:
Polymorphic PeriodicTrigger AngularMomentumLog DiagnosticsTrigger ILogWriter ProgressLog ProgressLogger BriefLogWriter EnergyLogWriter IntegralsLogWriter LogWriter NullLogWriter StandardLogWriter VerboseLogWriter

Public Member Functions

virtual TriggerEnum type () const =0
 Returns the type of the trigger. More...
 
virtual bool condition (const Storage &storage, const Statistics &stats)=0
 Returns true if the trigger should be executed. More...
 
virtual AutoPtr< ITriggeraction (Storage &storage, Statistics &stats)=0
 Action executed when the condition is fulfilled. More...
 
- Public Member Functions inherited from Polymorphic
virtual ~Polymorphic ()
 

Detailed Description

Interface for triggering generic actions during the run.

Definition at line 19 of file Trigger.h.

Member Function Documentation

◆ action()

virtual AutoPtr<ITrigger> ITrigger::action ( Storage storage,
Statistics stats 
)
pure virtual

Action executed when the condition is fulfilled.

Returns
Additional trigger executed after this one, or nullptr.

Implemented in ILogWriter, ProgressLogger, AngularMomentumLog, and DiagnosticsTrigger.

◆ condition()

virtual bool ITrigger::condition ( const Storage storage,
const Statistics stats 
)
pure virtual

Returns true if the trigger should be executed.

Note
Function is not const, so that triggers can increment internal counters, save last time or other auxiliary statistics, etc.

◆ type()

virtual TriggerEnum ITrigger::type ( ) const
pure virtual

Returns the type of the trigger.

Implemented in PeriodicTrigger.


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