#include <predicate_dependent_entity.h>
Public Member Functions | |
void | bindDependency (const NameID dep_name_id, const bool *value_ref) |
void | declareDependency (const std::string &dep_name, const int pm_id=0) |
Declare a new dependency. | |
void | declareDependency (const NameID dep_name_id) |
Declare a new dependency. | |
NameIDSet | getDependencies () |
Gets a set of NameIDs containing the dependencies of this object. | |
PredicateDependentEntity (const Dependencies &deps) | |
PredicateDependentEntity () | |
virtual void | update ()=0 |
Protected Member Functions | |
bool | getDependencyValue (const std::string &dep_name, const int pm_id=0, DEP_STATUS *status=NULL) |
Private Attributes | |
NameIDSet | dep_set_ |
PredValueMap | dep_value_map_ |
The names and PM identifiers of the Predicate dependencies;. |
The PredicateDependentEntity class is a base for classes that depend on the values of Predicates. This includes Predicates and Events.
Definition at line 39 of file predicate_dependent_entity.h.
PredicateDependentEntity::PredicateDependentEntity | ( | const Dependencies & | deps | ) |
PredicateDependentEntity constructor.
deps | A set of names and respective PM identifiers of Predicates that may influence this object. |
needs to be filled in by the PM
Definition at line 34 of file predicate_dependent_entity.cpp.
Empty constructor.
Definition at line 42 of file predicate_dependent_entity.cpp.
void PredicateDependentEntity::bindDependency | ( | const NameID | dep_name_id, |
const bool * | value_ref | ||
) |
Binds a NameID to a reference to a boolean value. This allows the fast access to the values of this object's dependencies (through the getDependencyValue function).
dep_name_id | A NameID defining a dependency of this predicate. |
value_ref | A (persistent) reference to a boolean value representing the value of that dependency. |
Definition at line 62 of file predicate_dependent_entity.cpp.
void PredicateDependentEntity::declareDependency | ( | const std::string & | dep_name, |
const int | pm_id = 0 |
||
) |
Declare a new dependency.
Definition at line 47 of file predicate_dependent_entity.cpp.
void PredicateDependentEntity::declareDependency | ( | const NameID | dep_name_id | ) |
Declare a new dependency.
Definition at line 55 of file predicate_dependent_entity.cpp.
Gets a set of NameIDs containing the dependencies of this object.
Definition at line 107 of file predicate_dependent_entity.cpp.
bool PredicateDependentEntity::getDependencyValue | ( | const std::string & | dep_name, |
const int | pm_id = 0 , |
||
DEP_STATUS * | status = NULL |
||
) | [protected] |
Gets the value of a dependency.
dep_name | The name of the dependency; |
pm_id | (optional) The ID of the PredicateManager to which this dependency belongs. |
status | (optional) The status of the dependency. |
Definition at line 70 of file predicate_dependent_entity.cpp.
virtual void predicate_manager::PredicateDependentEntity::update | ( | ) | [pure virtual] |
Update function. This function is to be called whenever one of the dependent Predicates changes its value. It must be implemented by derived classes. It will be called by the PredicateManager to which this object is added.
Implemented in predicate_manager::PropLogicEvent, and predicate_manager::PropLogicPredicate.
Definition at line 88 of file predicate_dependent_entity.h.
The names and PM identifiers of the Predicate dependencies;.
Definition at line 89 of file predicate_dependent_entity.h.