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

DC_ByteArrayTelemetryStream Class Reference

#include <DC_ByteArrayTelemetryStream.h>

Inheritance diagram for DC_ByteArrayTelemetryStream:

TelemetryStream CC_RootObject List of all members.

Detailed Description

Telemetry stream that writes the telemetry data to an array of bytes (the byte array).

Only the telemetry bytes in the telemetry item are written to the stream. Header information (the telemetry packet destination, time tag, type and subtype) are ignored. The byte array is characterized by a starting address and by a size. The starting address and the size are settable configuration parameters.

This class maintains a write counter. The write counter is reset to 0 by a call to operation reset or flush. It is incremented every time a byte is written to the byte array. If its value is smaller than the size of the byte array, then the write counter points to the location in the byte array where the next telemetry data will be written. Write requests that cannot be processed because there is not enough space in the byte array have no effect. It is the responsibility of the user to perform reset or flush operations when the byte array has been completely filled.

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

Definition at line 41 of file DC_ByteArrayTelemetryStream.h.

Public Member Functions

 DC_ByteArrayTelemetryStream (void)
 Instantiate the component.

virtual void reset (void)
 Reset the telemetry stream.

virtual void flush (void)
 The flush operation is equivalent to a reset operation.

virtual unsigned int getCapacity (void)
 Return the capacity of the telemetry stream.

void setCapacity (unsigned int n)
 Set the capacity of the telemetry stream.

void setStartingAddress (unsigned char *pAddress)
 Set the starting address of the byte array.

unsigned char * getStartingAddress (void) const
 Get the starting address of the byte array.

virtual bool doesPacketFit (TelemetryPacket *pPacket)
 Return true if there is enough space in the byte array to write the argument telemetry packet.

virtual void write (TelemetryPacket *pItem)
 Write one telemetry packet to the byte array.

virtual bool isObjectConfigured (void)
 Perform a class-specific configuration check on the telemetry stream: verify that the size and starting address of the byte array have been loaded.


Constructor & Destructor Documentation

DC_ByteArrayTelemetryStream::DC_ByteArrayTelemetryStream void   ) 
 

Instantiate the component.

The class identifier is set. The size and starting address of the byte array are set to illegal values to signify that the component is not yet configured. The write counter is set to zero.

Definition at line 17 of file DC_ByteArrayTelemetryStream.cpp.


Member Function Documentation

bool DC_ByteArrayTelemetryStream::doesPacketFit TelemetryPacket pPacket  )  [virtual]
 

Return true if there is enough space in the byte array to write the argument telemetry packet.

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

	    if ( pItem->getNumberOFBytes() greater than (N-writeCounter) )
	        return false;
	    else
          return true; 
where N is the size of the byte array and writeCounter is the value of the write counter.

Parameters:
pPacket the telemetry packet to be written to the telemetry stream
Returns:
true if there is enough space in the telemetry stream to write the telemetry packet, false otherwise

Reimplemented from TelemetryStream.

Definition at line 53 of file DC_ByteArrayTelemetryStream.cpp.

void DC_ByteArrayTelemetryStream::flush void   )  [virtual]
 

The flush operation is equivalent to a reset operation.

See also:
reset

Reimplemented from TelemetryStream.

Definition at line 29 of file DC_ByteArrayTelemetryStream.cpp.

unsigned int DC_ByteArrayTelemetryStream::getCapacity void   )  [virtual]
 

Return the capacity of the telemetry stream.

The capacity of this telemetry stream is equal to the size in bytes of the byte array.

Returns:
the size of the byte array in number of bytes

Reimplemented from TelemetryStream.

Definition at line 33 of file DC_ByteArrayTelemetryStream.cpp.

unsigned char * DC_ByteArrayTelemetryStream::getStartingAddress void   )  const
 

Get the starting address of the byte array.

Returns:
the pointer to the first location of the byte array

Definition at line 48 of file DC_ByteArrayTelemetryStream.cpp.

bool DC_ByteArrayTelemetryStream::isObjectConfigured void   )  [virtual]
 

Perform a class-specific configuration check on the telemetry stream: verify that the size and starting address of the byte array have been loaded.

Returns:
true if the telemetry stream is configured, false otherwise.

Reimplemented from CC_RootObject.

Definition at line 69 of file DC_ByteArrayTelemetryStream.cpp.

void DC_ByteArrayTelemetryStream::reset void   )  [virtual]
 

Reset the telemetry stream.

The write counter is reset to 0.

Reimplemented from TelemetryStream.

Definition at line 24 of file DC_ByteArrayTelemetryStream.cpp.

void DC_ByteArrayTelemetryStream::setCapacity unsigned int  n  ) 
 

Set the capacity of the telemetry stream.

The capacity of this telemetry stream is equal to the size in bytes of the byte array. If s is the staring address of the byte array (loaded with method setStartingAddress) and if L is the byte array size defined with this method, then the i-th location of the byte array is internally accessed as s[i] where i must be in the range [0,L-1]. It is the responsibility of the user to ensure that the locations thus accessed are free for use by this telemetry stream component. Note that the size of the byte array should be greater than 0.

See also:
setStartingAddress
Parameters:
n the size of the byte array in number of bytes

Definition at line 38 of file DC_ByteArrayTelemetryStream.cpp.

void DC_ByteArrayTelemetryStream::setStartingAddress unsigned char *  pAddress  ) 
 

Set the starting address of the byte array.

This component does not perform any memory allocation operation. It assumes that the memory for the byte array has already been allocated by the caller of this method.

Parameters:
pAddress pointer to the first location of the byte array

Definition at line 43 of file DC_ByteArrayTelemetryStream.cpp.

void DC_ByteArrayTelemetryStream::write TelemetryPacket pItem  )  [virtual]
 

Write one telemetry packet to the byte array.

The telemetry bytes read from the telemetry packet are written starting at location wc in the byte array where wc is the value of the write counter. When the end of the byte array is reached, the method returns.

Parameters:
pItem the telemetry packet to be written to the telemetry stream

Implements TelemetryStream.

Definition at line 58 of file DC_ByteArrayTelemetryStream.cpp.


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