aboutsummaryrefslogtreecommitdiffstats
path: root/src/applist.hpp
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-05-25 11:17:55 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-05-25 11:30:01 +0900
commit5ac52dc6412f8311b6cfbd0e99652c914d5c6168 (patch)
treeed2b67670fff877f1fca852d982f512d6195c08a /src/applist.hpp
parent973a7123c0bced7c7e7d9dc6dc5e990a0e2838ac (diff)
[Local]:5th step for blocking sequence
Change-Id: Ic47c59a77d3b45f62bed8ee2617dddc4ed58afbe Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/applist.hpp')
-rw-r--r--src/applist.hpp60
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;
};
}