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

CC_TelemetryPacketFactory Class Reference

#include <CC_TelemetryPacketFactory.h>

Inheritance diagram for CC_TelemetryPacketFactory:

CC_RootObject List of all members.

Detailed Description

Dynamic factory for components of type: TelemetryPacket.

A dynamic factory is a component that manages a pool of instances of components of a certain type. Clients of the factory can require one of these instances at run-time. After the factory hands over a component instance to its client, the instance is marked as "in use" and cannot be given to any other clients. When the requesting client has finished using the instance, it should release it by marking it as "no longer in use". This will allow the factory to make it available to other clients that request it. The "in use" status of the component instances is controlled through method setInUse declared on the component instances.

A dynamic factory is configured in two steps. The first step is performed by the factory constructor when the internal data structures to hold the component instances are created. The second step is performed during application initialization when the component instances are loaded in the factory. Reconfiguration at run time during normal application operation is not allowed.

Dynamic factories are implemented as singletons. They can exist in one single instance that can be accessed through the getInstance method. The one single instance of the class is created the first time that method getInstance is called. In order to avoid possible disruptions of real-time behaviour, applications should ensure that this method has been called at least once before the application enters its operational phase.

This factory manages the following component instances:<ul> Number of instances of type DC_DummyPUSTelemetryPacket: 2 Number of instances of type DC_PUSDataReportingPacket: 2 Number of instances of type DC_PUSMemoryDumpAbsolute: 1 Number of instances of type DC_PUSMemoryDumpOffset: 1 Number of instances of type DC_PUSTcVerificationPacket: 1 The code for this class was automatically generated by an XSL program processing the XML-based application model.

See also:
TelemetryPacket
Author:
Automatically Generated Class
Version:
1.0

Definition at line 61 of file CC_TelemetryPacketFactory.h.

Public Member Functions

virtual bool isObjectConfigured ()
 Check that all component instances required by the factory have been loaded.

void setTelemetryPacket (unsigned int i, DC_DummyPUSTelemetryPacket *pItem)
 Load one instance of type DC_DummyPUSTelemetryPacket in the factory.

unsigned int getNumberDummyPUSTelemetryPacket (void)
 Return the number of component instances of type DC_DummyPUSTelemetryPacket that are currently allocated.

unsigned int getCapacityDummyPUSTelemetryPacket (void)
 Return the number of component instances of type DC_DummyPUSTelemetryPacket that are in the factory.

DC_DummyPUSTelemetryPacketallocateDummyPUSTelemetryPacket ()
 Allocate one instance of type DC_DummyPUSTelemetryPacket.

bool isFreeDummyPUSTelemetryPacket ()
 Check whether a non-allocated component instance of type DC_DummyPUSTelemetryPacket is available within the factory.

void setTelemetryPacket (unsigned int i, DC_PUSDataReportingPacket *pItem)
 Load one instance of type DC_PUSDataReportingPacket in the factory.

unsigned int getNumberPUSDataReportingPacket (void)
 Return the number of component instances of type DC_PUSDataReportingPacket that are currently allocated.

unsigned int getCapacityPUSDataReportingPacket (void)
 Return the number of component instances of type DC_PUSDataReportingPacket that are in the factory.

DC_PUSDataReportingPacketallocatePUSDataReportingPacket (unsigned int DefinitionBufferSize, unsigned int ValueBufferSize, unsigned int MaxNumberFA)
 Allocate one instance of type DC_PUSDataReportingPacket.

bool isFreePUSDataReportingPacket (unsigned int DefinitionBufferSize, unsigned int ValueBufferSize, unsigned int MaxNumberFA)
 Check whether a non-allocated component instance of type DC_PUSDataReportingPacket is available within the factory.

DC_PUSDataReportingPacketgetPUSDataReportingPacket (TD_SID sid)
 Return the PUS data reporting packet that is currently allocated and whose SID is equal to the value of the argument sid.

void setTelemetryPacket (unsigned int i, DC_PUSMemoryDumpAbsolute *pItem)
 Load one instance of type DC_PUSMemoryDumpAbsolute in the factory.

unsigned int getNumberPUSMemoryDumpAbsolute (void)
 Return the number of component instances of type DC_PUSMemoryDumpAbsolute that are currently allocated.

unsigned int getCapacityPUSMemoryDumpAbsolute (void)
 Return the number of component instances of type DC_PUSMemoryDumpAbsolute that are in the factory.

DC_PUSMemoryDumpAbsoluteallocatePUSMemoryDumpAbsolute (unsigned int MaxNumberBlocks, unsigned int DumpBufferSize)
 Allocate one instance of type DC_PUSMemoryDumpAbsolute.

bool isFreePUSMemoryDumpAbsolute (unsigned int MaxNumberBlocks, unsigned int DumpBufferSize)
 Check whether a non-allocated component instance of type DC_PUSMemoryDumpAbsolute is available within the factory.

void setTelemetryPacket (unsigned int i, DC_PUSMemoryDumpOffset *pItem)
 Load one instance of type DC_PUSMemoryDumpOffset in the factory.

unsigned int getNumberPUSMemoryDumpOffset (void)
 Return the number of component instances of type DC_PUSMemoryDumpOffset that are currently allocated.

unsigned int getCapacityPUSMemoryDumpOffset (void)
 Return the number of component instances of type DC_PUSMemoryDumpOffset that are in the factory.

DC_PUSMemoryDumpOffsetallocatePUSMemoryDumpOffset (unsigned int MaxNumberBlocks, unsigned int DumpBufferSize)
 Allocate one instance of type DC_PUSMemoryDumpOffset.

bool isFreePUSMemoryDumpOffset (unsigned int MaxNumberBlocks, unsigned int DumpBufferSize)
 Check whether a non-allocated component instance of type DC_PUSMemoryDumpOffset is available within the factory.

void setTelemetryPacket (unsigned int i, DC_PUSTcVerificationPacket *pItem)
 Load one instance of type DC_PUSTcVerificationPacket in the factory.

unsigned int getNumberPUSTcVerificationPacket (void)
 Return the number of component instances of type DC_PUSTcVerificationPacket that are currently allocated.

unsigned int getCapacityPUSTcVerificationPacket (void)
 Return the number of component instances of type DC_PUSTcVerificationPacket that are in the factory.

DC_PUSTcVerificationPacketallocatePUSTcVerificationPacket ()
 Allocate one instance of type DC_PUSTcVerificationPacket.

bool isFreePUSTcVerificationPacket ()
 Check whether a non-allocated component instance of type DC_PUSTcVerificationPacket is available within the factory.


Static Public Member Functions

CC_TelemetryPacketFactorygetInstance (void)
 Get the single instance of this singleton class.


Protected Member Functions

 CC_TelemetryPacketFactory (void)
 Instantiate the factory component.


Constructor & Destructor Documentation

CC_TelemetryPacketFactory::CC_TelemetryPacketFactory void   )  [protected]
 

Instantiate the factory component.

The class identifier is set and the internal data structures to hold the component instances managed by the factory are created. This constructor is defined to be protected because this is a singleton class.

Definition at line 25 of file CC_TelemetryPacketFactory.cpp.


Member Function Documentation

DC_DummyPUSTelemetryPacket * CC_TelemetryPacketFactory::allocateDummyPUSTelemetryPacket  ) 
 

Allocate one instance of type DC_DummyPUSTelemetryPacket.

This method scans all the entries in the factory of type DC_DummyPUSTelemetryPacket and returns the first one which is not in use. Before being returned to the caller, the status of the component instance is changed to: "in use". A client that receives a component instance through a call to this method, should release the instance when it no longer needs it. This can be done by calling method setInUse(false) on the component itself.

If no free component instances are found, then the method returns null. Note that no event report is generated to record the failure to allocate a component instance. Event reporting is the responsibility of the caller.

Returns:
the allocated component instance or null if no free instances were found

Definition at line 127 of file CC_TelemetryPacketFactory.cpp.

DC_PUSDataReportingPacket * CC_TelemetryPacketFactory::allocatePUSDataReportingPacket unsigned int  DefinitionBufferSize,
unsigned int  ValueBufferSize,
unsigned int  MaxNumberFA
 

Allocate one instance of type DC_PUSDataReportingPacket.

This method scans all the entries in the factory of type DC_PUSDataReportingPacket and returns the first one which is not in use. In addition to verifyin that the returned component is not in use, this method also performs a check on the value of the component configuration parameters. The folloging configuration parameters are checked: DefinitionBufferSize, ValueBufferSize, MaxNumberFA. This method has a parameter matching each component configuration parameter. A component instance is returned only if the value of the component configuration parameter is greater than or equal to the method parameter. Before being returned to the caller, the status of the component instance is changed to: "in use". A client that receives a component instance through a call to this method, should release the instance when it no longer needs it. This can be done by calling method setInUse(false) on the component itself.

If no free component instances are found, then the method returns null. Note that no event report is generated to record the failure to allocate a component instance. Event reporting is the responsibility of the caller.

Parameters:
DefinitionBufferSize minimum value for a component configuration parameter
ValueBufferSize minimum value for a component configuration parameter
MaxNumberFA minimum value for a component configuration parameter
Returns:
the allocated component instance or null if no free instances were found

Definition at line 167 of file CC_TelemetryPacketFactory.cpp.

DC_PUSMemoryDumpAbsolute * CC_TelemetryPacketFactory::allocatePUSMemoryDumpAbsolute unsigned int  MaxNumberBlocks,
unsigned int  DumpBufferSize
 

Allocate one instance of type DC_PUSMemoryDumpAbsolute.

This method scans all the entries in the factory of type DC_PUSMemoryDumpAbsolute and returns the first one which is not in use. In addition to verifyin that the returned component is not in use, this method also performs a check on the value of the component configuration parameters. The folloging configuration parameters are checked: MaxNumberBlocks, DumpBufferSize. This method has a parameter matching each component configuration parameter. A component instance is returned only if the value of the component configuration parameter is greater than or equal to the method parameter. Before being returned to the caller, the status of the component instance is changed to: "in use". A client that receives a component instance through a call to this method, should release the instance when it no longer needs it. This can be done by calling method setInUse(false) on the component itself.

If no free component instances are found, then the method returns null. Note that no event report is generated to record the failure to allocate a component instance. Event reporting is the responsibility of the caller.

Parameters:
MaxNumberBlocks minimum value for a component configuration parameter
DumpBufferSize minimum value for a component configuration parameter
Returns:
the allocated component instance or null if no free instances were found

Definition at line 224 of file CC_TelemetryPacketFactory.cpp.

DC_PUSMemoryDumpOffset * CC_TelemetryPacketFactory::allocatePUSMemoryDumpOffset unsigned int  MaxNumberBlocks,
unsigned int  DumpBufferSize
 

Allocate one instance of type DC_PUSMemoryDumpOffset.

This method scans all the entries in the factory of type DC_PUSMemoryDumpOffset and returns the first one which is not in use. In addition to verifyin that the returned component is not in use, this method also performs a check on the value of the component configuration parameters. The folloging configuration parameters are checked: MaxNumberBlocks, DumpBufferSize. This method has a parameter matching each component configuration parameter. A component instance is returned only if the value of the component configuration parameter is greater than or equal to the method parameter. Before being returned to the caller, the status of the component instance is changed to: "in use". A client that receives a component instance through a call to this method, should release the instance when it no longer needs it. This can be done by calling method setInUse(false) on the component itself.

If no free component instances are found, then the method returns null. Note that no event report is generated to record the failure to allocate a component instance. Event reporting is the responsibility of the caller.

Parameters:
MaxNumberBlocks minimum value for a component configuration parameter
DumpBufferSize minimum value for a component configuration parameter
Returns:
the allocated component instance or null if no free instances were found

Definition at line 268 of file CC_TelemetryPacketFactory.cpp.

DC_PUSTcVerificationPacket * CC_TelemetryPacketFactory::allocatePUSTcVerificationPacket  ) 
 

Allocate one instance of type DC_PUSTcVerificationPacket.

