Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Friends | List of all members
Menge::Event Class Reference

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
 
EventparseEvent (TiXmlElement *node, const std::string &specFldr)
 Parses the xml specification of an event and returns a parsed event. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

Menge::Event::Event ( const std::string &  name)

Constructor.

Parameters
nameThe name of the event.

Member Function Documentation

void Menge::Event::finalize ( )

Allows the event to finish initializing itself from its parsed state to its running state.

Exceptions
EventFatalExceptionif the event system has conservative configuration and there is a problem in the event specification.

Friends And Related Function Documentation

Event* parseEvent ( TiXmlElement *  node,
const std::string &  specFldr 
)
friend

Parses the xml specification of an event and returns a parsed event.

The event instance will still need to be finalized.

Parameters
nodeThe tiny xml node containing the event specification.
specFldrThe path to the specification file. All external resource references in the spec file are defined relative to this folder.
Returns
A new instance of an Event. Null if there is a parsing error. The caller assumes responsibility to delete the instance.

The documentation for this class was generated from the following files: