index previous next 

file name: classman.hpp, classman.cpp
classification: simulation
contents: class CClassManager, class CAlgorithmManager, derived from CClassManager, class CNetworkManager, derived from CClassManager
use: provides facilities for dynamic installation of network and algorithm classes
 

global items used by CClassManager:

 
member variables of CClassManager:

INT32 **createFunction_: the array of function pointers.
default: an array with size elements, all of which are set to NULL

INT32 size_: the size of the array.
default: parameter arraySize of the ctor
 
 
member functions of CClassManager:

CClassManager (INT32 arraySize): Creates an array with the given size. If arraySize is zero, an assert fails.

~CClassManager (): Deletes the array.

INT32 *GetFunction (INT32 id): Returns the function with the identifier id, or NULL if no function with this identifier is stored.

void SetFunction (INT32 id, INT32 *functionPointer): Inserts the function with the identifier id into the array. A former entry is overwritten.
 
 
global items used by CAlgorithmManager:

 
global items defined:

typedef ACClockSyncAlgorithm *(*AlgFunction)(CClockSync *): the prototype of the creation function of a clock synchronization algorithm class.
 
 
member functions of CAlgorithmManager:

CAlgorithmManager (): Calls the ctor of the CClassManager with the array size EAlgorithmTypeCount.

void SetFunction (EAlgorithmType algorithm, AlgFunction functionPointer): Inserts the creation function of the algorithm class specified in algorithm into the array of creation functions.

AlgFunction GetFunction (EAlgorithmType algorithm): Returns the creation function of the algorithm class specified in algorithm, or NULL if no function with this identifier is stored.
 
 
global items used by CNetworkManager:

 
global items defined:

typedef ACNetwork *(*NetworkFunction)(CControllingObject *, SINT32): the prototype of the creation function of a network class.
 
 
member functions of CAlgorithmManager:

CNetworkManager (): Calls the ctor of the CClassManager with the array size ENetworkTypeCount.

void SetFunction (ENetworkType network, NetworkFunction functionPointer): Inserts the creation function of the network class specified in network into the array of creation functions.

NetworkFunction GetFunction (ENetworkType network): Returns the creation function of the network class specified in network, or NULL if no function with this identifier is stored.


last modified: Fri Feb 5 18:56:00 1999