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 Member Functions | Protected Attributes | Friends | List of all members
Menge::BFSM::Action Class Referenceabstract

The abstract definition of an action. More...

#include <Action.h>

Inheritance diagram for Menge::BFSM::Action:
Menge::Element Menge::BFSM::ObstacleAction Menge::BFSM::PropertyAction< Manipulator > Menge::BFSM::TeleportAction Menge::BFSM::AddObstacleSetAction Menge::BFSM::RemoveObstacleSetAction Menge::BFSM::SetObstacleSetAction

Public Member Functions

 Action ()
 Constructor.
 
virtual void onEnter (Agents::BaseAgent *agent)=0
 Upon entering the state, this is called – it is the main work of the action. More...
 
void onLeave (Agents::BaseAgent *agent)
 The work to do upon state exit. 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...
 

Protected Member Functions

virtual ~Action ()
 Virtual destructor.
 
virtual void leaveAction (Agents::BaseAgent *agent)=0
 The actual work to do upon exiting the state. More...
 

Protected Attributes

bool _undoOnExit
 Determines if the action undoes itself on exiting the state.
 

Friends

class ActionFactory
 

Detailed Description

The abstract definition of an action.

An action is explicitly executed upon entering a state and has the option of undoing its effect upon exiting the state.

Member Function Documentation

virtual void Menge::BFSM::Action::leaveAction ( Agents::BaseAgent agent)
protectedpure virtual

The actual work to do upon exiting the state.

This is a purely virtual function. Any Action sub-class must explicitly account for this function. It will only be called if the action is set to undo its work upon exit.

Parameters
agentThe agent to act on.

Implemented in Menge::BFSM::PropertyAction< Manipulator >, Menge::BFSM::ObstacleAction, and Menge::BFSM::TeleportAction.

virtual void Menge::BFSM::Action::onEnter ( Agents::BaseAgent agent)
pure virtual

Upon entering the state, this is called – it is the main work of the action.

This is a purely virtual function. Any instantiable Action sub-class must explicitly account for this function.

Parameters
agentThe agent to act on.

Implemented in Menge::BFSM::PropertyAction< Manipulator >, Menge::BFSM::ObstacleAction, and Menge::BFSM::TeleportAction.

void Menge::BFSM::Action::onLeave ( Agents::BaseAgent agent)

The work to do upon state exit.

Parameters
agentThe agent to act on.

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