| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Private Attributes | List of all members
Gaudi::SerialTaskQueue::SerialWorkItem Class Reference

Wrapper for the WorkItem class for internal concurrency bookkeeping. More...

Collaboration diagram for Gaudi::SerialTaskQueue::SerialWorkItem:
[legend]

## Public Member Functions
| SerialWorkItem (WorkItem *item, SerialTaskQueue *serializer)
| Initialize the instance from the WorkiItem and the SerialTaskQueue (for synchronization). More...
void | run ()
| Execute the WorkItem and notify the SerialTaskQueue of the completion. More...

## Private Attributes
std::unique_ptr< WorkItem > | m_item
| Pointer to the WorkItem to run. More...
SerialTaskQueue * | m_serializer
| Pointer to the SerialTaskQueue used for the synchronization. More...

## Detailed Description

Wrapper for the WorkItem class for internal concurrency bookkeeping.

Definition at line 66 of file SerialTaskQueue.h.

## Constructor & Destructor Documentation

Gaudi::SerialTaskQueue::SerialWorkItem::SerialWorkItem | ( | WorkItem * | item,
|  | SerialTaskQueue * | serializer
| ) |  |
| inline

Initialize the instance from the WorkiItem and the SerialTaskQueue (for synchronization).

Note
  the object takes ownership of the WorkItem pointer.

Definition at line 72 of file SerialTaskQueue.h.

72 : m_item( item ), m_serializer( serializer ) {}
Gaudi::SerialTaskQueue::SerialWorkItem::m_item
std::unique_ptr< WorkItem > m_item
Pointer to the WorkItem to run.
Definition: SerialTaskQueue.h:78
Gaudi::SerialTaskQueue::SerialWorkItem::m_serializer
SerialTaskQueue * m_serializer
Pointer to the SerialTaskQueue used for the synchronization.
Definition: SerialTaskQueue.h:80

## Member Function Documentation

void Gaudi::SerialTaskQueue::SerialWorkItem::run | ( |  | ) |
| inline

Execute the WorkItem and notify the SerialTaskQueue of the completion.

Definition at line 110 of file SerialTaskQueue.h.

111 {
112 // run the wrapped task
113 m_item->run();
114
115 // We need to keep the pointer on the stack because we are going to delete
116 // ourselves.
117 SerialTaskQueue* serializer = m_serializer;
118
119 // We call the delete before returning the control to the serialized so that
120 // possible complex code in the task destructor is executed serially.
121 delete this;
122
123 // Notify the queue of the completion, so that it can schedule the next task.
124 serializer->noteCompletion();
125 }
Gaudi::SerialTaskQueue::SerialWorkItem::m_item
std::unique_ptr< WorkItem > m_item
Pointer to the WorkItem to run.
Definition: SerialTaskQueue.h:78
Gaudi::SerialTaskQueue::SerialTaskQueue
SerialTaskQueue()
Default constructor.
Definition: SerialTaskQueue.cpp:13
Gaudi::SerialTaskQueue::noteCompletion
void noteCompletion()
Method used by the tasks to trigger the execution of the next task in the queue.
Definition: SerialTaskQueue.cpp:25
Gaudi::SerialTaskQueue::SerialWorkItem::m_serializer
SerialTaskQueue * m_serializer
Pointer to the SerialTaskQueue used for the synchronization.
Definition: SerialTaskQueue.h:80

## Member Data Documentation

std::unique_ptr<WorkItem> Gaudi::SerialTaskQueue::SerialWorkItem::m_item
| private

Pointer to the WorkItem to run.

Definition at line 78 of file SerialTaskQueue.h.

SerialTaskQueue* Gaudi::SerialTaskQueue::SerialWorkItem::m_serializer
| private

Pointer to the SerialTaskQueue used for the synchronization.

Definition at line 80 of file SerialTaskQueue.h.

The documentation for this class was generated from the following file:

- GaudiKernel/GaudiKernel/SerialTaskQueue.h