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

CC_ManoeuvreFactory Class Reference
[Manoeuvre Management]

#include <CC_ManoeuvreFactory.h>

Inheritance diagram for CC_ManoeuvreFactory:

CC_RootObject List of all members.

Detailed Description

Dynamic factory for components of type: Manoeuvre.

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_DummyConfigurableManoeuvre: 1 Number of instances of type DC_DummyManoeuvre: 1 Number of instances of type DC_TestPUSConfigurableManoeuvre: 1 The code for this class was automatically generated by an XSL program processing the XML-based application model.

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

Definition at line 57 of file CC_ManoeuvreFactory.h.

Public Member Functions

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

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

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

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

DC_DummyConfigurableManoeuvreallocateDummyConfigurableManoeuvre ()
 Allocate one instance of type DC_DummyConfigurableManoeuvre.

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

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

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

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

DC_DummyManoeuvreallocateDummyManoeuvre ()
 Allocate one instance of type DC_DummyManoeuvre.

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

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

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

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

DC_TestPUSConfigurableManoeuvreallocateTestPUSConfigurableManoeuvre ()
 Allocate one instance of type DC_TestPUSConfigurableManoeuvre.

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


Static Public Member Functions

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


Protected Member Functions

 CC_ManoeuvreFactory (void)
 Instantiate the factory component.


Constructor & Destructor Documentation

CC_ManoeuvreFactory::CC_ManoeuvreFactory 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 23 of file CC_ManoeuvreFactory.cpp.


Member Function Documentation

DC_DummyConfigurableManoeuvre * CC_ManoeuvreFactory::allocateDummyConfigurableManoeuvre  ) 
 

Allocate one instance of type DC_DummyConfigurableManoeuvre.

This method scans all the entries in the factory of type DC_DummyConfigurableManoeuvre 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 101 of file CC_ManoeuvreFactory.cpp.

DC_DummyManoeuvre * CC_ManoeuvreFactory::allocateDummyManoeuvre  ) 
 

Allocate one instance of type DC_DummyManoeuvre.

This method scans all the entries in the factory of type DC_DummyManoeuvre 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 141 of file CC_ManoeuvreFactory.cpp.

DC_TestPUSConfigurableManoeuvre * CC_ManoeuvreFactory::allocateTestPUSConfigurableManoeuvre  ) 
 

Allocate one instance of type DC_TestPUSConfigurableManoeuvre.

This method scans all the entries in the factory of type DC_TestPUSConfigurableManoeuvre 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 181 of file CC_ManoeuvreFactory.cpp.

unsigned int CC_ManoeuvreFactory::getCapacityDummyConfigurableManoeuvre void   ) 
 

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

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

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

Definition at line 96 of file CC_ManoeuvreFactory.cpp.

unsigned int CC_ManoeuvreFactory::getCapacityDummyManoeuvre void   ) 
 

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

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

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

Definition at line 136 of file CC_ManoeuvreFactory.cpp.

unsigned int CC_ManoeuvreFactory::getCapacityTestPUSConfigurableManoeuvre void   ) 
 

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

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

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

Definition at line 176 of file CC_ManoeuvreFactory.cpp.

CC_ManoeuvreFactory * CC_ManoeuvreFactory::getInstance void   )  [static]
 

Get the single instance of this singleton class.

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

Definition at line 74 of file CC_ManoeuvreFactory.cpp.

unsigned int CC_ManoeuvreFactory::getNumberDummyConfigurableManoeuvre void   ) 
 

Return the number of component instances of type DC_DummyConfigurableManoeuvre 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 88 of file CC_ManoeuvreFactory.cpp.

unsigned int CC_ManoeuvreFactory::getNumberDummyManoeuvre void   ) 
 

Return the number of component instances of type DC_DummyManoeuvre 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 128 of file CC_ManoeuvreFactory.cpp.

unsigned int CC_ManoeuvreFactory::getNumberTestPUSConfigurableManoeuvre void   ) 
 

Return the number of component instances of type DC_TestPUSConfigurableManoeuvre 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 168 of file CC_ManoeuvreFactory.cpp.

bool CC_ManoeuvreFactory::isFreeDummyConfigurableManoeuvre  ) 
 

Check whether a non-allocated component instance of type DC_DummyConfigurableManoeuvre 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_DummyConfigurableManoeuvre
Returns:
true if free instances of type DC_DummyConfigurableManoeuvre are available, false otherwise

Definition at line 111 of file CC_ManoeuvreFactory.cpp.

bool CC_ManoeuvreFactory::isFreeDummyManoeuvre  ) 
 

Check whether a non-allocated component instance of type DC_DummyManoeuvre 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_DummyManoeuvre
Returns:
true if free instances of type DC_DummyManoeuvre are available, false otherwise

Definition at line 151 of file CC_ManoeuvreFactory.cpp.

bool CC_ManoeuvreFactory::isFreeTestPUSConfigurableManoeuvre  ) 
 

Check whether a non-allocated component instance of type DC_TestPUSConfigurableManoeuvre 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_TestPUSConfigurableManoeuvre
Returns:
true if free instances of type DC_TestPUSConfigurableManoeuvre are available, false otherwise

Definition at line 191 of file CC_ManoeuvreFactory.cpp.

bool CC_ManoeuvreFactory::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 44 of file CC_ManoeuvreFactory.cpp.

void CC_ManoeuvreFactory::setManoeuvre unsigned int  i,
DC_TestPUSConfigurableManoeuvre pItem
 

Load one instance of type DC_TestPUSConfigurableManoeuvre 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_TestPUSConfigurableManoeuvre. 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 161 of file CC_ManoeuvreFactory.cpp.

void CC_ManoeuvreFactory::setManoeuvre unsigned int  i,
DC_DummyManoeuvre pItem
 

Load one instance of type DC_DummyManoeuvre 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_DummyManoeuvre. 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 121 of file CC_ManoeuvreFactory.cpp.

void CC_ManoeuvreFactory::setManoeuvre unsigned int  i,
DC_DummyConfigurableManoeuvre pItem
 

Load one instance of type DC_DummyConfigurableManoeuvre 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_DummyConfigurableManoeuvre. 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 81 of file CC_ManoeuvreFactory.cpp.


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