CMS 3D CMS Logo

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

#include <FinalWaitingTask.h>

Inheritance diagram for edm::FinalWaitingTask:
edm::WaitingTask edm::TaskBase

Public Member Functions

bool done () const noexcept
 
void execute () final
 
 FinalWaitingTask ()=delete
 
 FinalWaitingTask (tbb::task_group &iGroup)
 
void wait ()
 
std::exception_ptr waitNoThrow ()
 
- Public Member Functions inherited from edm::WaitingTask
std::exception_ptr exceptionPtr () const
 Returns exception thrown by dependent task. More...
 
 WaitingTask ()
 Constructor. More...
 
 ~WaitingTask () override
 
- Public Member Functions inherited from edm::TaskBase
unsigned int decrement_ref_count ()
 
void increment_ref_count ()
 
 TaskBase ()
 Constructor. More...
 
virtual ~TaskBase ()=default
 

Private Member Functions

void recycle () final
 

Private Attributes

std::atomic< bool > m_done
 
tbb::task_group * m_group
 
tbb::task_handle m_handle
 

Additional Inherited Members

- Protected Member Functions inherited from edm::WaitingTask
std::exception_ptr const & uncheckedExceptionPtr () const
 

Detailed Description

Definition at line 31 of file FinalWaitingTask.h.

Constructor & Destructor Documentation

◆ FinalWaitingTask() [1/2]

edm::FinalWaitingTask::FinalWaitingTask ( )
delete

◆ FinalWaitingTask() [2/2]

edm::FinalWaitingTask::FinalWaitingTask ( tbb::task_group &  iGroup)
inlineexplicit

Definition at line 34 of file FinalWaitingTask.h.

35  : m_group{&iGroup}, m_handle{iGroup.defer([]() {})}, m_done{false} {}
tbb::task_handle m_handle
std::atomic< bool > m_done
tbb::task_group * m_group

Member Function Documentation

◆ done()

bool edm::FinalWaitingTask::done ( ) const
inlinenoexcept

Definition at line 39 of file FinalWaitingTask.h.

References m_done.

39 { return m_done.load(); }
std::atomic< bool > m_done

◆ execute()

void edm::FinalWaitingTask::execute ( void  )
inlinefinalvirtual

Implements edm::TaskBase.

Definition at line 37 of file FinalWaitingTask.h.

References m_done.

37 { m_done = true; }
std::atomic< bool > m_done

◆ recycle()

void edm::FinalWaitingTask::recycle ( )
inlinefinalprivatevirtual

Reimplemented from edm::TaskBase.

Definition at line 53 of file FinalWaitingTask.h.

References m_group, m_handle, and eostools::move().

53 { m_group->run(std::move(m_handle)); }
tbb::task_handle m_handle
def move(src, dest)
Definition: eostools.py:511
tbb::task_group * m_group

◆ wait()

void edm::FinalWaitingTask::wait ( )
inline

Definition at line 41 of file FinalWaitingTask.h.

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

41  {
42  m_group->wait();
43  if (exceptionPtr()) {
44  std::rethrow_exception(exceptionPtr());
45  }
46  }
std::exception_ptr exceptionPtr() const
Returns exception thrown by dependent task.
Definition: WaitingTask.h:51
tbb::task_group * m_group

◆ waitNoThrow()

std::exception_ptr edm::FinalWaitingTask::waitNoThrow ( )
inline

Definition at line 47 of file FinalWaitingTask.h.

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

47  {
48  m_group->wait();
49  return exceptionPtr();
50  }
std::exception_ptr exceptionPtr() const
Returns exception thrown by dependent task.
Definition: WaitingTask.h:51
tbb::task_group * m_group

Member Data Documentation

◆ m_done

std::atomic<bool> edm::FinalWaitingTask::m_done
private

Definition at line 56 of file FinalWaitingTask.h.

Referenced by done(), and execute().

◆ m_group

tbb::task_group* edm::FinalWaitingTask::m_group
private

Definition at line 54 of file FinalWaitingTask.h.

Referenced by recycle(), wait(), and waitNoThrow().

◆ m_handle

tbb::task_handle edm::FinalWaitingTask::m_handle
private

Definition at line 55 of file FinalWaitingTask.h.

Referenced by recycle().