本文整理汇总了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);
}
示例2: free
void free()
{
m_freeOperation->perform(m_kind, m_allocation);
}
示例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() );
}