diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-25 17:12:19 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-05-25 19:16:58 +0900 |
commit | 6d0e22de7814f4fbf2201d84d207eec570e821cd (patch) | |
tree | 389dfb91b1a68681a68d843683af998b00844619 /src/applist.cpp | |
parent | b04339fc03543cbd34b6e9db7adc9eb35caed5c0 (diff) |
Rework: Block the sequence
Todo:
* emit error event
** decide error format
* rework release WR
Change-Id: Id96fa629aff984aa03ed68f1d3db711bb43ba77b
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/applist.cpp')
-rw-r--r-- | src/applist.cpp | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/src/applist.cpp b/src/applist.cpp index be88977..36c5917 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -21,6 +21,7 @@ using std::shared_ptr; using std::string; using std::unique_ptr; +using std::vector; namespace wm { @@ -81,19 +82,39 @@ unsigned AppList::getSequenceNumber(const string &appid){ unsigned AppList::addAllocateRequest(WMRequest req){ if(req_list.size() == 0){ - req.seq_num = 1; + req.seq_num = current_seq; } else{ + HMI_SEQ_DEBUG(current_seq, "real: %d", req_list.back().seq_num + 1); req.seq_num = req_list.back().seq_num + 1; } req_list.push_back(req); - return req.seq_num; + return req.seq_num; // return 1; if you test time_expire } bool AppList::requestFinished(){ return req_list.empty(); } +struct WMTrigger AppList::getRequest(unsigned request_seq){ + for(auto& x : req_list){ + if (request_seq == x.seq_num) + { + return x.trigger; + } + } +} + +const vector<struct WMAction>& AppList::getActions(unsigned request_seq){ + for (auto &x : req_list) + { + if (request_seq == x.seq_num) + { + return x.sync_draw_req; + } + } +} + bool AppList::setAction(unsigned request_seq, const string &appid, const string &role, const string &area){ bool result = false; for (auto& x : req_list) @@ -190,9 +211,9 @@ void AppList::client_dump(){ void AppList::req_dump() { DUMP("======= req dump ====="); - DUMP("current sequence: %d", current_seq); + DUMP("current request : %d", current_seq); for(const auto& x : req_list){ - DUMP("sequence number: %d", x.seq_num); + DUMP("requested with : %d", x.seq_num); DUMP("Trigger : (APPID :%s, ROLE :%s, AREA :%s, TASK: %d)", x.trigger.appid.c_str(), x.trigger.role.c_str(), @@ -201,7 +222,7 @@ void AppList::req_dump() for (const auto& y : x.sync_draw_req){ DUMP( - "Action : (APPID :%s, ROLE :%s, AREA :%s, END_RAW_FINISHED: %d)", + "Action : (APPID :%s, ROLE :%s, AREA :%s, END_DRAW_FINISHED: %d)", y.appid.c_str(), y.role.c_str(), y.area.c_str(), |