X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fhs-clientmanager.h;h=96a15b91d4755cf251080cb3ed00e21926246e65;hb=refs%2Fheads%2Fjellyfish;hp=cb4908821869f93e4e5c0b1de1f1ae6fa917f53e;hpb=ea459cc8988c3e664c3f9d56d3a9929775d8b57b;p=apps%2Fagl-service-homescreen.git diff --git a/src/hs-clientmanager.h b/src/hs-clientmanager.h index cb49088..96a15b9 100644 --- a/src/hs-clientmanager.h +++ b/src/hs-clientmanager.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2018 TOYOTA MOTOR CORPORATION + * Copyright (C) 2020 Konsulko Group * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,21 +19,19 @@ #define HOMESCREEN_CLIENTMANAGER_H #include -#include #include #include #include #include "hs-helper.h" #include "hs-client.h" -typedef struct HS_ClientCtxt -{ +struct HS_ClientCtxt { std::string id; - HS_ClientCtxt(const char *appid) + HS_ClientCtxt(const std::string &appid) { id = appid; } -} HS_ClientCtxt; +}; class HS_ClientManager { @@ -46,14 +45,12 @@ public: static HS_ClientManager* instance(void); int init(void); - HS_Client* find(std::string appid); - HS_Client* getClient(afb_req req, std::string appid); - std::vector getAllClient(void); - void removeClientCtxt(void *data); + int handleRequest(afb_req_t request, const char *verb, const char *appid = nullptr); + int pushEvent(const char *event, struct json_object *param, std::string appid = ""); + void removeClientCtxt(void *data); // don't use, internal only -private: - HS_ClientCtxt* createClientCtxt(afb_req req, std::string appid); - HS_Client* addClient(afb_req req, std::string appid); + 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); private: @@ -63,4 +60,4 @@ private: std::mutex mtx; }; -#endif // HOMESCREEN_CLIENTMANAGER_H \ No newline at end of file +#endif // HOMESCREEN_CLIENTMANAGER_H