X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=src%2Fapplist.cpp;h=462a0d81ce40d34a43622f5b1ec36f171d1dc95e;hb=9cfdd8937209e3e47b551e7a188add100cbae2e7;hp=66289ea7671b32239b448fb9b5b042af0a47f1d7;hpb=46d1ad85e8a4531dcb7dc9599f6c09554e2cdfbb;p=apps%2Fagl-service-windowmanager.git diff --git a/src/applist.cpp b/src/applist.cpp index 66289ea..462a0d8 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -88,20 +88,20 @@ int AppList::countClient() return this->app2client.size(); } -unsigned AppList::currentSequenceNumber() +unsigned AppList::currentRequestNumber() { return this->current_req; } // Is this function necessary ? -unsigned AppList::getSequenceNumber(const string &appid) +unsigned AppList::getRequestNumber(const string &appid) { for (const auto &x : this->req_list) { // Since app will not request twice and more, comparing appid is enough? if ((x.trigger.appid == appid)) { - return x.seq_num; + return x.req_num; } } return 0; @@ -111,15 +111,15 @@ unsigned AppList::addAllocateRequest(WMRequest req) { if (this->req_list.size() == 0) { - req.seq_num = current_req; + req.req_num = current_req; } else { - HMI_SEQ_DEBUG(this->current_req, "add: %d", this->req_list.back().seq_num + 1); - req.seq_num = this->req_list.back().seq_num + 1; + HMI_SEQ_DEBUG(this->current_req, "add: %d", this->req_list.back().req_num + 1); + req.req_num = this->req_list.back().req_num + 1; } this->req_list.push_back(req); - return req.seq_num; // return 1; if you test time_expire + return req.req_num; // return 1; if you test time_expire } bool AppList::requestFinished() @@ -131,7 +131,7 @@ struct WMTrigger AppList::getRequest(unsigned req_num) { for (auto &x : this->req_list) { - if (req_num == x.seq_num) + if (req_num == x.req_num) { return x.trigger; } @@ -142,7 +142,7 @@ const vector &AppList::getActions(unsigned req_num) { for (auto &x : this->req_list) { - if (req_num == x.seq_num) + if (req_num == x.req_num) { return x.sync_draw_req; } @@ -154,7 +154,7 @@ bool AppList::setAction(unsigned req_num, const struct WMAction &action) bool result = false; for (auto &x : this->req_list) { - if (req_num != x.seq_num) + if (req_num != x.req_num) { continue; } @@ -178,7 +178,7 @@ bool AppList::setAction(unsigned req_num, const string &appid, const string &rol bool result = false; for (auto &x : req_list) { - if (req_num != x.seq_num) + if (req_num != x.req_num) { continue; } @@ -192,16 +192,21 @@ bool AppList::setAction(unsigned req_num, const string &appid, const string &rol return result; } +/** + * This function checks + * * req_num is equal to current request number + * * appid and role are equeal to the appid and role stored in action list(sync_draw_req) + */ bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const string &role) { bool result = false; for (auto &x : req_list) { - if (req_num < x.seq_num) + if (req_num < x.req_num) { break; } - if (req_num == x.seq_num) + if (req_num == x.req_num) { for (auto &y : x.sync_draw_req) { @@ -219,7 +224,7 @@ bool AppList::setEndDrawFinished(unsigned req_num, const string &appid, const st /** * @brief check all actions of the requested sequence is finished - * @param unsigned sequence_num + * @param unsigned request_number * @return true if all action is set. */ bool AppList::endDrawFullfilled(unsigned req_num) @@ -227,11 +232,11 @@ bool AppList::endDrawFullfilled(unsigned req_num) bool result = false; for (const auto &x : req_list) { - if (req_num < x.seq_num) + if (req_num < x.req_num) { break; } - if (req_num == x.seq_num) + if (req_num == x.req_num) { result = true; for (const auto &y : x.sync_draw_req) @@ -247,11 +252,11 @@ bool AppList::endDrawFullfilled(unsigned req_num) return result; } -void AppList::removeRequest(unsigned req_seq) +void AppList::removeRequest(unsigned req_num) { this->req_list.erase(remove_if(this->req_list.begin(), this->req_list.end(), - [req_seq](WMRequest x) { - return x.seq_num == req_seq; + [req_num](WMRequest x) { + return x.req_num == req_num; })); } @@ -286,7 +291,7 @@ void AppList::reqDump() DUMP("current request : %d", current_req); for (const auto &x : req_list) { - DUMP("requested with : %d", x.seq_num); + DUMP("requested with : %d", x.req_num); DUMP("Trigger : (APPID :%s, ROLE :%s, AREA :%s, TASK: %d)", x.trigger.appid.c_str(), x.trigger.role.c_str(),