Construct version 5.4.4
An agent based modeling framework
ModelManager Struct Reference

Container for Construct models. More...

Public Member Functions

 ~ModelManager (void)
 
bool contains (const std::string &name) const noexcept
 
Modelget_model (const std::string &name)
 
const Modelget_model (const std::string &name) const
 
void add_model (const std::string &name, Model *model)
 

Public Attributes

std::unordered_map< std::string, Model * > _models
 
std::unordered_map< std::string, Model * > queued_models
 

Detailed Description

Container for Construct models.

The model manager stores all models as pointers in an unordered_map. As the number of active models is not expected to be large, unordered_map is used instead of map. The model manager creates pointers for models based on the XML input. A model's primary method of interacting with the model manager should be either checking to see if a model is active, or to add a PlaceHolder model when there is a model in a model.

Constructor & Destructor Documentation

◆ ~ModelManager()

ModelManager::~ModelManager ( void  )
inline

summary>

Member Function Documentation

◆ contains()

bool ModelManager::contains ( const std::string &  name) const
inlinenoexcept

summary>

Here is the caller graph for this function:

◆ get_model() [1/2]

Model * ModelManager::get_model ( const std::string &  name)
inline

summary>

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_model() [2/2]

const Model * ModelManager::get_model ( const std::string &  name) const
inline

summary>

Here is the call graph for this function:

Member Data Documentation

◆ _models

std::unordered_map<std::string, Model*> ModelManager::_models

summary>

◆ queued_models

std::unordered_map<std::string, Model*> ModelManager::queued_models

summary>