bool ServiceManager::Call(LPCSTR p_serviceID, LPCSTR p_function, const ServiceArg &p_arg1, const ServiceArg &p_arg2, const ServiceArg &p_arg3, const ServiceArg &p_arg4) { Service *service = GetService(p_serviceID); if (service) { ATOM function = FindAtomA(p_function); if (function) { if (typeid(p_arg4) != typeid(ServiceArg)) { return service->Call(function, p_arg1, p_arg2, p_arg3, p_arg4); } if (typeid(p_arg3) != typeid(ServiceArg)) { return service->Call(function, p_arg1, p_arg2, p_arg3); } if (typeid(p_arg2) != typeid(ServiceArg)) { return service->Call(function, p_arg1, p_arg2); } if (typeid(p_arg1) != typeid(ServiceArg)) { return service->Call(function, p_arg1); } return service->Call(function); } } return false; }
bool ServiceManager::SetServiceProperty(LPCSTR p_serviceID, LPCSTR p_property, const ServiceArg &p_value) { Service *service = GetService(p_serviceID); if (service) { //ATOM serviceID = FindAtomA(p_serviceID); ATOM propertyFn = FindAtom(TEXT("FN_SetProperty")); ATOM property = FindAtomA(p_property); return service->Call(propertyFn, Arg<ATOM>(property), p_value); //return service->SetProperty(serviceID, property, p_value); } else { return false; } }