| The Gaudi Framework v28r2p1 (f1a77ff4)

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

69 :
70 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:75
Gaudi::SerialTaskQueue::SerialWorkItem::m_serializer
SerialTaskQueue * m_serializer
Pointer to the SerialTaskQueue used for the synchronization.
Definition: SerialTaskQueue.h:77

## Member Function Documentation

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

Execute the WorkItem and notify the SerialTaskQueue of the completion.

Definition at line 106 of file SerialTaskQueue.h.

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

## Member Data Documentation

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

Pointer to the WorkItem to run.

Definition at line 75 of file SerialTaskQueue.h.

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

Pointer to the SerialTaskQueue used for the synchronization.

Definition at line 77 of file SerialTaskQueue.h.

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

- GaudiKernel/GaudiKernel/SerialTaskQueue.h