SORTIE Core C++ Documentation
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clObjectManagerBase Class Reference

OBJECT MANAGER - Version 1.0. More...

#include <ObjectManagerBase.h>

Inheritance diagram for clObjectManagerBase:
clBehaviorManager clGridManager clPopulationManager

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...
 
clWorkerBasePassObjectPointer (int iObjectNumber)
 Gets a specified object under management. More...
 
clWorkerBasePassObjectPointer (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...
 
clSimManagermp_oSimManager
 Pointer to the Simulation Manager. More...
 

Detailed Description

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.

Author
Lora E. Murphy


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

Constructor & Destructor Documentation

◆ clObjectManagerBase()

clObjectManagerBase::clObjectManagerBase ( clSimManager p_oSimManager)

Constructor.

Parameters
p_oSimManagerPointer to the Simulation Manager object

◆ ~clObjectManagerBase()

virtual clObjectManagerBase::~clObjectManagerBase ( )
virtual

Destructor.

Member Function Documentation

◆ CreateObjects()

virtual void clObjectManagerBase::CreateObjects ( xercesc::DOMDocument *  p_oDoc)
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.

Parameters
p_oDocPointer to the DOM tree created from the parsed XML file.

Reimplemented in clGridManager, clBehaviorManager, and clPopulationManager.

◆ DoObjectSetup()

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.

Parameters
p_oDocPointer to parsed and validated DOM tree. This function assumes that the file is of a type that it knows how to read.
iFileTypeWhat type of file is being passed.

◆ EndOfRunCleanup()

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.

◆ FreeMemory()

void clObjectManagerBase::FreeMemory ( )

Deletes the managed objects array.

◆ GetNumberOfObjects()

int clObjectManagerBase::GetNumberOfObjects ( )
inline

Returns the number of objects under management for an object manager.

◆ GetObjectVersion()

int clObjectManagerBase::GetObjectVersion ( )
inline

Returns the version number of the clObjectManagerBase class.

Returns
clObjectManagerBase class version number.

◆ PassObjectPointer() [1/2]

clWorkerBase* clObjectManagerBase::PassObjectPointer ( int  iObjectNumber)

Gets a specified object under management.

Parameters
iObjectNumberObject's zero-based index number in the object manager's object array.
Returns
The requested object, or NULL if there is no such object index.

◆ PassObjectPointer() [2/2]

clWorkerBase* clObjectManagerBase::PassObjectPointer ( std::string  sName)

Gets a specified object under management.

Parameters
sNameObject's namestring.
Returns
The requested object, or NULL if there is no such object.

◆ TimestepCleanup()

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.

Member Data Documentation

◆ m_iNumObjects

int clObjectManagerBase::m_iNumObjects
protected

The number of objects currently under management.

◆ mp_oObjectArray

clWorkerBase** clObjectManagerBase::mp_oObjectArray
protected

The array of objects under the control of the object manager.

◆ mp_oSimManager

clSimManager* clObjectManagerBase::mp_oSimManager
protected

Pointer to the Simulation Manager.


The documentation for this class was generated from the following file: