-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPopulations.cpp
More file actions
35 lines (32 loc) · 1.29 KB
/
Populations.cpp
File metadata and controls
35 lines (32 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//---------------------------------------------------------------------------
#include "Populations.h"
//HEADER FILES FOR REGISTERED POPULATION OBJECTS
#include "TreePopulation.h"
#include "GhostTreePopulation.h"
////////////////////////////////////////////////////////////////////////////
// CreateObjects
////////////////////////////////////////////////////////////////////////////
void clPopulationManager::CreateObjects(xercesc::DOMDocument *p_oDoc){
try {
//If keep current is false - free memory
if (m_iNumObjects > 0) FreeMemory();
if (0 == m_iNumObjects) {
m_iNumObjects = 2;
clTreePopulation *p_oTreePop = new clTreePopulation(mp_oSimManager);
clGhostTreePopulation *p_oGhostPop = new clGhostTreePopulation(mp_oSimManager);
mp_oObjectArray = new clWorkerBase*[m_iNumObjects];
mp_oObjectArray[0] = p_oTreePop;
mp_oObjectArray[1] = p_oGhostPop;
p_oTreePop->BarebonesDataSetup(p_oDoc);
} //end of if (0 == m_iNumObjects)
}
catch(modelErr &err) {throw(err);}
catch (modelMsg &msg) {throw(msg);} //non-fatal error
catch(...) {
modelErr stcErr;
stcErr.iErrorCode = UNKNOWN;
stcErr.sFunction = "clPopulationManager::CreateObjects";
throw(stcErr);
}
}
//---------------------------------------------------------------------------