diff options
author | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-06-08 00:53:53 +0900 |
---|---|---|
committer | Kazumasa Mitsunari <knimitz@witz-inc.co.jp> | 2018-06-08 00:53:53 +0900 |
commit | 7f6ceaf920b5cb0d5984b8e8294f8ce0f52dfbbb (patch) | |
tree | c05b6ee70085a9f62db6d5bcdbcd519ac359cc7f /src/applist.cpp | |
parent | 9cfdd8937209e3e47b551e7a188add100cbae2e7 (diff) |
Add const to get functions
Change-Id: Ibb6976639018f4f45132577f77d57096e2512997
Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
Diffstat (limited to 'src/applist.cpp')
-rw-r--r-- | src/applist.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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<WMClient> 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(); } |