00001 00025 #ifndef _EVENT_H_ 00026 #define _EVENT_H_ 00027 00028 #include <string> 00029 #include <map> 00030 00031 #include <boost/shared_ptr.hpp> 00032 #include <boost/function.hpp> 00033 00034 #include <predicate_manager/common_defs.h> 00035 #include <predicate_manager/predicate_dependent_entity.h> 00036 00037 #define MAX_CYCLIC_UPDATES 100 00038 00039 namespace predicate_manager 00040 { 00049 class Event : public PredicateDependentEntity 00050 { 00051 public: 00058 Event ( const std::string& name, 00059 const Dependencies& deps ); 00060 00065 Event ( const std::string& name ); 00066 00068 std::string getName(); 00069 00071 std::string setName ( const std::string& new_name ); 00072 00078 void setTrigger ( const boost::function<void () > trigger ); 00079 00080 protected: 00082 void triggerEvent(); 00083 00084 private: 00085 std::string name_; 00086 00091 boost::function<void ( ) > trigger_; 00092 }; 00093 } 00094 00095 #endif