diff options
Diffstat (limited to 'src/applist.hpp')
-rw-r--r-- | src/applist.hpp | 60 |
1 files changed, 33 insertions, 27 deletions
diff --git a/src/applist.hpp b/src/applist.hpp index 55355ef..5da91cf 100644 --- a/src/applist.hpp +++ b/src/applist.hpp @@ -33,19 +33,32 @@ typedef enum Task{ TASK_RELEASE }ResourceTask; -struct WMRequest{ +struct WMTriger { + std::string appid; + std::string role; + std::string area; + Task task; +}; + +struct WMAction +{ + std::string appid; + std::string role; + std::string area; + bool end_draw_finished; +}; + +struct WMRequest +{ + WMRequest(); explicit WMRequest(std::string appid, std::string role, std::string area, ResourceTask task); virtual ~WMRequest(); WMRequest(const WMRequest &obj); - std::string appid; - std::string role; - std::string area; - Task task; unsigned seq_num; - bool allocating; - bool end_draw_finished; + struct WMTriger trigger; + std::vector<struct WMAction> sync_draw_req; }; class AppList { @@ -58,6 +71,7 @@ public: void addClient(const std::string &appid, const std::string &role); void removeClient(const std::string &appid); bool contains(const std::string &appid); + int countClient(); std::shared_ptr<WMClient> lookUpClient(const std::string &appid); // Request Interface @@ -67,29 +81,21 @@ public: /* TODO: consider, which is better WMClient or std::string appid? if appid is key to manage resources, it is better to select std::string otherwise WMClient is better, IMO */ - bool requestFinished(); - unsigned lookUpAllocatingApp(const std::string &appid); - void setEndDrawFinished(unsigned request_seq, const std::string &role); - bool endDrawFullfilled(unsigned request_seq); - void removeRequest(unsigned request_seq); - void setCurrentSequence(unsigned request_seq); - bool haveRequest(); - /* void revertRequestingState(); - void removeAllRequesting(); */ - - //void revertRequestingState();//??? + bool requestFinished(); + bool setAction(unsigned request_seq, const std::string &appid, const std::string &role, const std::string &area); + bool setEndDrawFinished(unsigned request_seq, const std::string &appid, const std::string &role); + bool endDrawFullfilled(unsigned request_seq); + void removeRequest(unsigned request_seq); + void next(); + bool haveRequest(); - /* bool queue(int request_num); - bool pushTop(int request_num); - bool dequeue(); - void deleteAllElement(); - void removeElement(int request_num); - bool hasElement(int request_num); */ + void client_dump(); + void req_dump(); private: - std::vector<WMRequest> req_list; - std::unordered_map<std::string, std::shared_ptr<WMClient>> client_list; - unsigned current_seq; + std::vector<WMRequest> req_list; + std::unordered_map<std::string, std::shared_ptr<WMClient>> client_list; + unsigned current_seq; }; } |