SORTIE Core C++ Documentation
|
OBJECT MANAGER - Version 1.0. More...
#include <ObjectManagerBase.h>
Public Member Functions | |
int | GetObjectVersion () |
Returns the version number of the clObjectManagerBase class. More... | |
clObjectManagerBase (clSimManager *p_oSimManager) | |
Constructor. More... | |
virtual | ~clObjectManagerBase () |
Destructor. More... | |
void | FreeMemory () |
Deletes the managed objects array. More... | |
int | GetNumberOfObjects () |
Returns the number of objects under management for an object manager. More... | |
clWorkerBase * | PassObjectPointer (int iObjectNumber) |
Gets a specified object under management. More... | |
clWorkerBase * | PassObjectPointer (std::string sName) |
Gets a specified object under management. More... | |
void | DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType) |
Triggers the setup process for all objects managed by this manager. More... | |
void | TimestepCleanup () |
Completes timestep cleanup tasks both for this object manager and all its managed objects. More... | |
void | EndOfRunCleanup () |
Completes any end-of-run cleanup tasks both for this object manager and all its managed objects. More... | |
Protected Member Functions | |
virtual void | CreateObjects (xercesc::DOMDocument *p_oDoc) |
Creates the managed objects for a run. More... | |
Protected Attributes | |
clWorkerBase ** | mp_oObjectArray |
The array of objects under the control of the object manager. More... | |
int | m_iNumObjects |
The number of objects currently under management. More... | |
clSimManager * | mp_oSimManager |
Pointer to the Simulation Manager. More... | |
OBJECT MANAGER - Version 1.0.
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 2011 Charles D. Canham.
Changes:
--------------—
October 20, 2011 - Wiped the slate clean for SORTIE 7.0 (LEM)
November 6, 2012 - Took away mp_oSimManager's static designation; it interfered with testing
clObjectManagerBase::clObjectManagerBase | ( | clSimManager * | p_oSimManager | ) |
Constructor.
p_oSimManager | Pointer to the Simulation Manager object |
|
virtual |
Destructor.
|
inlineprotectedvirtual |
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 clGridManager, clBehaviorManager, and clPopulationManager.
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::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.
void clObjectManagerBase::FreeMemory | ( | ) |
Deletes the managed objects array.
|
inline |
Returns the number of objects under management for an object manager.
|
inline |
Returns the version number of the clObjectManagerBase class.
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 | ( | std::string | sName | ) |
Gets a specified object under management.
sName | Object's namestring. |
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.
|
protected |
The number of objects currently under management.
|
protected |
The array of objects under the control of the object manager.
|
protected |
Pointer to the Simulation Manager.