| 1 |
#ifndef HEADER_INTMSG_H |
| 2 |
#define HEADER_INTMSG_H |
| 3 |
|
| 4 |
#include "BaseMsg.h" |
| 5 |
#include "BaseListener.h" |
| 6 |
|
| 7 |
/** |
| 8 |
* Message with integer value. |
| 9 |
*/ |
| 10 |
class IntMsg : public BaseMsg { |
| 11 |
private: |
| 12 |
int m_value; |
| 13 |
public: |
| 14 |
CLONE(IntMsg); |
| 15 |
IntMsg(BaseListener *listener, const std::string &name, |
| 16 |
int value) |
| 17 |
: BaseMsg(listener->getName(), name), m_value(value) {} |
| 18 |
IntMsg(const std::string &listenerName, const std::string &name, |
| 19 |
int value) |
| 20 |
: BaseMsg(listenerName, name), m_value(value) {} |
| 21 |
|
| 22 |
virtual void sendActual(BaseListener *listener) const |
| 23 |
{ |
| 24 |
listener->receiveInt(this); |
| 25 |
} |
| 26 |
int getValue() const { return m_value; } |
| 27 |
virtual std::string toString() const; |
| 28 |
}; |
| 29 |
|
| 30 |
|
| 31 |
#endif |