CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::WaitingTaskHolder Class Reference

#include <WaitingTaskHolder.h>

Public Member Functions

void doneWaiting (std::exception_ptr iExcept)
 
WaitingTaskHolderoperator= (const WaitingTaskHolder &iRHS)
 
void presetTaskAsFailed (std::exception_ptr iExcept)
 
bool taskHasFailed () const
 
 WaitingTaskHolder ()
 
 WaitingTaskHolder (edm::WaitingTask *iTask)
 
 WaitingTaskHolder (const WaitingTaskHolder &iHolder)
 
 WaitingTaskHolder (WaitingTaskHolder &&iOther)
 
 ~WaitingTaskHolder ()
 

Private Attributes

WaitingTaskm_task
 

Detailed Description

Definition at line 30 of file WaitingTaskHolder.h.

Constructor & Destructor Documentation

edm::WaitingTaskHolder::WaitingTaskHolder ( )
inline

Definition at line 34 of file WaitingTaskHolder.h.

34  :
35  m_task(nullptr) {}
edm::WaitingTaskHolder::WaitingTaskHolder ( edm::WaitingTask iTask)
inlineexplicit

Definition at line 37 of file WaitingTaskHolder.h.

References m_task.

37  :
38  m_task(iTask)
39  {m_task->increment_ref_count();}
edm::WaitingTaskHolder::~WaitingTaskHolder ( )
inline

Definition at line 40 of file WaitingTaskHolder.h.

References doneWaiting(), and m_task.

40  {
41  if(m_task) {
42  doneWaiting(std::exception_ptr{});
43  }
44  }
void doneWaiting(std::exception_ptr iExcept)
edm::WaitingTaskHolder::WaitingTaskHolder ( const WaitingTaskHolder iHolder)
inline

Definition at line 46 of file WaitingTaskHolder.h.

References m_task.

46  :
47  m_task(iHolder.m_task) {
48  m_task->increment_ref_count();
49  }
edm::WaitingTaskHolder::WaitingTaskHolder ( WaitingTaskHolder &&  iOther)
inline

Definition at line 51 of file WaitingTaskHolder.h.

51  :
52  m_task(iOther.m_task) {
53  iOther.m_task = nullptr;
54  }

Member Function Documentation

void edm::WaitingTaskHolder::doneWaiting ( std::exception_ptr  iExcept)
inline
WaitingTaskHolder& edm::WaitingTaskHolder::operator= ( const WaitingTaskHolder iRHS)
inline

Definition at line 56 of file WaitingTaskHolder.h.

References m_task, std::swap(), and tmp.

56  {
57  WaitingTaskHolder tmp(iRHS);
58  std::swap(m_task, tmp.m_task);
59  return *this;
60  }
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void edm::WaitingTaskHolder::presetTaskAsFailed ( std::exception_ptr  iExcept)
inline

Use in the case where you need to inform the parent task of a failure before some other child task which may be run later reports a different, but related failure. You must later call doneWaiting in the same thread passing the same exceptoin.

Definition at line 74 of file WaitingTaskHolder.h.

References edm::WaitingTask::dependentTaskFailed(), and m_task.

74  {
75  if(iExcept) {
76  m_task->dependentTaskFailed(iExcept);
77  }
78  }
void dependentTaskFailed(std::exception_ptr iPtr)
Called if waited for task failed.
Definition: WaitingTask.h:64
bool edm::WaitingTaskHolder::taskHasFailed ( ) const
inline

Definition at line 63 of file WaitingTaskHolder.h.

References edm::WaitingTask::exceptionPtr(), and m_task.

Referenced by edm::EventProcessor::beginLumiAsync().

63 { return m_task->exceptionPtr() != nullptr; }
std::exception_ptr const * exceptionPtr() const
Returns exception thrown by dependent task.
Definition: WaitingTask.h:54

Member Data Documentation

WaitingTask* edm::WaitingTaskHolder::m_task
private