Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

PunctualAction Class Reference
[General Base Classes]

#include <PunctualAction.h>

Inheritance diagram for PunctualAction:

CC_RootObject ConditionalPunctualAction DC_DummyPunctualAction DC_FdirCheck DC_FsmEvent DC_ManoeuvrePunctualAction RecoveryAction Telecommand DC_ControlAction DC_ControlList DC_DataPoolMonitor DC_DummyConditionalPunctualAction DC_FromFsmEvent DC_DummyRecoveryAction DC_NullRecoveryAction DC_SampleRecoveryAction CriticalTelecommand DC_DummyTelecommand PUSTelecommand List of all members.

Detailed Description

Base class from which all classes encapsulating punctual actions are derived.

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.

Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

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.


Constructor & Destructor Documentation

PunctualAction::PunctualAction void   ) 
 

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.


Member Function Documentation

virtual TD_ActionOutcome PunctualAction::doAction void   )  [protected, pure virtual]
 

Encapsulate implementation of the action associated to this punctual action object.

This method is called by method execute() in this same class. Users of punctual actions do not see method doAction(), they only see method execute().

See also:
execute
Returns:
the outcome code of the punctual action that encodes the results of the execution of the action (success, failure, etc)

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.

TD_ActionOutcome PunctualAction::execute void   ) 
 

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 PunctualAction.

See also:
TD_ActionOutcome

TD_EventType

Returns:
the outcome code of the punctual action that encodes the results of the execution of the action (success, failure, etc)

Definition at line 20 of file PunctualAction.cpp.

TD_ActionOutcome PunctualAction::getLastOutcome void   )  const
 

Get the last outcome of the punctual action.

The last outcome of the punctual action is the return value of method execute the last time it was called. After component instantiation or after a call to resetLastOutcome, this method returns ACTION_RESET

See also:
resetLastOutcome

TD_ActionOutcome

execute

Returns:
the last outcome of the punctual action

Definition at line 41 of file PunctualAction.cpp.

bool PunctualAction::isEnabled void   )  const
 

Check the enable status of the punctual action.

Returns:
true if the punctual is enabled, false otherwise

Definition at line 37 of file PunctualAction.cpp.

void PunctualAction::resetLastOutcome void   ) 
 

Reset the value of the last outcome to ACTION_RESET.

See also:
getLastOutcome

TD_ActionOutcome

Definition at line 45 of file PunctualAction.cpp.

void PunctualAction::setEnabled bool  isEnabled  ) 
 

Set the enable status of the punctual action.

When the action is disabled, a call to method execute() has no effect.

Parameters:
isEnabled if true, then the action is enabled; if false, then the action is disabled

Definition at line 33 of file PunctualAction.cpp.


The documentation for this class was generated from the following files:
Copyright 2003 P&P Software GmbH - All Rights Reserved