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

DC_PUSTelemetryModeManager Class Reference
[Packet Utilization Standard (PUS)]

#include <DC_PUSTelemetryModeManager.h>

Inheritance diagram for DC_PUSTelemetryModeManager:

TelemetryModeManager ModeManager CC_RootObject List of all members.

Detailed Description

PUS telemetry mode manager.

This telemetry mode manager has one single mode to which there corresponds a set of PUS data reporting telemetry packets (instances of class PUSDataReportingPacket). The telemetry packets can be loaded and unloaded dynamically. The iteration methods iterate through all the currently loaded telemetry packets (the order of the iteration is undefined). The mode manager is configured with the maximum number of telemetry packets that it can hold (method setMaxNumberOfPackets). An initialization sequence for this class consists of the following steps (to be performed in the order given):

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

Definition at line 37 of file DC_PUSTelemetryModeManager.h.

Public Member Functions

 DC_PUSTelemetryModeManager (void)
 Instantiate a PUS telemetry mode manager.

virtual void update (void)
 This method return without taking any action.

virtual TelemetryPacketgetIterationTelemetryPacket (void)
 Retrieve the telemetry packet currently scanned by the iteration counter.

void loadPacket (DC_PUSDataReportingPacket *pItem)
 Load a telemetry packet in the set of packets managed by this mode manager.

void unloadPacket (TD_SID sid)
 Unload the PUS telemetry packet identified by the argument SID.

bool isFull () const
 Check whether the mode manager is full.

unsigned int getNumberOfPackets () const
 Return the number of packets that are currently loaded.

bool isSIDLoaded (TD_SID sid) const
 Check whether the packet with the argument SID is currently loaded.

void setMaxNumberOfPackets (unsigned int n)
 Set the maximum number of packets that can be loaded.

unsigned int getMaxNumberOfPackets () const
 Return the maximum number of packets that can be loaded.

virtual void first (void)
 Iteration method to iterate through the currently loaded telemetry packets.

virtual void next (void)
 Iteration method to be used in conjunction with methods first and isIterationFinished.

virtual bool isIterationFinished (void)
 Iteration method to be used in conjunction with methods first and next.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check on a telemetry mode manager: verify that the maximum number of telemetry packets that can be loaded has been set.


Protected Member Functions

virtual void allocateMemory (TD_Mode numberOfModes)
 This method returns without taking any action.


Constructor & Destructor Documentation

DC_PUSTelemetryModeManager::DC_PUSTelemetryModeManager void   ) 
 

Instantiate a PUS telemetry mode manager.

The class identifier is set. The number of modes is initialized to 1. The single mode is declared to be the default mode. The size of the set of telemetry packet is initialized with illegal values to signify that the component is not yet configured.

Definition at line 18 of file DC_PUSTelemetryModeManager.cpp.


Member Function Documentation

void DC_PUSTelemetryModeManager::allocateMemory TD_Mode  numberOfModes  )  [protected, virtual]
 

This method returns without taking any action.

This method is unnecessary in this class because no mode-dependent memory data structures need to be allocated.

See also:
setNumberOfModes
Parameters:
numberOfModes the number of modes

Implements ModeManager.

Definition at line 29 of file DC_PUSTelemetryModeManager.cpp.

void DC_PUSTelemetryModeManager::first void   )  [virtual]
 

Iteration method to iterate through the currently loaded telemetry packets.

This method should be used jointly with methods: next, isIterationFinished and getIterationTelemetryPacket. Taken together, these methods allow all the currently loaded items to be scanned. The item currently scanned can be retrieved through method getIterationTelemetryPacket. Thus, a typical iteration cycle might be organized as follows:

      for (first(); !isIterationFinished(); next()) {
          pItem = getIterationTelemetryPacket();
          . . .    // process pItem
      }  

Implements TelemetryModeManager.

Definition at line 107 of file DC_PUSTelemetryModeManager.cpp.

TelemetryPacket * DC_PUSTelemetryModeManager::getIterationTelemetryPacket void   )  [virtual]
 

Retrieve the telemetry packet currently scanned by the iteration counter.

