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

ConditionalPunctualAction Class Reference
[General Base Classes]

#include <ConditionalPunctualAction.h>

Inheritance diagram for ConditionalPunctualAction:

PunctualAction CC_RootObject DC_ControlAction DC_ControlList DC_DataPoolMonitor DC_DummyConditionalPunctualAction List of all members.

Detailed Description

Punctual action that performs an execution check.

An execution check is a check that is performed just before the action associated to the punctual action component are executed. An execution check can have two outcomes: "action can be executed" or "action cannot be executed". This type of punctual action is useful to model punctual actions which should be executed only if certain conditions are met. The execution check can be implemented to verify whether these conditions are met.

This is an abstract class because it leaves open the definition of the actions to be performed by the punctual action component and the definition of the concrete execution check. This class only implements the management of the abstract execution check.

Todo:
Add a getExecutionCheckCode to return a code describing the reason for the failure of the execution check.
Author:
Alessandro Pasetti (P&P Software GmbH)
Version:
1.0

Definition at line 38 of file ConditionalPunctualAction.h.

Public Member Functions

 ConditionalPunctualAction (void)
 Instantiate a punctual action.


Protected Member Functions

virtual TD_ActionOutcome doAction (void)
 Execute the punctual action if the execution check is satisifed.

virtual bool canExecute (void)=0
 Encapsulate implementation of the execution check.

virtual TD_ActionOutcome doConditionalAction (void)=0
 Encapsulate implementation of the actions associated to the punctual action component.


Constructor & Destructor Documentation

ConditionalPunctualAction::ConditionalPunctualAction void   ) 
 

Instantiate a punctual action.

This method returns without taking any action.

Definition at line 14 of file ConditionalPunctualAction.cpp.


Member Function Documentation

virtual bool ConditionalPunctualAction::canExecute void   )  [protected, pure virtual]
 

Encapsulate implementation of the execution check.

This method is called by method doAction() in this same class.

See also:
doAction
Returns:
true if the action can be executed, false if the action cannot be executed.

Implemented in DC_ControlAction, DC_ControlList, DC_DataPoolMonitor, and DC_DummyConditionalPunctualAction.

TD_ActionOutcome ConditionalPunctualAction::doAction void   )  [protected, virtual]
 

Execute the punctual action if the execution check is satisifed.

Otherwise, do nothing. A pseudo-code implementation for this method is as follows:

   if ( canExecute() )
      return doConditionalAction();
   else
      return ACTION_CANNOT_EXECUTE; 
The doConditionalAction() and canExecute() methods are abstract and encapsulate the implementation of the actions associated to the punctual action, and the implementation of the execution check respectively. Thus, this class enforces the execution check but leaves its definition and the definition of the concrete actions associated to the punctual action component open.
See also:
TD_ActionOutcome
Returns:
the outcome code of the punctual action

Implements PunctualAction.

Definition at line 17 of file ConditionalPunctualAction.cpp.

virtual TD_ActionOutcome ConditionalPunctualAction::doConditionalAction void   )  [protected, pure virtual]
 

Encapsulate implementation of the actions associated to the punctual action component.

This method is called by method doAction() in this same class. Note that users of punctual actions do not see method doAction(), they only see method execute() defined by the superclass.

See also:
doAction
Returns:
the outcome code of the punctual action

Implemented in DC_ControlAction, DC_ControlList, DC_DataPoolMonitor, and DC_DummyConditionalPunctualAction.


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