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

CC_ManoeuvreManager Class Reference
[Functionality ManagersManoeuvre Management]

#include <CC_ManoeuvreManager.h>

Inheritance diagram for CC_ManoeuvreManager:

CC_RootObject List of all members.

Detailed Description

This class encapsulates a manoeuvre manager.

The manoeuvre manager is responsible for controlling the execution of manoeuvres. Manoeuvres are loaded into the manoeuvre manager and from that moment onward their execution, termination, and abortion remain under the control of the manoeuvre manager. The manoeuvre manager sees manoeuvres as instances of type Manoeuvre.

The manoeuvre manager maintains a list of pending manoeuvres. This is called the pending manoeuvre list. The pending manoeuvres are the manouvres that are currently loaded into the manoeuvre manager and that are either executing or awaiting to start execution.

External entities typically performs three types of operations upon a manoeuvre manager. They can load a new manoeuvre in the manoeuvre manager. They can abort execution of an already loaded manoeuvre. They can activate the manoeuvre manager to advance the execution of the pending manoeuvres.

The manoeuvre manager contributes to the management of the "in use" status of manoeuvres. More precisely, before unloading a manoeuvre, the manoeuvre manager marks if as "no longer in use".

The manoeuvre manager creates event reports to record the following occurrences:<ul> Attempt to load a manoeuvre when the list of pending manoeuvres is already full A new manoeuvre is loaded A manoeuvre is unloaded In all cases, the event originator that is passed to the event creation method is the manoeuvre that is being processed. Note that the creation of event reports describing changes of state of the manoeuvre are the responsibility of the manoeuvres themselves.

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

Definition at line 64 of file CC_ManoeuvreManager.h.

Public Member Functions

 CC_ManoeuvreManager (void)
 Instantiate a manoeuvre manager.

void reset (void)
 Unload all pending manoeuvres (aborting those that are executing).

void setPendingManoeuvreListSize (const unsigned int listSize)
 Set the size of the pending manoeuvre list representing the maximum number of pending manoeuvre that can be managed by the manoeuvre manager.

unsigned int getPendingManoeuvreListSize (void)
 Get the size of the pending manoeuvre list.

unsigned int getPendingManoeuvres (void)
 Get the number of currently pending manoeuvres.

virtual void load (Manoeuvre *pManoeuvre)
 Load a manoeuvre.

virtual void abort (Manoeuvre *pManoeuvre)
 Abort a manoeuvre.

virtual void activate (void)
 Advance execution of pending manoeuvres.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check: verify that the size of the pending manoeuvre list has a legal value.


Protected Member Functions

virtual void unload (Manoeuvre *pManoeuvre)
 Unload a manoeuvre.


Constructor & Destructor Documentation

CC_ManoeuvreManager::CC_ManoeuvreManager void   ) 
 

Instantiate a manoeuvre manager.

The size of the pending manoeuvre list is initialized to an illegal value to signify that the manoeuvre manager is not yet configured. The class identifier is set.

Definition at line 17 of file CC_ManoeuvreManager.cpp.


Member Function Documentation

void CC_ManoeuvreManager::abort Manoeuvre pManoeuvre  )  [virtual]
 

Abort a manoeuvre.

An abort() request is sent to the manoeuvre and the manoeuvre is then unloaded. If the argument manoeuvre is not currently loaded, no action is taken. A pseudo-code implementation for this method is as follows:

   for (all manoeuvre m in the list of pending manoeuvres)
     if (m==pManoeuvre) {
          pManoeuvre->abort();
          pManoeuvre->setInUse(false);
          . . . // delete pManoeuvre from list of pending manoeuvres);
          createEventReport(EVT_MAN_UNLOADED);
      }
   return; 
See also:
TD_EventType

Manoeuvre::abort

Parameters:
pManoeuvre the manoeuvre to be aborted

Definition at line 97 of file CC_ManoeuvreManager.cpp.

void CC_ManoeuvreManager::activate void   )  [virtual]
 

Advance execution of pending manoeuvres.

