#include <WorkerBase.h>
Public Member Functions | |
int | GetObjectVersion () |
Returns the version number of the clWorkerBase class. | |
clWorkerBase (clSimManager *p_oSimManager) | |
Constructor. | |
virtual | ~clWorkerBase () |
Destructor. | |
char * | GetName () |
Gets the object's namestring. | |
void | DoObjectSetup (xercesc::DOMDocument *p_oDoc, fileType iFileType) |
Triggers the setup process. | |
virtual void | TimestepCleanup () |
Performs any necessary cleanup operations at the end of a timestep. | |
virtual void | EndOfRunCleanup () |
Performs any necessary cleanup operations at the end of a run. | |
virtual void | DoCommand (char *cCommand, char *cArguments) |
If a behavior has registered a command line command with the sim manager, this allows it to be called. | |
Protected Member Functions | |
virtual void | GetData (xercesc::DOMDocument *p_oDoc)=0 |
Performs an object's setup. | |
void | AssembleFileCode (int iFileType, int iFileVersion, char *cCode) |
Creates the proper identifying filecode for an XML file. | |
Protected Attributes | |
char | m_cNameString [MAX_NAMESTRING_SIZE] |
Object's identifying namestring. | |
int * | mp_iAllowedFileTypes |
List of the input file types this object can handle. | |
int | m_iNumAllowedTypes |
Number of input file types this object can handle. | |
Static Protected Attributes | |
static clSimManager * | mp_oSimManager |
Pointer to the simulation manager object. |
The worker base class serves as a virtual base class for all data and behavior objects. These object types each have their own managers. The managers them- selves have a base class and this object allows that manager base class to access the objects.
This class only serves as a parent class for other classes; do not instantiate objects of this class.
In order for the dynamic casting to work, this must be a polymorphic base class, which means it must have a virtual function. So make sure there's always one.
There are is a virtual function that all child classes must overload.
Copyright 2003 Charles D. Canham.
clWorkerBase::clWorkerBase | ( | clSimManager * | p_oSimManager | ) |
Constructor.
The constructor initializes the common variables.
p_oSimManager | Sim Manager object. |
virtual clWorkerBase::~clWorkerBase | ( | ) | [virtual] |
Destructor.
Deletes the common variables.
int clWorkerBase::GetObjectVersion | ( | ) | [inline] |
Returns the version number of the clWorkerBase class.
Reimplemented in clGridBase, and clPopulationBase.
char* clWorkerBase::GetName | ( | ) | [inline] |
Gets the object's namestring.
This name can be used to search for the object.
void clWorkerBase::DoObjectSetup | ( | xercesc::DOMDocument * | p_oDoc, | |
fileType | iFileType | |||
) |
Triggers the setup process.
This function should not be overridden.
p_oDoc | DOM tree of parsed input file. | |
iFileType | Input file's type. |
virtual void clWorkerBase::TimestepCleanup | ( | ) | [inline, virtual] |
Performs any necessary cleanup operations at the end of a timestep.
Child classes can override this function as necessary.
Reimplemented in clAverageLight, clBasalAreaLight, clDensityLight, clDisperseBase, clEstablishment, clGapLight, clMicroEstablishment, clPlant, clQuadratGLILight, clGhostTreePopulation, and clTreePopulation.
virtual void clWorkerBase::EndOfRunCleanup | ( | ) | [inline, virtual] |
Performs any necessary cleanup operations at the end of a run.
Child classes can override this function as necessary.
virtual void clWorkerBase::DoCommand | ( | char * | cCommand, | |
char * | cArguments | |||
) | [inline, virtual] |
If a behavior has registered a command line command with the sim manager, this allows it to be called.
cCommand | Command string. | |
cArguments | Any arguments passed with the command. |
virtual void clWorkerBase::GetData | ( | xercesc::DOMDocument * | p_oDoc | ) | [protected, pure virtual] |
Performs an object's setup.
This must be overridden by child classes.
p_oDoc | DOM tree of parsed input file. |
Implemented in clBoleVolumeCalculator, clCarbonValueCalculator, clClimateChange, clCompetitionHarvest, clConditOmegaCalculator, clCrownRadiusReporter, clDensitySeedSurvival, clDetailedSubstrate, clDimensionAnalysis, clDisperseBase, clDisturbance, clEpiphyticEstablishment, clEstablishment, clFoliarChemistry, clFuncResponseSeedPredation, clGeneralizedHarvestRegime, clGermination, clGLIMap, clGLIPoints, clGrowthBase, clHarvestInterface, clInsectInfestation, clLightBase, clLightDepSeedSurvival, clLightFilter, clMerchantableStemWoodVolume, clMerchValueCalculator, clMicroEstablishment, clMortalityBase, clNeighborhoodSeedPredation, clOutput, clShortOutput, clPartitionedBiomass, clPlant, clRandomBrowse, clRandomSeedLogger, clRipleysKCalculator, clSelectionHarvest, clSnagDecomp, clStateReporter, clStochasticGapGrowth, clStorm, clStormDamageApplier, clStormDirectKiller, clStormKilledPartitionedBiomass, clStormKiller, clStormLight, clSubstrate, clSubstrateDepSeedSurvival, clTreeAgeCalculator, clTreeRemover, clVolumeCalculator, clWindstorm, clGhostTreePopulation, clGridBase, clPlot, and clTreePopulation.
void clWorkerBase::AssembleFileCode | ( | int | iFileType, | |
int | iFileVersion, | |||
char * | cCode | |||
) | [protected] |
Creates the proper identifying filecode for an XML file.
When objects must read or write XML files, they often need to use a filecode. This is an 8-character string divided into four sets of two characters. The first set of two characters is the model major version; the second set of two characters is the minor versions; the third set of two characters is the file type; and the fourth set is the file version. Given the file type and file version, this will assemble the string and place it in cCode. cCode should be declared to have room for the 8-digit code. AssembleFileCode() will not check for appropriate length.
iFileType | Type of file for which to assemble the code. | |
iFileVersion | File's version number. | |
cCode | A string into which the finished file code will be placed. |
char clWorkerBase::m_cNameString[MAX_NAMESTRING_SIZE] [protected] |
Object's identifying namestring.
clSimManager* clWorkerBase::mp_oSimManager [static, protected] |
Pointer to the simulation manager object.
Allows communication between objects.
int* clWorkerBase::mp_iAllowedFileTypes [protected] |
List of the input file types this object can handle.
int clWorkerBase::m_iNumAllowedTypes [protected] |
Number of input file types this object can handle.