本文整理汇总了C++中ITask::GetErrCtxt方法的典型用法代码示例。如果您正苦于以下问题:C++ ITask::GetErrCtxt方法的具体用法?C++ ITask::GetErrCtxt怎么用?C++ ITask::GetErrCtxt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ITask
的用法示例。
在下文中一共展示了ITask::GetErrCtxt方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
//---------------------------------------------------------------------------
// @function:
// CAutoMemoryPool::~CAutoMemoryPool
//
// @doc:
// Release the pool back to the manager and perform leak checks if
// (1) strict leak checking indicated, or
// (2) no checking while pending exception indicated and no pending exception
//
//---------------------------------------------------------------------------
CAutoMemoryPool::~CAutoMemoryPool()
{
if (NULL == m_mp)
{
return;
}
// suspend cancellation
CAutoSuspendAbort asa;
#ifdef GPOS_DEBUG
ITask *task = ITask::Self();
// ElcExc must be used inside tasks only
GPOS_ASSERT_IMP(ElcExc == m_leak_check_type, NULL != task);
GPOS_TRY
{
if (ElcStrict == m_leak_check_type || (ElcExc == m_leak_check_type && !task->GetErrCtxt()->IsPending()))
{
gpos::IOstream &os = gpos::oswcerr;
// check for leaks, use this to trigger standard Assert handling
m_mp->AssertEmpty(os);
}
// release pool
CMemoryPoolManager::GetMemoryPoolMgr()->Destroy(m_mp);
}
GPOS_CATCH_EX(ex)
{
GPOS_ASSERT(GPOS_MATCH_EX(ex, CException::ExmaSystem, CException::ExmiAssert));
// release pool
CMemoryPoolManager::GetMemoryPoolMgr()->Destroy(m_mp);
GPOS_RETHROW(ex);
}
GPOS_CATCH_END;
#else // GPOS_DEBUG
// hand in pool and return
CMemoryPoolManager::GetMemoryPoolMgr()->Destroy(m_mp);
#endif // GPOS_DEBUG
}