00001
00002 #ifndef INCLUDED_EventGeneratorBase_h_
00003 #define INCLUDED_EventGeneratorBase_h_
00004
00005 #include "Behaviors/BehaviorBase.h"
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 class EventGeneratorBase : public BehaviorBase {
00022 public:
00023
00024
00025 EventGeneratorBase()
00026 : BehaviorBase(), myGenID(EventBase::unknownEGID), mySourceID(0), autoListen(false), srcGenID(EventBase::unknownEGID), srcSourceID(0), myName()
00027 {}
00028 EventGeneratorBase(const std::string& name, EventBase::EventGeneratorID_t mgid, unsigned int msid)
00029 : BehaviorBase(), myGenID(mgid), mySourceID(msid), autoListen(false), srcGenID(EventBase::unknownEGID), srcSourceID(0), myName(name)
00030 {}
00031 EventGeneratorBase(const std::string& name, EventBase::EventGeneratorID_t mgid, unsigned int msid,EventBase::EventGeneratorID_t srcgid, unsigned int srcsid)
00032 : BehaviorBase(), myGenID(mgid), mySourceID(msid), autoListen(true), srcGenID(srcgid), srcSourceID(srcsid), myName(name)
00033 {}
00034
00035
00036 virtual void DoStart();
00037
00038 virtual void DoStop();
00039
00040
00041 virtual EventBase::EventGeneratorID_t getGeneratorID() { return myGenID; }
00042
00043 virtual void setGeneratorID(EventBase::EventGeneratorID_t gid) { myGenID=gid; }
00044
00045
00046 virtual unsigned int getSourceID() { return mySourceID; }
00047
00048 virtual void setSourceID(unsigned int sid) { mySourceID=sid; }
00049
00050
00051 virtual unsigned int getListenSourceID() const { return srcSourceID; }
00052
00053 virtual EventBase::EventGeneratorID_t getListenGeneratorID() const { return srcGenID; }
00054
00055 virtual void setAutoListen(EventBase::EventGeneratorID_t gid, unsigned int sid) { autoListen=true; srcGenID=gid; srcSourceID=sid; }
00056
00057
00058 virtual void unsetAutoListen() { autoListen=false; }
00059
00060
00061 virtual std::string getName() const {
00062 return myName;
00063 }
00064
00065
00066 virtual void setName(const std::string& name) {
00067 myName=name;
00068 }
00069
00070 protected:
00071 EventBase::EventGeneratorID_t myGenID;
00072 unsigned int mySourceID;
00073 bool autoListen;
00074 EventBase::EventGeneratorID_t srcGenID;
00075 unsigned int srcSourceID;
00076 std::string myName;
00077 };
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 #endif