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


C++ Operation::perform方法代码示例

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


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

示例1: alloc

 void alloc()
 {
     m_operation->perform(m_kind, m_allocation, m_size, m_offset, m_alignment);
 }
开发者ID:francois-wellenreiter,项目名称:memkind,代码行数:4,代码来源:framework.hpp

示例2: free

 void free()
 {
     m_freeOperation->perform(m_kind, m_allocation);
 }
开发者ID:francois-wellenreiter,项目名称:memkind,代码行数:4,代码来源:framework.hpp

示例3: SessionNotConnectedException

void
IceGridManager::performOp( Operation &op, int timeoutMs )
{
    // serialize access to admin proxy
//     IceUtil::Mutex::Lock lock(adminMutex_);

    // minimize critical section in order to be able to perform multiple operations
    // simultaneously
    IceGrid::AdminPrx iceGridAdmin;
    gbxutilacfr::Tracer* tracer;
    {
        IceUtil::Mutex::Lock lock(adminMutex_);

        if ( !iceGridAdmin_ ) {
            string warn = "Operation "+op.toString()+" could not be performed because the proxy to IceGrid/Admin is NULL. "
                        + "Session state: "+IceGridSession::toString( getState() );
            throw SessionNotConnectedException( ERROR_INFO, warn );
        }

        // NOTE: cannot currently change timeout because changing timeout invalidates the secure session!
        // use the specified timeout
//         if ( timeoutMs>0 )
//             iceGridAdmin = IceGrid::AdminPrx::uncheckedCast( iceGridAdmin_->ice_timeout( timeoutMs ) );
//         else
            iceGridAdmin = iceGridAdmin_;

        tracer = &context_.tracer();
    }
    // end of critical section

    stringstream exceptionSS;
    gbxiceutilacfr::Timer timer;
    try {
        stringstream debugSS;
        debugSS<<"IceGridManager: performing "<<op.toString()<<" with timeout="<<timeoutMs<<"ms";
        tracer->debug( debugSS.str(),7 );
//         context_.tracer().debug( debugSS.str(),5 );

        // notice the use of the local copy of the Admin proxy
        op.perform( iceGridAdmin );
//         op.perform( iceGridAdmin_ );

        stringstream ss;
        ss << "IceGridManager: "<<op.toString()<<" done.  Took "<<timer.elapsedSec()<<"s";
        tracer->debug( ss.str(),10 );
//         context_.tracer().debug( ss.str(),10 );
        return;
    }
    catch ( const Ice::ObjectNotExistException &e ) {
        exceptionSS << "IceGridManager: "<<op.toString()<<"(): caught exception after "
                <<timer.elapsedSec()<<"s : "<<e;
    }
    catch ( const Ice::TimeoutException &e ) {
        exceptionSS << "IceGridManager: "<<op.toString()<<"(): caught exception after "
                <<timer.elapsedSec()<<"s : "<<e;
    }

    tracer->error( exceptionSS.str() );
//     context_.tracer().error( exceptionSS.str() );
    // destroy old admin proxy, it's no longer valid
//     {
//         IceUtil::Mutex::Lock lock(adminMutex_);
//         iceGridAdmin_ = 0;
//     }
//     tryCreateSession();

    throw gbxutilacfr::Exception( ERROR_INFO, exceptionSS.str() );    
}
开发者ID:mjs513,项目名称:orca-robotics,代码行数:68,代码来源:icegridmanager.cpp


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