| 1 |
#ifndef HEADER_MESSAGERAGENT_H |
| 2 |
#define HEADER_MESSAGERAGENT_H |
| 3 |
|
| 4 |
|
| 5 |
#include "BaseAgent.h" |
| 6 |
#include "Name.h" |
| 7 |
|
| 8 |
#include <map> |
| 9 |
|
| 10 |
|
| 11 |
/** |
| 12 |
* List of listeners. |
| 13 |
*/ |
| 14 |
class MessagerAgent : public BaseAgent { |
| 15 |
AGENT(MessagerAgent, Name::MESSAGER_NAME); |
| 16 |
private: |
| 17 |
typedef std::map<std::string,BaseListener*> t_listeners; |
| 18 |
t_listeners m_listeners; |
| 19 |
public: |
| 20 |
void addListener(BaseListener *listener); |
| 21 |
void removeListener(const std::string &name); |
| 22 |
|
| 23 |
void forwardNewMsg(BaseMsg *msg); |
| 24 |
}; |
| 25 |
|
| 26 |
#endif |