This method scans all the entries in the factory of type DC_PUSTcVerificationPacket and returns the first one which is not in use. Before being returned to the caller, the status of the component instance is changed to: "in use". A client that receives a component instance through a call to this method, should release the instance when it no longer needs it. This can be done by calling method setInUse(false) on the component itself.

If no free component instances are found, then the method returns null. Note that no event report is generated to record the failure to allocate a component instance. Event reporting is the responsibility of the caller.

Returns:
the allocated component instance or null if no free instances were found

Definition at line 312 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getCapacityDummyPUSTelemetryPacket void   ) 
 

Return the number of component instances of type DC_DummyPUSTelemetryPacket that are in the factory.

The value returned is the maximum number of component instances of type DC_DummyPUSTelemetryPacket that can be allocated.

Returns:
the total number of component instances in the factory of type DC_DummyPUSTelemetryPacket

Definition at line 122 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getCapacityPUSDataReportingPacket void   ) 
 

Return the number of component instances of type DC_PUSDataReportingPacket that are in the factory.

The value returned is the maximum number of component instances of type DC_PUSDataReportingPacket that can be allocated.

Returns:
the total number of component instances in the factory of type DC_PUSDataReportingPacket

Definition at line 162 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getCapacityPUSMemoryDumpAbsolute void   ) 
 

Return the number of component instances of type DC_PUSMemoryDumpAbsolute that are in the factory.

The value returned is the maximum number of component instances of type DC_PUSMemoryDumpAbsolute that can be allocated.

Returns:
the total number of component instances in the factory of type DC_PUSMemoryDumpAbsolute

Definition at line 219 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getCapacityPUSMemoryDumpOffset void   ) 
 

Return the number of component instances of type DC_PUSMemoryDumpOffset that are in the factory.

The value returned is the maximum number of component instances of type DC_PUSMemoryDumpOffset that can be allocated.

Returns:
the total number of component instances in the factory of type DC_PUSMemoryDumpOffset

Definition at line 263 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getCapacityPUSTcVerificationPacket void   ) 
 

Return the number of component instances of type DC_PUSTcVerificationPacket that are in the factory.

The value returned is the maximum number of component instances of type DC_PUSTcVerificationPacket that can be allocated.

Returns:
the total number of component instances in the factory of type DC_PUSTcVerificationPacket

Definition at line 307 of file CC_TelemetryPacketFactory.cpp.

CC_TelemetryPacketFactory * CC_TelemetryPacketFactory::getInstance void   )  [static]
 

Get the single instance of this singleton class.

If the instance does not yet exist, it is created.

Definition at line 100 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getNumberDummyPUSTelemetryPacket void   ) 
 

Return the number of component instances of type DC_DummyPUSTelemetryPacket that are currently allocated.

A component instance is allocated if its "in use" status is equal to: "component is in use".

Returns:
the number of allocated component instances

Definition at line 114 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getNumberPUSDataReportingPacket void   ) 
 

Return the number of component instances of type DC_PUSDataReportingPacket that are currently allocated.

A component instance is allocated if its "in use" status is equal to: "component is in use".

Returns:
the number of allocated component instances

Definition at line 154 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getNumberPUSMemoryDumpAbsolute void   ) 
 

Return the number of component instances of type DC_PUSMemoryDumpAbsolute that are currently allocated.

A component instance is allocated if its "in use" status is equal to: "component is in use".

Returns:
the number of allocated component instances

Definition at line 211 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getNumberPUSMemoryDumpOffset void   ) 
 

Return the number of component instances of type DC_PUSMemoryDumpOffset that are currently allocated.

A component instance is allocated if its "in use" status is equal to: "component is in use".

Returns:
the number of allocated component instances

Definition at line 255 of file CC_TelemetryPacketFactory.cpp.

unsigned int CC_TelemetryPacketFactory::getNumberPUSTcVerificationPacket void   ) 
 

Return the number of component instances of type DC_PUSTcVerificationPacket that are currently allocated.

A component instance is allocated if its "in use" status is equal to: "component is in use".

