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)
 
WaitingTaskHolderoperator= (WaitingTaskHolder &&iRHS)
 
void presetTaskAsFailed (std::exception_ptr iExcept)
 
bool taskHasFailed () const
 
 WaitingTaskHolder ()
 
 WaitingTaskHolder (const WaitingTaskHolder &iHolder)
 
 WaitingTaskHolder (edm::WaitingTask *iTask)
 
 WaitingTaskHolder (WaitingTaskHolder &&iOther)
 
 ~WaitingTaskHolder ()
 

Private Attributes

WaitingTaskm_task
 

Detailed Description

Definition at line 30 of file WaitingTaskHolder.h.

Constructor & Destructor Documentation

◆ WaitingTaskHolder() [1/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( )
inline

Definition at line 32 of file WaitingTaskHolder.h.

32 : m_task(nullptr) {}

◆ WaitingTaskHolder() [2/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( edm::WaitingTask iTask)
inlineexplicit

Definition at line 34 of file WaitingTaskHolder.h.

34 : m_task(iTask) { m_task->increment_ref_count(); }

References m_task.

◆ ~WaitingTaskHolder()

edm::WaitingTaskHolder::~WaitingTaskHolder ( )
inline

Definition at line 35 of file WaitingTaskHolder.h.

35  {
36  if (m_task) {
37  doneWaiting(std::exception_ptr{});
38  }
39  }

References doneWaiting(), and m_task.

◆ WaitingTaskHolder() [3/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( const WaitingTaskHolder iHolder)
inline

Definition at line 41 of file WaitingTaskHolder.h.

41 : m_task(iHolder.m_task) { m_task->increment_ref_count(); }

References m_task.

◆ WaitingTaskHolder() [4/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( WaitingTaskHolder &&  iOther)
inline

Definition at line 43 of file WaitingTaskHolder.h.

43 : m_task(iOther.m_task) { iOther.m_task = nullptr; }

Member Function Documentation

◆ doneWaiting()

void edm::WaitingTaskHolder::doneWaiting ( std::exception_ptr  iExcept)
inline

◆ operator=() [1/2]

WaitingTaskHolder& edm::WaitingTaskHolder::operator= ( const WaitingTaskHolder iRHS)
inline

Definition at line 45 of file WaitingTaskHolder.h.

45  {
46  WaitingTaskHolder tmp(iRHS);
47  std::swap(m_task, tmp.m_task);
48  return *this;
49  }

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

◆ operator=() [2/2]

WaitingTaskHolder& edm::WaitingTaskHolder::operator= ( WaitingTaskHolder &&  iRHS)
inline

Definition at line 51 of file WaitingTaskHolder.h.

51  {
53  std::swap(m_task, tmp.m_task);
54  return *this;
55  }

References m_task, eostools::move(), std::swap(), and createJobs::tmp.

◆ presetTaskAsFailed()

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 69 of file WaitingTaskHolder.h.

69  {
70  if (iExcept) {
71  m_task->dependentTaskFailed(iExcept);
72  }
73  }

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

◆ taskHasFailed()

bool edm::WaitingTaskHolder::taskHasFailed ( ) const
inline

Definition at line 58 of file WaitingTaskHolder.h.

58 { return m_task->exceptionPtr() != nullptr; }

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

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

Member Data Documentation

◆ m_task

WaitingTask* edm::WaitingTaskHolder::m_task
private
edm::WaitingTaskHolder::m_task
WaitingTask * m_task
Definition: WaitingTaskHolder.h:92
edm::WaitingTaskHolder::doneWaiting
void doneWaiting(std::exception_ptr iExcept)
Definition: WaitingTaskHolder.h:75
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
edm::WaitingTask::exceptionPtr
std::exception_ptr const * exceptionPtr() const
Returns exception thrown by dependent task.
Definition: WaitingTask.h:51
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
WaitingTaskHolder
edm::WaitingTask::dependentTaskFailed
void dependentTaskFailed(std::exception_ptr iPtr)
Called if waited for task failed.
Definition: WaitingTask.h:59
eostools.move
def move(src, dest)
Definition: eostools.py:511