TimerEvent.h
Go to the documentation of this file.00001
00002 #ifndef INCLUDED_TimerEvent_h_
00003 #define INCLUDED_TimerEvent_h_
00004
00005 #include "Events/EventBase.h"
00006
00007 class EventListener;
00008
00009
00010
00011
00012 class TimerEvent : public EventBase {
00013 public:
00014
00015 TimerEvent() : EventBase(), target(NULL) {}
00016
00017 TimerEvent(EventListener * tgt, EventGeneratorID_t gid, size_t sid, EventTypeID_t tid, unsigned int dur=0) : EventBase(gid,sid,tid,dur), target(tgt) {}
00018
00019 TimerEvent(const TimerEvent& te) : EventBase(te), target(te.target) {}
00020
00021 TimerEvent& operator=(const TimerEvent& te) { target=te.target; EventBase::operator=(te); return *this; }
00022
00023 virtual EventBase* clone() const { return new TimerEvent(*this); }
00024
00025 virtual unsigned int getClassTypeID() const { return autoRegisterTimerEvent; }
00026
00027 EventListener * getTarget() const { return target; }
00028 void setTarget(EventListener* tgt) { target=tgt; }
00029
00030 std::string getDescription(bool showTypeSpecific=true, unsigned int verbosity=0) const;
00031
00032 virtual unsigned int getBinSize() const;
00033 virtual unsigned int loadBinaryBuffer(const char buf[], unsigned int len);
00034 virtual unsigned int saveBinaryBuffer(char buf[], unsigned int len) const;
00035 virtual void loadXML(xmlNode* node);
00036 virtual void saveXML(xmlNode * node) const;
00037
00038 protected:
00039 EventListener * target;
00040
00041
00042 static const EventBase::classTypeID_t autoRegisterTimerEvent;
00043 };
00044
00045
00046
00047
00048
00049
00050 #endif