00001 #ifndef HEADER_MESSAGERAGENT_H 00002 #define HEADER_MESSAGERAGENT_H 00003 00004 00005 #include "BaseAgent.h" 00006 #include "Name.h" 00007 00008 #include <map> 00009 00010 00011 /** 00012 * List of listeners. 00013 */ 00014 class MessagerAgent : public BaseAgent { 00015 AGENT(MessagerAgent, Name::MESSAGER_NAME); 00016 private: 00017 typedef std::map<std::string,BaseListener*> t_listeners; 00018 t_listeners m_listeners; 00019 public: 00020 void addListener(BaseListener *listener); 00021 void removeListener(const std::string &name); 00022 00023 void forwardNewMsg(BaseMsg *msg); 00024 }; 00025 00026 #endif