#include <event.h>
Public Member Functions | |
Event (const std::string &name, const Dependencies &deps) | |
Event (const std::string &name) | |
std::string | getName () |
Gets the name of this Event. | |
std::string | setName (const std::string &new_name) |
Sets the name of this Event. | |
void | setTrigger (const boost::function< void() > trigger) |
Protected Member Functions | |
void | triggerEvent () |
Triggers this Event (i.e. signals an associated PM that the event should be published). Should be called from within update(). | |
Private Attributes | |
std::string | name_ |
boost::function< void() > | trigger_ |
The name of this Event;. |
The Event class is a base class for instantaneous events. An "Event" is an object associated to a condition, and that is triggered whenever that condition becomes true (and only when that condition becomes true). Events can be though of as named representations of transitions of logical predicates. However, the Event class (and its sub-classes) can be used independently from the Predicate base class. Events can be bound to arbitrary user-defined conditions. Note that, contrarily to Predicates, Events don't have a "state" -- they are instantaneous signals.
predicate_manager::Event::Event | ( | const std::string & | name, |
const Dependencies & | deps | ||
) |
Event constructor.
name | The name of this Event. |
deps | The Dependencies of this Event (e.g. a set of names of Predicates that may influence the event condition). |
predicate_manager::Event::Event | ( | const std::string & | name | ) |
std::string Event::getName | ( | ) |
std::string Event::setName | ( | const std::string & | new_name | ) |
void Event::setTrigger | ( | const boost::function< void() > | trigger | ) |
Sets the trigger function for this Event. The trigger function is typically set internally by an associated PredicateManager, and is called whenever the user decides to trigger this event (through the triggerEvent() method).
void Event::triggerEvent | ( | ) | [protected] |
std::string predicate_manager::Event::name_ [private] |
boost::function<void ( ) > predicate_manager::Event::trigger_ [private] |
The name of this Event;.
The trigger function. Note that, for events, this function doesn't take any arguments.