00001 /* 00002 * Behavior.hpp 00003 * 00004 * Created on: Nov 15, 2011 00005 * Author: mriedel 00006 */ 00007 00008 #ifndef INTERFACE_BEHAVIOR_HPP_ 00009 #define INTERFACE_BEHAVIOR_HPP_ 00010 00011 #include <telekyb_defines/telekyb_defines.hpp> 00012 00013 #include <telekyb_interface/OptionContainer.hpp> 00014 00015 #include <ros/ros.h> 00016 00017 namespace TELEKYB_INTERFACE_NAMESPACE { 00018 00019 // forward declaration 00020 class BehaviorController; 00021 00022 // Behavior with behaviorID == 0 are invalid! 00023 00024 class Behavior { 00025 private: 00026 // Null-Init 00027 Behavior(uint64_t behaviorID_, const std::string& behaviorName_, BehaviorController* behaviorController_); 00028 00029 // set Null 00030 void setNull(); 00031 00032 protected: 00033 uint64_t behaviorID; 00034 std::string behaviorName; 00035 00036 // BehaviorNodeHandle 00037 BehaviorController* behaviorController; 00038 00039 ros::NodeHandle behaviorNodeHandle; 00040 00041 public: 00042 Behavior(); // can always NULL Init 00043 virtual ~Behavior(); 00044 00045 void setNextBehavior(const Behavior& behavior); 00046 Behavior getNextBehavior(); 00047 00048 // option can only be loaded if set to true! 00049 void setParameterInitialized(bool initialized_); 00050 00051 // get OptionContainer 00052 OptionContainer getOptionContainer(); 00053 00054 uint64_t getBehaviorID() const; 00055 std::string getBehaviorName() const; 00056 00057 bool isNull() const; 00058 00059 friend class BehaviorController; 00060 00061 // Operators 00062 friend bool operator==(Behavior& lhs, Behavior& rhs); 00063 friend bool operator!=(Behavior& lhs, Behavior& rhs); 00064 00065 }; 00066 00067 } /* namespace telekyb_interface */ 00068 #endif /* BEHAVIOR_HPP_ */