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

#include <predicate.h>

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

List of all members.

Public Member Functions

std::string getName ()
 Gets the name of this Predicate.
bool getValue ()
 Gets the value of this Predicate.
 Predicate (const std::string &name, const Dependencies &deps, bool initial_value=false)
 Predicate (const std::string &name, bool initial_value=false)
std::string setName (const std::string &new_name)
 Sets the name of this Predicate.
void setTrigger (const boost::function< void(bool) > trigger)

Protected Member Functions

void setValue (bool val)
 Sets the value of this Predicate. Should be called from within update().

Private Attributes

std::string name_
uint8_t requested_updates_
 The logical value of this Predicate;.
boost::function< void(bool) > trigger_
bool value_
 The name of this Predicate;.

Detailed Description

The Predicate class is a base class for logical predicates. A "Predicate" is an object with an associated truth value that can depend on arbitrary sources of information. This base class provides functionalities to ease the definition of predicates and their interface with the PredicateManager class.

Definition at line 47 of file predicate.h.


Constructor & Destructor Documentation

predicate_manager::Predicate::Predicate ( const std::string &  name,
const Dependencies deps,
bool  initial_value = false 
)

Predicate constructor.

Parameters:
nameThe name of this Predicate.
depsThe Dependencies of this Predicate (e.g. a set of names of other Predicates that may influence its value).
initial_valueThe initial value of this predicate. It may be overridden according to its dependencies.
See also:
Dependencies
predicate_manager::Predicate::Predicate ( const std::string &  name,
bool  initial_value = false 
)

Predicate constructor.

Parameters:
nameThe name of this Predicate.
initial_valueThe initial value of this predicate.

Member Function Documentation

std::string Predicate::getName ( )

Gets the name of this Predicate.

Definition at line 84 of file predicate.cpp.

Gets the value of this Predicate.

Definition at line 89 of file predicate.cpp.

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

Sets the name of this Predicate.

Definition at line 94 of file predicate.cpp.

void Predicate::setTrigger ( const boost::function< void(bool) >  trigger)

Sets the trigger function for this Predicate. The trigger function is called whenever the Predicate changes its value (this is used by the PredicateManager).

Definition at line 99 of file predicate.cpp.

void Predicate::setValue ( bool  val) [protected]

Sets the value of this Predicate. Should be called from within update().

hands over control to PM, so the dependents can be updated.

Definition at line 56 of file predicate.cpp.


Member Data Documentation

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

Definition at line 89 of file predicate.h.

The logical value of this Predicate;.

The number of times that this Predicate's setValue() function has been recursively called. If it exceeds a given threshold (MAX_CYCLIC_UPDATES), the Predicate is considered to be in a livelock.

Definition at line 96 of file predicate.h.

boost::function<void ( bool ) > predicate_manager::Predicate::trigger_ [private]

The trigger function.

See also:
setTrigger

Definition at line 101 of file predicate.h.

The name of this Predicate;.

Definition at line 90 of file predicate.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