When this method is called, the manoeuvre manager goes through the list of pending manoeuvres and processes them in sequence. This method would typically be called by an external scheduler. A pseudo-code implementation for this method is as follows:

   for (all manoeuvres m in the list of pending manoeuvres)
      if ( (!m->isExecuting()) && (m->canStart()) ) {
          m->initialize();
          m->doContinue();
      }
      else if ( (m->isExecuting()) && (m->canContinue()) )
          m->doContinue();
      else if ( (m->isExecuting()) && (!m->canContinue()) )
          m->abort();

      if ( m->isFinished() )
          m->terminate();
          unload(m);
      } 

Definition at line 115 of file CC_ManoeuvreManager.cpp.

unsigned int CC_ManoeuvreManager::getPendingManoeuvreListSize void   ) 
 

Get the size of the pending manoeuvre list.

See also:
setPendingManoeuvreListSize
Returns:
the maximum number of pending manoeuvres that can be managed by the Manoeuvre Manager

Definition at line 42 of file CC_ManoeuvreManager.cpp.

unsigned int CC_ManoeuvreManager::getPendingManoeuvres void   ) 
 

Get the number of currently pending manoeuvres.

See also:
setPendingManoeuvreListSize
Returns:
the number of currently pending manoeuvres

Definition at line 92 of file CC_ManoeuvreManager.cpp.

bool CC_ManoeuvreManager::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check: verify that the size of the pending manoeuvre list has a legal value.

Returns:
true if the telecommand manager is configured, false otherwise.

Reimplemented from CC_RootObject.

Definition at line 143 of file CC_ManoeuvreManager.cpp.

void CC_ManoeuvreManager::load Manoeuvre pManoeuvre  )  [virtual]
 

Load a manoeuvre.

When a manoeuvre is loaded, it is inserted in the list of pending manoeuvres and is then considered for execution by method activate. The manoeuvre remains loaded until it has terminated execution or is aborted.

If the list of pending manoeuvres is already full, no action is taken other than the creation of an event report to record the attempted manoeuvre load.

The manoeuvre manager creates an event whenever a new manoeuvre is loaded.

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

   if (list of pending manoeuvres is full)    // the manoeuvre list is full
   {   createEventReport(EVT_MAN_LIST_FULL);
       return;
   }
   . . .       // insert manoeuvre in list of pending manoeuvres
   createEventReport(EVT_MAN_LOADED);
   return; 
The manId parameter in the above pseudo-code is a manoeuvre identifier. This class uses the class identifier of the manoeuvre component as its identifier.
See also:
TD_EventType
Parameters:
pManoeuvre the manoeuvre that is loaded

Definition at line 47 of file CC_ManoeuvreManager.cpp.

void CC_ManoeuvreManager::reset void   ) 
 

Unload all pending manoeuvres (aborting those that are executing).

A reset bring the telecommand manager to the state where it was immediately after having being configured.

Definition at line 24 of file CC_ManoeuvreManager.cpp.

void CC_ManoeuvreManager::setPendingManoeuvreListSize const unsigned int  listSize  ) 
 

Set the size of the pending manoeuvre list representing the maximum number of pending manoeuvre that can be managed by the manoeuvre manager.

This method causes the memory for the pending manoeuvre list data structure to be allocated and the data structure to be initialized. Only positive values of the manoeuvre list size are legal.

This is an initialization method. It should be called before the manoeuvre manager is used the first time and it should not be called more than once.

Parameters:
listSize the maximum number of pending manoeuvres that can be managed by the Manoeuvre Manager. This should be a positive number.

Definition at line 32 of file CC_ManoeuvreManager.cpp.

void CC_ManoeuvreManager::unload Manoeuvre pManoeuvre  )  [protected, virtual]
 

Unload a manoeuvre.

The manoeuvre is removed from the list of pending manoeuvres and will no longer be considered for execution. The "inUse" status of the manoeuvre is changed to: "manoeuvre not in use".

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

   . . .       // remove manoeuvre from list of pending manoeuvres
   pManoeuvre->inUse(false)   // mark manoeuvre as "not in use"
   createEventReport(EVT_MAN_UNLOADED);
   return; 
The manId parameter in the above pseudo-code is a manoeuvre identifier. This class uses the class identifier of the manoeuvre component as identifier.
See also:
TD_EventType
Parameters:
pManoeuvre the manoeuvre that is loaded

Definition at line 70 of file CC_ManoeuvreManager.cpp.


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