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

The definition of a response to an event. More...

#include <EventEffect.h>

Inheritance diagram for Menge::EventEffect:
Menge::Element Menge::AgentEventEffect Menge::AgentPropertyEffect< Manipulator >

Public Member Functions

 EventEffect ()
 Constructor.
 
virtual bool isCompatible (EventTarget *target)=0
 Reports if the given target is compatible with this effect. More...
 
virtual void apply (EventTarget *target)=0
 Applies the effect to the simulation target. More...
 
virtual void finalize ()
 Allows the event effect to finish initializing itself from its parsed state to its running state. More...
 
- Public Member Functions inherited from Menge::Element
void destroy ()
 This supplants the destructor. More...
 
virtual BFSM::TaskgetTask ()
 Return an optional task associated with this element. More...
 
virtual SceneGraph::GLNodegetSGNode ()
 Returns an optional visualization element associated with the element. More...
 

Friends

class EventEffectFactory
 

Detailed Description

The definition of a response to an event.

Event effects determine how the simulation changes due to a triggered event. The EventEffect is responsible for changing the simulation of the event target (and optionally caching the original state). Essentially, the event effect is the operator, and the corresponding EventTarget is the operand.

Member Function Documentation

virtual void Menge::EventEffect::apply ( EventTarget target)
pure virtual

Applies the effect to the simulation target.

Not all targets work with all effects. The target passed here must have previously passed the EventEffect::isCompatible test to work.

Parameters
targetThe target to apply the event to.

Implemented in Menge::AgentEventEffect.

virtual void Menge::EventEffect::finalize ( )
inlinevirtual

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

Exceptions
EventExceptionif there is a problem finalizing.
virtual bool Menge::EventEffect::isCompatible ( EventTarget target)
pure virtual

Reports if the given target is compatible with this effect.

Each effect can only work on certain types of targets. This function reports if the given target works with this effect.

Parameters
targetThe target instance to test.
Returns
True if the target is a valid argument to EventEffect::apply, false, otherwise.

Implemented in Menge::AgentEventEffect.


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