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;
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)
{
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)
{
}
}
-bool AppList::haveRequest()
+bool AppList::haveRequest() const
{
return !this->req_list.empty();
}