From 7f6ceaf920b5cb0d5984b8e8294f8ce0f52dfbbb Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Fri, 8 Jun 2018 00:53:53 +0900 Subject: Add const to get functions Change-Id: Ibb6976639018f4f45132577f77d57096e2512997 Signed-off-by: Kazumasa Mitsunari --- src/applist.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/applist.cpp') diff --git a/src/applist.cpp b/src/applist.cpp index 462a0d8..2575849 100644 --- a/src/applist.cpp +++ b/src/applist.cpp @@ -53,7 +53,7 @@ void AppList::removeClient(const string &appid) this->app2client.erase(appid); } -bool AppList::contains(const string &appid) +bool AppList::contains(const string &appid) const { auto result = this->app2client.find(appid); return (this->app2client.end() != result) ? true : false; @@ -83,18 +83,18 @@ shared_ptr AppList::lookUpClient(const string &appid) return this->app2client.at(appid); } -int AppList::countClient() +int AppList::countClient() const { return this->app2client.size(); } -unsigned AppList::currentRequestNumber() +unsigned AppList::currentRequestNumber() const { return this->current_req; } // Is this function necessary ? -unsigned AppList::getRequestNumber(const string &appid) +unsigned AppList::getRequestNumber(const string &appid) const { for (const auto &x : this->req_list) { @@ -122,14 +122,14 @@ unsigned AppList::addAllocateRequest(WMRequest req) return req.req_num; // return 1; if you test time_expire } -bool AppList::requestFinished() +bool AppList::requestFinished() const { return this->req_list.empty(); } struct WMTrigger AppList::getRequest(unsigned req_num) { - for (auto &x : this->req_list) + for (const auto &x : this->req_list) { if (req_num == x.req_num) { @@ -269,7 +269,7 @@ void AppList::next() } } -bool AppList::haveRequest() +bool AppList::haveRequest() const { return !this->req_list.empty(); } -- cgit 1.2.3-korg