Returns:
the number of allocated component instances

Definition at line 299 of file CC_TelemetryPacketFactory.cpp.

DC_PUSDataReportingPacket * CC_TelemetryPacketFactory::getPUSDataReportingPacket TD_SID  sid  ) 
 

Return the PUS data reporting packet that is currently allocated and whose SID is equal to the value of the argument sid.

This method scans all the instances of type DC_PUSDataReportingPacket in the factory and, if it finds one which is allocated (its status is "in use") and with the SID equal to sid, it returns it. Otherwise, a null pointer is returned.

Parameters:
sid the structure identifier (SID) of the PUS data reporting packet
Returns:
the sought PUS data reporting packet or null if no allocated data reporting packet with SID equal to sid is found

Definition at line 192 of file CC_TelemetryPacketFactory.cpp.

bool CC_TelemetryPacketFactory::isFreeDummyPUSTelemetryPacket  ) 
 

Check whether a non-allocated component instance of type DC_DummyPUSTelemetryPacket is available within the factory.

If this method return true, then the corresponding allocate method is guaranteed to return a non-null value. The method parameters are used as in the corresponding allocate method.

See also:
#allocateDC_DummyPUSTelemetryPacket
Returns:
true if free instances of type DC_DummyPUSTelemetryPacket are available, false otherwise

Definition at line 137 of file CC_TelemetryPacketFactory.cpp.

bool CC_TelemetryPacketFactory::isFreePUSDataReportingPacket unsigned int  DefinitionBufferSize,
unsigned int  ValueBufferSize,
unsigned int  MaxNumberFA
 

Check whether a non-allocated component instance of type DC_PUSDataReportingPacket is available within the factory.

If this method return true, then the corresponding allocate method is guaranteed to return a non-null value. The method parameters are used as in the corresponding allocate method.

See also:
#allocateDC_PUSDataReportingPacket
Parameters:
DefinitionBufferSize minimum value for a component configuration parameter
ValueBufferSize minimum value for a component configuration parameter
MaxNumberFA minimum value for a component configuration parameter
Returns:
true if free instances of type DC_PUSDataReportingPacket are available, false otherwise

Definition at line 180 of file CC_TelemetryPacketFactory.cpp.

bool CC_TelemetryPacketFactory::isFreePUSMemoryDumpAbsolute unsigned int  MaxNumberBlocks,
unsigned int  DumpBufferSize
 

Check whether a non-allocated component instance of type DC_PUSMemoryDumpAbsolute is available within the factory.

If this method return true, then the corresponding allocate method is guaranteed to return a non-null value. The method parameters are used as in the corresponding allocate method.

See also:
#allocateDC_PUSMemoryDumpAbsolute
Parameters:
MaxNumberBlocks minimum value for a component configuration parameter
DumpBufferSize minimum value for a component configuration parameter
Returns:
true if free instances of type DC_PUSMemoryDumpAbsolute are available, false otherwise

Definition at line 236 of file CC_TelemetryPacketFactory.cpp.

bool CC_TelemetryPacketFactory::isFreePUSMemoryDumpOffset unsigned int  MaxNumberBlocks,
unsigned int  DumpBufferSize
 

Check whether a non-allocated component instance of type DC_PUSMemoryDumpOffset is available within the factory.

If this method return true, then the corresponding allocate method is guaranteed to return a non-null value. The method parameters are used as in the corresponding allocate method.

See also:
#allocateDC_PUSMemoryDumpOffset
Parameters:
MaxNumberBlocks minimum value for a component configuration parameter
DumpBufferSize minimum value for a component configuration parameter
Returns:
true if free instances of type DC_PUSMemoryDumpOffset are available, false otherwise

Definition at line 280 of file CC_TelemetryPacketFactory.cpp.

bool CC_TelemetryPacketFactory::isFreePUSTcVerificationPacket  ) 
 

Check whether a non-allocated component instance of type DC_PUSTcVerificationPacket is available within the factory.

If this method return true, then the corresponding allocate method is guaranteed to return a non-null value. The method parameters are used as in the corresponding allocate method.

