Menge
Modular Pedestrian Simulation Framework for Research and Development
|
The definition of a Menge event. More...
#include <Event.h>
Public Member Functions | |
Event (const std::string &name) | |
Constructor. More... | |
~Event () | |
Destructor. | |
void | finalize () |
Allows the event to finish initializing itself from its parsed state to its running state. More... | |
void | evaluate () |
Evaluates the event (and triggers handlers as necessary). | |
Protected Attributes | |
std::string | _name |
The name of the event. | |
EventTrigger * | _trigger |
The trigger for the event. | |
std::vector< EventResponse * > | _responses |
The effects registered to this event. | |
Friends | |
class | EventSystem |
Event * | parseEvent (TiXmlElement *node, const std::string &specFldr) |
Parses the xml specification of an event and returns a parsed event. More... | |
The definition of a Menge event.
An event is defined by two components: a trigger, and a list of event responses. The trigger defines the circumstances which cause the event to "fire". The event can have multiple respones registered. When the event fires, each event response is triggered to modify the simulation.
Menge::Event::Event | ( | const std::string & | name | ) |
Constructor.
name | The name of the event. |
void Menge::Event::finalize | ( | ) |
Allows the event to finish initializing itself from its parsed state to its running state.
EventFatalException | if the event system has conservative configuration and there is a problem in the event specification. |
|
friend |
Parses the xml specification of an event and returns a parsed event.
The event instance will still need to be finalized.
node | The tiny xml node containing the event specification. |
specFldr | The path to the specification file. All external resource references in the spec file are defined relative to this folder. |