Public Member Functions | Protected Member Functions | Private Attributes
predicate_manager::Event Class Reference

#include <event.h>

Inheritance diagram for predicate_manager::Event:
Inheritance graph
[legend]

List of all members.

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;.

Detailed Description

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.

Definition at line 49 of file event.h.


Constructor & Destructor Documentation

predicate_manager::Event::Event ( const std::string &  name,
const Dependencies deps 
)

Event constructor.

Parameters:
nameThe name of this Event.
depsThe Dependencies of this Event (e.g. a set of names of Predicates that may influence the event condition).
See also:
Dependencies
predicate_manager::Event::Event ( const std::string &  name)

Event constructor.

Parameters:
nameThe name of this Event.

Member Function Documentation

std::string Event::getName ( )

Gets the name of this Event.

Definition at line 53 of file event.cpp.

std::string Event::setName ( const std::string &  new_name)

Sets the name of this Event.

Definition at line 58 of file event.cpp.

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).

Definition at line 63 of file event.cpp.

void Event::triggerEvent ( ) [protected]

Triggers this Event (i.e. signals an associated PM that the event should be published). Should be called from within update().

Definition at line 68 of file event.cpp.


Member Data Documentation

std::string predicate_manager::Event::name_ [private]

Definition at line 85 of file event.h.

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.

See also:
setTrigger

Definition at line 91 of file event.h.


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


predicate_manager
Author(s): Joao Reis and Joao Messias
autogenerated on Wed Aug 26 2015 12:28:34