this->clientDump();
}
+void AppList::addClient(const string &appid, unsigned layer, const string &role)
+{
+ std::lock_guard<std::mutex> lock(this->mtx);
+ shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, layer, role);
+ this->app2client[appid] = client;
+ this->clientDump();
+}
+
+/**
+ * Add Client to the list
+ *
+ * This function is overload function.
+ * But this function just register application.
+ * So an application does not have role, surface, layer.
+ * Client need to register role and layer afterward.
+ *
+ * @param string[in] Application id. This will be the key to withdraw the information.
+ * @return None
+ * @attention This function should be called once for the app
+ * Caller should take care not to be called more than once.
+ */
+void AppList::addClient(const string &appid)
+{
+ std::lock_guard<std::mutex> lock(this->mtx);
+ shared_ptr<WMClient> client = std::make_shared<WMClient>(appid, 0, "");
+ this->app2client[appid] = client;
+ this->clientDump();
+}
+
/**
* Remove WMClient from the list
*
*/
shared_ptr<WMClient> AppList::lookUpClient(const string &appid)
{
- return this->app2client.at(appid);
+ if(this->app2client.count(appid) != 0)
+ {
+ return this->app2client.at(appid);
+ }
+ else
+ {
+ return nullptr;
+ }
}
/**
* Returns AppID if found.
*
* @param unsigned[in] surfaceID
- * @param string[in] role
* @param bool[in,out] AppID is found or not
* @return AppID
* @attention If AppID is not found, param found will be false.
*/
-string AppList::getAppID(unsigned surface, const string& role, bool* found) const
+string AppList::getAppID(unsigned surface, bool* found) const
{
*found = false;
for (const auto &x : this->app2client)
{
- if(x.second->surfaceID(role) == surface){
+ if(x.second->surfaceID() == surface){
*found = true;
return x.second->appID();
}
}
}
HMI_SEQ_ERROR(req_num, "Couldn't get action with the request : %d", req_num);
+ {
+ static vector<struct WMAction> empty;
+ return empty;
+ }
}
/**