当前位置: 首页>>代码示例>>C++>>正文


C++ CService::load方法代码示例

本文整理汇总了C++中CService::load方法的典型用法代码示例。如果您正苦于以下问题:C++ CService::load方法的具体用法?C++ CService::load怎么用?C++ CService::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CService的用法示例。


在下文中一共展示了CService::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: load

 Error CServiceManager::load(const Service::Uid & service)
 {
    LOG4CPLUS_TRACE_METHOD(msLogger, __PRETTY_FUNCTION__);
    mSystemServicesMutex.lock();
    tServiceSet::const_iterator it = mSystemServices.find(service);
    if (mSystemServices.end() == it)
    {
       mSystemServicesMutex.unlock();
       LOG4CPLUS_ERROR(msLogger, "hasn't found the requested service");
       return Error(SERVICE_NOT_FOUND, "The service requested: " + service.value() 
          + " was not found among system services, please check that it is present in " + mXmlPath, false);
    }
    mSystemServicesMutex.unlock();
    mActiveServicesMutex.lock();
    tServiceMap::const_iterator sit = mActiveServices.find(service);
    if (mActiveServices.end() != sit)
    {
       mActiveServicesMutex.unlock();
       LOG4CPLUS_ERROR(msLogger, "The requested service is among active!");
       return Error(SERVICE_ALREADY_LOADED, "The service requested: " + service.value() 
          + " is already loaded!", false);
    }
    mActiveServicesMutex.unlock();
    CService * pService = new CService(mXmlPath, mAppInfo, service);
    mCallbacksMutex.lock();
    Error cserviceError = pService->load(mCallbacks);
    if (!cserviceError.isNoError())
    {
       mCallbacksMutex.unlock();
       LOG4CPLUS_ERROR(msLogger, "CService couldn't load the service: " + cserviceError.toString());
       delete pService;
       return cserviceError;
    }
    mCallbacksMutex.unlock();
    mActiveServicesMutex.lock();
    mActiveServices[service] = pService;
    mActiveServicesMutex.unlock();
    LOG4CPLUS_TRACE(msLogger, "Loaded a service successfully");
    return Error::NoError();
 }
开发者ID:Luxoft,项目名称:iviLink,代码行数:40,代码来源:CServiceManager.cpp


注:本文中的CService::load方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。