namespace smartcard_service_api
{
- void ClientInstance::setPID(int pid)
- {
- this->pid = pid;
- }
-
ServiceInstance *ClientInstance::createService()
{
ServiceInstance *result = NULL;
result = new ServiceInstance(this);
- if (result != NULL)
- {
+ if (result != NULL) {
mapServices.insert(make_pair(result->getHandle(), result));
- }
- else
- {
- _ERR("alloc failed");
+ } else {
+ _ERR("alloc failed"); //LCOV_EXCL_LINE
}
return result;
ServiceInstance *ClientInstance::getService(unsigned int handle)
{
+ /* LCOV_EXCL_START */
ServiceInstance *result = NULL;
map<unsigned int, ServiceInstance *>::iterator item;
}
return result;
+ /* LCOV_EXCL_STOP */
}
void ClientInstance::removeService(unsigned int handle)
{
+ /* LCOV_EXCL_START */
map<unsigned int, ServiceInstance *>::iterator item;
if ((item = mapServices.find(handle)) != mapServices.end())
delete item->second;
mapServices.erase(item);
}
+ /* LCOV_EXCL_STOP */
}
void ClientInstance::removeServices()
mapServices.clear();
}
-#ifndef USE_GDBUS
- bool ClientInstance::sendMessageToAllServices(int socket, const Message &msg)
- {
- bool result = true;
- map<unsigned int, ServiceInstance *>::const_iterator item;
-
- for (item = mapServices.begin(); item != mapServices.end(); item++)
- {
- if (ServerIPC::getInstance()->sendMessage(socket, msg) == false)
- result = false;
- }
-
- return result;
- }
-#endif
-
void ClientInstance::generateCertificationHashes()
{
SignatureHelper::getCertificationHashes(getPID(), certHashes);