ec_command.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef FIFE_EVENTCHANNEL_COMMAND_H
00023 #define FIFE_EVENTCHANNEL_COMMAND_H
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "eventchannel/base/ec_event.h"
00037 #include "ec_commandids.h"
00038
00039 namespace FIFE {
00040
00044 class Command: public Event {
00045 public:
00048 Command():
00049 Event(),
00050 m_commandtype(CMD_UNKNOWN),
00051 m_code(0) {}
00052
00055 virtual ~Command() {}
00056
00060 CommandType getCommandType() const { return m_commandtype; }
00061 void setCommandType(CommandType type) { m_commandtype = type; }
00062
00066 int getCode() const { return m_code; }
00067 void setCode(int code) { m_code = code; }
00068
00069 virtual void consume() { Event::consume(); }
00070 virtual bool isConsumed() const { return Event::isConsumed(); }
00071 virtual IEventSource* getSource() { return Event::getSource(); }
00072 virtual void setSource(IEventSource* source) { Event::setSource(source); }
00073 virtual int getTimeStamp() const { return Event::getTimeStamp(); }
00074 virtual void setTimeStamp(int timestamp ) { Event::setTimeStamp(timestamp); }
00075
00076 virtual const std::string& getName() const {
00077 const static std::string eventName("Command");
00078 return eventName;
00079 }
00080 virtual std::string getDebugString() const { return Event::getDebugString(); }
00081
00082
00083 private:
00084 CommandType m_commandtype;
00085 int m_code;
00086 void* m_data1;
00087 void* m_data2;
00088 };
00089 }
00090
00091 #endif