See also:
#allocateDC_PUSTcVerificationPacket
Returns:
true if free instances of type DC_PUSTcVerificationPacket are available, false otherwise

Definition at line 322 of file CC_TelemetryPacketFactory.cpp.

bool CC_TelemetryPacketFactory::isObjectConfigured  )  [virtual]
 

Check that all component instances required by the factory have been loaded.

Returns:
true if the component is configured, false otherwise

Reimplemented from CC_RootObject.

Definition at line 56 of file CC_TelemetryPacketFactory.cpp.

void CC_TelemetryPacketFactory::setTelemetryPacket unsigned int  i,
DC_PUSTcVerificationPacket pItem
 

Load one instance of type DC_PUSTcVerificationPacket in the factory.

The component instances managed by the factory are internally stored in an array. This method loads the i-th element of the array. The argument i should lie in the interval [0,N-1] where N is the number of component instances of type DC_PUSTcVerificationPacket. The value of N is defined by the class constructor.

The "in use" status of a newly loaded component is initialized to: "component is not in use".

This is an initialization method that should only be called during the application configuration phase.

Parameters:
i the index in the internal array
pItem the component instance

Definition at line 292 of file CC_TelemetryPacketFactory.cpp.

void CC_TelemetryPacketFactory::setTelemetryPacket unsigned int  i,
DC_PUSMemoryDumpOffset pItem
 

Load one instance of type DC_PUSMemoryDumpOffset in the factory.

The component instances managed by the factory are internally stored in an array. This method loads the i-th element of the array. The argument i should lie in the interval [0,N-1] where N is the number of component instances of type DC_PUSMemoryDumpOffset. The value of N is defined by the class constructor.

The "in use" status of a newly loaded component is initialized to: "component is not in use".

This is an initialization method that should only be called during the application configuration phase.

Parameters:
i the index in the internal array
pItem the component instance

Definition at line 248 of file CC_TelemetryPacketFactory.cpp.

void CC_TelemetryPacketFactory::setTelemetryPacket unsigned int  i,
DC_PUSMemoryDumpAbsolute pItem
 

Load one instance of type DC_PUSMemoryDumpAbsolute in the factory.

The component instances managed by the factory are internally stored in an array. This method loads the i-th element of the array. The argument i should lie in the interval [0,N-1] where N is the number of component instances of type DC_PUSMemoryDumpAbsolute. The value of N is defined by the class constructor.

The "in use" status of a newly loaded component is initialized to: "component is not in use".

This is an initialization method that should only be called during the application configuration phase.

Parameters:
i the index in the internal array
pItem the component instance

Definition at line 204 of file CC_TelemetryPacketFactory.cpp.

void CC_TelemetryPacketFactory::setTelemetryPacket unsigned int  i,
DC_PUSDataReportingPacket pItem
 

Load one instance of type DC_PUSDataReportingPacket in the factory.

The component instances managed by the factory are internally stored in an array. This method loads the i-th element of the array. The argument i should lie in the interval [0,N-1] where N is the number of component instances of type DC_PUSDataReportingPacket. The value of N is defined by the class constructor.

The "in use" status of a newly loaded component is initialized to: "component is not in use".

This is an initialization method that should only be called during the application configuration phase.

Parameters:
i the index in the internal array
pItem the component instance

Definition at line 147 of file CC_TelemetryPacketFactory.cpp.

void CC_TelemetryPacketFactory::setTelemetryPacket unsigned int  i,
DC_DummyPUSTelemetryPacket pItem
 

Load one instance of type DC_DummyPUSTelemetryPacket in the factory.

The component instances managed by the factory are internally stored in an array. This method loads the i-th element of the array. The argument i should lie in the interval [0,N-1] where N is the number of component instances of type DC_DummyPUSTelemetryPacket. The value of N is defined by the class constructor.

The "in use" status of a newly loaded component is initialized to: "component is not in use".

This is an initialization method that should only be called during the application configuration phase.

Parameters:
i the index in the internal array
pItem the component instance

Definition at line 107 of file CC_TelemetryPacketFactory.cpp.


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