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

DC_DummyTelecommand Class Reference

#include <DC_DummyTelecommand.h>

Inheritance diagram for DC_DummyTelecommand:

Telecommand PunctualAction CC_RootObject List of all members.

Detailed Description

Dummy telecommand that increments a counter every time it is executed.

This telecommand is useful for testing purposes. The telecommand maintains an execution counter that is initialized to zero when the telecommand object is first instantiated and is incremented by one every time the telecommand receives an execute request. There is no way to reset the execution counter.

The telecommand offer methods to change the return value of its execution check and of its validity check and to set the values of validity and execution check codes. These are useful to simulate telecommands whose execution check returns "telecommand cannot executed" or whose validity check returns "telecommand not valid".

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

Definition at line 34 of file DC_DummyTelecommand.h.

Public Member Functions

 DC_DummyTelecommand (void)
 Instantiate a dummy telecommand.

unsigned int getExecutionCounter (void)
 Getter method for the execution counter.

virtual bool canExecute (void)
 Execute the execution check on the telecommand.

virtual bool isValid (void)
 Execute the validity check on the telecommand.

virtual TD_CheckCode getValidityCheckCode (void) const
 Return the validity check code for the telecommand.

virtual TD_CheckCode getExecutionCheckCode (void) const
 Return the execution check code for the telecommand.

void setExecutionCheckValue (bool executionCheckValue)
 Set the return value of the execution check.

void setValidityCheckValue (bool validityCheckValue)
 Set the return value of the validity check.

void setValidityCheckCode (TD_CheckCode validityCheckCode)
 Set the value of the validity check code.

void setExecutionCheckCode (TD_CheckCode executionCheckCode)
 Set the value of the execution check code.


Protected Member Functions

virtual TD_ActionOutcome doAction (void)
 Increment the execution counter by one and return a code of "action successful".


Constructor & Destructor Documentation

DC_DummyTelecommand::DC_DummyTelecommand void   ) 
 

Instantiate a dummy telecommand.

The execution counter is set to zero. The telecommand is configured to have an execution check that returns: "telecommand can be executed" and a validity check that returns: "telecommand is valid". The validity and execution check codes are initialized to zero.

Definition at line 15 of file DC_DummyTelecommand.cpp.


Member Function Documentation

bool DC_DummyTelecommand::canExecute void   )  [virtual]
 

Execute the execution check on the telecommand.

A pseudo-code implementation for this method is as follows:

      return executionCheckValue; 
The internal variable executionCheckValue is initialized to TC_CANNOT_EXECUTE by the constructor but its value can be changed with method setExecutionCheckValue
See also:
setExecutionCheckValue

CC_TelecommandManager::activate

Returns:
the value of the internal variable setExecutionCheckValue

Reimplemented from Telecommand.

Definition at line 33 of file DC_DummyTelecommand.cpp.

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

Increment the execution counter by one and return a code of "action successful".

Note that there is no protection against an overflow in the value of the execution counter.

See also:
PunctualAction::execute
Returns:
always returns a "telecommand successfully executed" code

Implements PunctualAction.

Definition at line 28 of file DC_DummyTelecommand.cpp.

TD_CheckCode DC_DummyTelecommand::getExecutionCheckCode void   )  const [virtual]
 

Return the execution check code for the telecommand.

This implementation returns a user-defined value that is set with method setExecutionCheckCode.

See also:
setExecutionCheckCode
Returns:
the validity check code

Reimplemented from Telecommand.

Definition at line 53 of file DC_DummyTelecommand.cpp.

unsigned int DC_DummyTelecommand::getExecutionCounter void   ) 
 

Getter method for the execution counter.

Returns:
the execution counter

Definition at line 24 of file DC_DummyTelecommand.cpp.

TD_CheckCode DC_DummyTelecommand::getValidityCheckCode void   )  const [virtual]
 

Return the validity check code for the telecommand.

This implementation returns a user-defined value that is set with method setValidityCheckCode.

See also:
setValidityCheckCode
Returns:
the validity check code

Reimplemented from Telecommand.

Definition at line 49 of file DC_DummyTelecommand.cpp.

bool DC_DummyTelecommand::isValid void   )  [virtual]
 

Execute the validity check on the telecommand.

A pseudo-code implementation for this method is as follows:

      return validityCheckValue; 
The internal variable validityCheckValue is initialized to VALID by the constructor but its value can be changed with method setValidityCheckValue
See also:
setValidityCheckValue

CC_TelecommandManager::load

Returns:
the value of the internal variable setExecutionCheckValue

Reimplemented from Telecommand.

Definition at line 37 of file DC_DummyTelecommand.cpp.

void DC_DummyTelecommand::setExecutionCheckCode TD_CheckCode  executionCheckCode  ) 
 

Set the value of the execution check code.

This is a setter method for an internal variable which defines the return value of method getExecutionCheckCode.

See also:
getExecutionCheckCode
Parameters:
executionCheckCode the value of the validity check code

Definition at line 61 of file DC_DummyTelecommand.cpp.

void DC_DummyTelecommand::setExecutionCheckValue bool  executionCheckValue  ) 
 

Set the return value of the execution check.

This is a setter method for the internal variable executionCheckValue which defines the return value of the execution check implemented by this telecommand.

See also:
canExecute
Parameters:
executionCheckValue the value of the internal variable setExecutionCheckValue

Definition at line 41 of file DC_DummyTelecommand.cpp.

void DC_DummyTelecommand::setValidityCheckCode TD_CheckCode  validityCheckCode  ) 
 

Set the value of the validity check code.

This is a setter method for an internal variable which defines the return value of method getValidityCheckCode.

See also:
getValidityCheckCode
Parameters:
validityCheckCode the value of the validity check code

Definition at line 57 of file DC_DummyTelecommand.cpp.

void DC_DummyTelecommand::setValidityCheckValue bool  validityCheckValue  ) 
 

Set the return value of the validity check.

This is a setter method for the internal variable validityCheckValue which defines the return value of the validity check implemented by this telecommand.

See also:
isValid
Parameters:
validityCheckValue the value of the internal variable setExecutionCheckValue

Definition at line 45 of file DC_DummyTelecommand.cpp.


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