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


C++ InterfaceGCMFunctionType::ComponentDisconnect方法代码示例

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


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

示例1: InterfaceGCMCommands_ComponentDisconnect

// MJ: Another method that does the same thing but accepts a single parameter
// as connection id should be added.
void mtsManagerComponentServer::InterfaceGCMCommands_ComponentDisconnect(const mtsDescriptionConnection & arg)
{
    if (!GCM->Disconnect(arg)) {
        CMN_LOG_CLASS_RUN_ERROR << "InterfaceGCMCommands_ComponentDisconnect: failed to execute \"Component Disconnect\" for: " << arg << std::endl;
        return;
    }

#if 0
    InterfaceGCMFunctionType *functionSet;
    if (arg.Client.ProcessName != arg.Server.ProcessName) {
        // PK TEMP fix for network disconnect
        mtsDescriptionConnection arg2;
        // Step 1: Disconnect Client from ServerProxy
        CMN_LOG_CLASS_RUN_WARNING << "Network disconnect for " << arg << ", step 1 (client side disconnect)" << std::endl;
        arg2 = arg;
        arg2.Server.ProcessName = arg.Client.ProcessName;
        arg2.Server.ComponentName = mtsManagerGlobal::GetComponentProxyName(arg.Server.ProcessName, arg.Server.ComponentName);
        functionSet = InterfaceGCMFunctionMap.GetItem(arg2.Client.ProcessName);
        if (!functionSet) {
            CMN_LOG_CLASS_RUN_ERROR << "InterfaceGCMCommands_ComponentDisconnect: failed to get function set for " << arg2.Client.ProcessName << std::endl;
            return;
        }
        functionSet->ComponentDisconnect(arg2);
        // Step 2: Disconnect ClientProxy from Server
        CMN_LOG_CLASS_RUN_WARNING << "Network disconnect for " << arg << ", step 2 (server side disconnect)" << std::endl;
        arg2 = arg;
        arg2.Client.ProcessName = arg.Server.ProcessName;
        arg2.Client.ComponentName = mtsManagerGlobal::GetComponentProxyName(arg.Client.ProcessName, arg.Client.ComponentName);
        functionSet = InterfaceGCMFunctionMap.GetItem(arg2.Server.ProcessName);
        if (!functionSet) {
            CMN_LOG_CLASS_RUN_ERROR << "InterfaceGCMCommands_ComponentDisconnect: failed to get function set for " << arg2.Server.ProcessName << std::endl;
            return;
        }
        functionSet->ComponentDisconnect(arg2);
        // Step 3: Update the GCM database (send arg unchanged to any MCC)
        // For now, we just fall through to the statement below
        CMN_LOG_CLASS_RUN_WARNING << "Network disconnect for " << arg << ", step 3 (update GCM)" << std::endl;
    }

    // Get a set of function objects that are bound to the InterfaceLCM's provided
    // interface.
    functionSet = InterfaceGCMFunctionMap.GetItem(arg.Client.ProcessName);
    if (!functionSet) {
        CMN_LOG_CLASS_RUN_ERROR << "InterfaceGCMCommands_ComponentDisconnect: failed to execute \"Component Disconnect\": " << arg << std::endl;
        return;
    }

    //functionSet->ComponentDisconnect.ExecuteBlocking(arg);
    functionSet->ComponentDisconnect(arg);
#endif
}
开发者ID:Shuyoung,项目名称:cisst,代码行数:53,代码来源:mtsManagerComponentServer.cpp

示例2: ComponentDisconnect

void mtsManagerComponentServer::ComponentDisconnect(const std::string & processName, const mtsDescriptionConnection & arg)
{
    // Get a set of function objects that are bound to the InterfaceLCM's provided interface.
    InterfaceGCMFunctionType * functionSet = InterfaceGCMFunctionMap.GetItem(processName);
    if (!functionSet) {
        CMN_LOG_CLASS_RUN_ERROR << "ComponentDisconnect: failed to get function set for process \""
            << processName << "\": " << arg << std::endl;
        return;
    }

    //functionSet->ComponentDisconnect.ExecuteBlocking(arg);
    functionSet->ComponentDisconnect(arg);
}
开发者ID:Shuyoung,项目名称:cisst,代码行数:13,代码来源:mtsManagerComponentServer.cpp

示例3: ComponentDisconnect

bool mtsManagerComponentServer::ComponentDisconnect(const std::string & processName, const mtsDescriptionConnection & arg)
{
    // Get a set of function objects that are bound to the InterfaceLCM's provided interface.
    InterfaceGCMFunctionType * functionSet = InterfaceGCMFunctionMap.GetItem(processName);
    if (!functionSet) {
        CMN_LOG_CLASS_RUN_ERROR << "ComponentDisconnect: failed to get function set for process \""
            << processName << "\": " << arg << std::endl;
        return false;
    }

    bool result = true;
#if CISST_MTS_NEW
    //functionSet->ComponentDisconnectNew(arg, result);
    result = false;   // PK HACK: actually works better if we don't call ComponentDisconnect or ComponentDisconnectNew
#else
    //functionSet->ComponentDisconnect.ExecuteBlocking(arg);
    functionSet->ComponentDisconnect(arg);
#endif
    return result;
}
开发者ID:jhu-cisst,项目名称:cisst,代码行数:20,代码来源:mtsManagerComponentServer.cpp


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