This method should only be used within an iteration cycle. This method should only be used within an iteration cycle (i.e. while isIterationFinished reports false).

See also:
TelemetryModeManager::first
Returns:
the item currently scanned by the iteration counter

Implements TelemetryModeManager.

Definition at line 127 of file DC_PUSTelemetryModeManager.cpp.

unsigned int DC_PUSTelemetryModeManager::getMaxNumberOfPackets  )  const
 

Return the maximum number of packets that can be loaded.

Returns:
maximum number of packets that can be loaded

Definition at line 73 of file DC_PUSTelemetryModeManager.cpp.

unsigned int DC_PUSTelemetryModeManager::getNumberOfPackets  )  const
 

Return the number of packets that are currently loaded.

Returns:
number of packets currently loaded

Definition at line 69 of file DC_PUSTelemetryModeManager.cpp.

bool DC_PUSTelemetryModeManager::isFull  )  const
 

Check whether the mode manager is full.

See also:
loadPacket
Returns:
true if no packets are currently loaded

Definition at line 65 of file DC_PUSTelemetryModeManager.cpp.

bool DC_PUSTelemetryModeManager::isIterationFinished void   )  [virtual]
 

Iteration method to be used in conjunction with methods first and next.

This method should only be used as part of an iteration cycle. The result of calling it before ever calling first is undefined.

See also:
first
Returns:
true if the end of the iteration has been reached, false otherwise

Implements TelemetryModeManager.

Definition at line 121 of file DC_PUSTelemetryModeManager.cpp.

bool DC_PUSTelemetryModeManager::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check on a telemetry mode manager: verify that the maximum number of telemetry packets that can be loaded has been set.

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

Reimplemented from ModeManager.

Definition at line 133 of file DC_PUSTelemetryModeManager.cpp.

bool DC_PUSTelemetryModeManager::isSIDLoaded TD_SID  sid  )  const
 

Check whether the packet with the argument SID is currently loaded.

See also:
unloadPacket
Parameters:
sid the SID
Returns:
true if a packet with the argument SID is currently loaded

Definition at line 94 of file DC_PUSTelemetryModeManager.cpp.

void DC_PUSTelemetryModeManager::loadPacket DC_PUSDataReportingPacket pItem  ) 
 

Load a telemetry packet in the set of packets managed by this mode manager.

If the set is already full, then an event of type EVT_ILLEGAL_MM is generated. Before calling this method, clients should call method isFull to check whether there is space available.

Parameters:
pItem the item to be loaded

Definition at line 48 of file DC_PUSTelemetryModeManager.cpp.

void DC_PUSTelemetryModeManager::next void   )  [virtual]
 

Iteration method to be used in conjunction with methods first and isIterationFinished.

This method should only be called as part of an iteration cycle.

See also:
first

Implements TelemetryModeManager.

Definition at line 114 of file DC_PUSTelemetryModeManager.cpp.

void DC_PUSTelemetryModeManager::setMaxNumberOfPackets unsigned int  n  ) 
 

Set the maximum number of packets that can be loaded.

This is an initialization method. It should only be called once. Only positive values for the maximum number of packets are legal.

Parameters:
n the maximum number of packets

Definition at line 37 of file DC_PUSTelemetryModeManager.cpp.

void DC_PUSTelemetryModeManager::unloadPacket TD_SID  sid  ) 
 

Unload the PUS telemetry packet identified by the argument SID.

If none of the currently loaded packets matches the given SID (or if the set is currently empty), no action is taken other than generating an event report of type EVT_SID_NOT_FOUND. Method isSIDLoaded can be used to check whether a packet with a certain SID is currently loaded.

Parameters:
sid the SID of the packet to be unloaded

Definition at line 77 of file DC_PUSTelemetryModeManager.cpp.

void DC_PUSTelemetryModeManager::update void   )  [virtual]
 

This method return without taking any action.

This mode manager has only one mode and therefore the update operation is implemented to return without taking any action.

See also:
ModeManager::update

Implements ModeManager.

Definition at line 33 of file DC_PUSTelemetryModeManager.cpp.


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