#include <ObjectManagerBase.h>
Inheritance diagram for clObjectManagerBase:
Public Member Functions | |
int | GetObjectVersion () |
Returns the version number of the clObjectManagerBase class. | |
clObjectManagerBase (clSimManager *p_oSimManager) | |
Constructor. | |
virtual | ~clObjectManagerBase () |
Destructor. | |
void | FreeMemory () |
Deletes the managed objects array. | |
int | GetNumberOfObjects () |
Returns the number of objects under management for an object manager. | |
clWorkerBase * | PassObjectPointer (int iObjectNumber) |
Gets a specified object under management. | |
clWorkerBase * | PassObjectPointer (char *cName) |
Gets a specified object under management. | |
void | DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType) |
Triggers the setup process for all objects managed by this manager. | |
void | TimestepCleanup () |
Completes timestep cleanup tasks both for this object manager and all its managed objects. | |
void | EndOfRunCleanup () |
Completes any end-of-run cleanup tasks both for this object manager and all its managed objects. | |
Protected Member Functions | |
virtual void | CreateObjects (xercesc::DOMDocument *p_oDoc) |
Creates the managed objects for a run. | |
Protected Attributes | |
clWorkerBase ** | mp_oObjectArray |
The array of objects under the control of the object manager. | |
int | m_iNumObjects |
The number of objects currently under management. | |
Static Protected Attributes | |
static clSimManager * | mp_oSimManager |
Pointer to the Simulation Manager. |
This class is a virtual base class for the various types of object managers - those which handle behaviors, populations, and grids. An object manager controls all of the objects of a given type. It creates and destroys them, triggers their management functions, and controls access to them. The Simulation Manager directs the object managers so that they trigger the correct functioning at the proper time within a run.
This class should not be instantiated as an object but used only as a base class for the other manager classes. It serves as a common interface for the Simulation Manager to work with the various object managers.
Copyright 2003 Charles D. Canham.
clObjectManagerBase::clObjectManagerBase | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Pointer to the Simulation Manager object |
virtual void clObjectManagerBase::CreateObjects | ( | xercesc::DOMDocument * | p_oDoc | ) | [inline, protected, virtual] |
Creates the managed objects for a run.
Which objects are created is controlled by the file that is passed; each object manager must know what to do with the file. The objects are created only - they are not given the opportunity to do any setup at this point other than what is in their constructors.
p_oDoc | Pointer to the DOM tree created from the parsed XML file. |
Reimplemented in clPopulationManager, and clGridManager.
int clObjectManagerBase::GetObjectVersion | ( | ) | [inline] |
Returns the version number of the clObjectManagerBase class.
Reimplemented in clBehaviorManager, clPopulationManager, and clGridManager.
clWorkerBase* clObjectManagerBase::PassObjectPointer | ( | int | iObjectNumber | ) |
Gets a specified object under management.
iObjectNumber | Object's zero-based index number in the object manager's object array. |
clWorkerBase* clObjectManagerBase::PassObjectPointer | ( | char * | cName | ) |
Gets a specified object under management.
cName | Object's namestring. |
void clObjectManagerBase::DoObjectSetup | ( | xercesc::DOMDocument * | p_oDoc, | |
fileType | iFileType | |||
) |
Triggers the setup process for all objects managed by this manager.
To trigger setup, each managed object's DoSetup function is called.
p_oDoc | Pointer to parsed and validated DOM tree. This function assumes that the file is of a type that it knows how to read. | |
iFileType | What type of file is being passed. |
void clObjectManagerBase::TimestepCleanup | ( | ) |
Completes timestep cleanup tasks both for this object manager and all its managed objects.
Each managed object's TimestepCleanup function is called.
void clObjectManagerBase::EndOfRunCleanup | ( | ) |
Completes any end-of-run cleanup tasks both for this object manager and all its managed objects.
Each managed object's EndOfRunCleanup function is called.
clWorkerBase** clObjectManagerBase::mp_oObjectArray [protected] |
The array of objects under the control of the object manager.
int clObjectManagerBase::m_iNumObjects [protected] |
The number of objects currently under management.
clSimManager* clObjectManagerBase::mp_oSimManager [static, protected] |
Pointer to the Simulation Manager.