Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The base functionality of an element database. More...
#include <ElementDatabase.h>
Static Public Member Functions | |
static size_t | count () |
Reports the number of registered target factories. More... | |
static Element * | getInstance (TiXmlElement *node, const std::string &behaveFldr) |
Returns an instance of the TransitionTarget defined in the XML node. More... | |
static void | initialize () |
Initializes the database. | |
static void | addBuiltins () |
Adds the built-in factories to the database. More... | |
static bool | addFactory (Factory *factory) |
Adds a new Target factory to the database. More... | |
static std::string | getElementName () |
Returns the name of the element managed by this database. More... | |
static void | clear () |
Removes all registered factories from the database. | |
Static Protected Attributes | |
static bool | _initialized = false |
Tracks whether the database has been initialized, so that multiple calls to initialize will not cause problems. | |
static std::list< Factory * > | _factories |
The registered factories. | |
The base functionality of an element database.
Queries for parsing element XML and instantiating the appropriate elements for the finite state machine pass through the appropriate element database.
For plug-in-compatible elements, they should have their own database and factory. For simplicity, they should sub-class a specialization of this template.
|
static |
Adds the built-in factories to the database.
Sub-classes will specialize this function to add the built-in factory types.
|
inlinestatic |
Adds a new Target factory to the database.
The database takes ownership of the data pointed to. To be added, the new factory must have a unique name to all previous actions. If the factory cannot be added, it will be deleted.
factory | A pointer to the factory to add. |
|
inlinestatic |
Reports the number of registered target factories.
|
static |
Returns the name of the element managed by this database.
|
inlinestatic |
Returns an instance of the TransitionTarget defined in the XML node.
The caller is responsible for deleting the TransitionTarget instance.
node | The tinyxml node holding the TransitionTarget definition. |
behaveFldr | The path to the behavior file. If the transition references resources in the file system, it should be defined relative to the behavior file location. This is the folder containing that path. |