diff options
Diffstat (limited to 'src/hs-clientmanager.h')
-rw-r--r-- | src/hs-clientmanager.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/hs-clientmanager.h b/src/hs-clientmanager.h index 4cb1fad..9e58e64 100644 --- a/src/hs-clientmanager.h +++ b/src/hs-clientmanager.h @@ -26,7 +26,6 @@ #include "hs-helper.h" #include "hs-client.h" -extern const std::string _listen_all; class listener_interface { public: @@ -34,9 +33,9 @@ public: virtual ~listener_interface() {} virtual void notify(afb_api_t api, std::string appid = "") = 0; std::string myUid(void) {return m_uid;} - std::set<std::string> listenAppSet(void) {return m_listen_appid;} - void addListenAppId(std::string appid) {m_listen_appid.insert(appid);} - bool isListenAppId(std::string &appid) { + void addListenAppId(const std::string &appid) {m_listen_appid.insert(appid);} + void removeListenAppId(const std::string &appid) {m_listen_appid.erase(appid);} + bool isListenAppId(const std::string &appid) { auto it = m_listen_appid.find(appid); return it != m_listen_appid.end() ? true : false; } @@ -80,12 +79,11 @@ private: HS_ClientCtxt* createClientCtxt(afb_req_t req, std::string appid); HS_Client* addClient(afb_req_t req, std::string appid); void removeClient(std::string appid); - bool checkRegisterApp(afb_api_t api, const std::string &appid); void notifyListener(afb_api_t api, const std::string &appid); private: static HS_ClientManager* me; - std::unordered_map<std::string, std::list<listener_interface*>> listener_list; + std::unordered_map<std::string, listener_interface*> listener_list; std::unordered_map<std::string, HS_Client*> client_list; std::unordered_map<std::string, HS_ClientCtxt*> appid2ctxt; std::mutex mtx; |