#include <PunctualAction.h>
Inheritance diagram for PunctualAction:
A punctual action is an action that is executed in one-shot mode, namely an action that is activated once and executes to completion during its single activation.
Punctual actions can be enabled and disabled. Execution of a punctual action that is disabled has no effect.
Execution of a punctual action has an outcome. The outcome of the execution of a punctual action is represented by the value returned by the execution method. This value is internally saved and punctual actions can be interrogated for their last outcome. This is the outcome produced by the last execution of the punctual action.
Execution of a punctual action is recorded through an event report. The event records the fact that the punctual action was executed (or that it was not executed because it was disabled).
This is an abstract class because the actions to be associated to the punctual action must be specified by the subclasses. The management of the enable status is however done in this class.
Definition at line 46 of file PunctualAction.h.
Public Member Functions | |
PunctualAction (void) | |
Instantiate a punctual action. | |
TD_ActionOutcome | execute (void) |
Execute the punctual action if the punctual action is enabled, otherwise do nothing. | |
void | setEnabled (bool isEnabled) |
Set the enable status of the punctual action. | |
bool | isEnabled (void) const |
Check the enable status of the punctual action. | |
TD_ActionOutcome | getLastOutcome (void) const |
Get the last outcome of the punctual action. | |
void | resetLastOutcome (void) |
Reset the value of the last outcome to ACTION_RESET. | |
Protected Member Functions | |
virtual TD_ActionOutcome | doAction (void)=0 |
Encapsulate implementation of the action associated to this punctual action object. |
|
Instantiate a punctual action. The enable status of the action is initialized to "enabled". The last outcome is initialized to ACTION_RESET. Definition at line 15 of file PunctualAction.cpp. |
|
Encapsulate implementation of the action associated to this punctual action object.
This method is called by method
Implemented in DC_FdirCheck, RecoveryAction, ConditionalPunctualAction, DC_DummyPunctualAction, DC_FromFsmEvent, DC_FsmEvent, DC_ManoeuvrePunctualAction, CriticalTelecommand, DC_DummyPUSTelecommand, DC_DummyTelecommand, DC_PUSClearDataReporting, DC_PUSControlDataReporting, DC_PUSDefineDataReporting, DC_PUSDumpMemoryAbsolute, DC_PUSDumpMemoryOffset, DC_TestPUSTelecommand, and PUSMemoryLoad. |
|
Execute the punctual action if the punctual action is enabled, otherwise do nothing. An event report is created to record the fact. A pseudo-code implementation for this method is as follows: outcomeCode = ACTION_DISABLED; if ( isEnabled() ) { outcomeCode = doAction(); createEventReport(EVT_PUNCTUAL_ACTION_EXEC); } else createEventReport(EVT_PUNCTUAL_ACTION_DIS); lastOutcome = outcomeCode; return outcomeCode;The doAction() method is abstract and encapsulates the implementation of the actions associated to the punctual action. Thus, this class enforces the check on the enabled status of the punctual action and the recording of the action outcome but delegates implementation of the action to the derived classes.
This method implements the trigger or execute basic operations for all framework components that are instantiated from classes derived from
Definition at line 20 of file PunctualAction.cpp. |
|
Get the last outcome of the punctual action.
The last outcome of the punctual action is the return value of method
Definition at line 41 of file PunctualAction.cpp. |
|
Check the enable status of the punctual action.
Definition at line 37 of file PunctualAction.cpp. |
|
Reset the value of the last outcome to ACTION_RESET.
Definition at line 45 of file PunctualAction.cpp. |
|
Set the enable status of the punctual action.
When the action is disabled, a call to method
Definition at line 33 of file PunctualAction.cpp. |