The Gaudi Framework
master (bdbe7744)
Toggle main menu visibility
Loading...
Searching...
No Matches
ThreadInitTask.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2026 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#pragma once
12
13
#include <
GaudiKernel/ISvcLocator.h
>
14
#include <
GaudiKernel/IThreadInitTool.h
>
15
#include <
GaudiKernel/SmartIF.h
>
16
#include <
GaudiKernel/ToolHandle.h
>
17
18
#include <boost/thread.hpp>
19
#include <vector>
20
27
28
class
ThreadInitTask
{
29
30
public
:
31
ThreadInitTask
(
ToolHandleArray<IThreadInitTool>
& tools, boost::barrier* b,
ISvcLocator
* svcLocator,
32
bool
terminate =
false
)
33
:
m_barrier
( b ),
m_serviceLocator
( svcLocator ),
m_terminate
( terminate ) {
34
m_tools
.reserve( tools.
size
() );
35
for (
auto
& tool : tools ) {
m_tools
.push_back( tool.get() ); }
36
}
37
42
void
operator()
()
const
;
43
44
static
bool
execFailed
() {
return
m_execFailed
; }
45
46
private
:
47
std::vector<IThreadInitTool*>
m_tools
;
48
49
boost::barrier*
m_barrier
=
nullptr
;
50
SmartIF<ISvcLocator>
m_serviceLocator
;
51
bool
m_terminate
=
false
;
52
53
static
std::atomic<bool>
m_execFailed
;
54
};
ISvcLocator.h
IThreadInitTool.h
SmartIF.h
ToolHandle.h
GaudiHandleArray::size
size_type size() const
Definition
GaudiHandle.h:485
ISvcLocator
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition
ISvcLocator.h:42
SmartIF
Small smart pointer class with automatic reference counting for IInterface.
Definition
SmartIF.h:28
ThreadInitTask::execFailed
static bool execFailed()
Definition
ThreadInitTask.h:44
ThreadInitTask::m_barrier
boost::barrier * m_barrier
Definition
ThreadInitTask.h:49
ThreadInitTask::m_serviceLocator
SmartIF< ISvcLocator > m_serviceLocator
Definition
ThreadInitTask.h:50
ThreadInitTask::m_tools
std::vector< IThreadInitTool * > m_tools
Definition
ThreadInitTask.h:47
ThreadInitTask::ThreadInitTask
ThreadInitTask(ToolHandleArray< IThreadInitTool > &tools, boost::barrier *b, ISvcLocator *svcLocator, bool terminate=false)
Definition
ThreadInitTask.h:31
ThreadInitTask::m_execFailed
static std::atomic< bool > m_execFailed
Definition
ThreadInitTask.h:53
ThreadInitTask::m_terminate
bool m_terminate
Definition
ThreadInitTask.h:51
ThreadInitTask::operator()
void operator()() const
Execute the task.
Definition
ThreadInitTask.cpp:28
ToolHandleArray
Array of Handles to be used in lieu of vector of naked pointers to tools.
Definition
ToolHandle.h:396
GaudiHive
src
ThreadInitTask.h
Generated on
for The Gaudi Framework by
1.17.0