ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4RunManagement
src
G4RunToolEventQueue.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef G4RUNMANAGEMENT_G4RUNTOOLEVENTQUEUE_H
6
#define G4RUNMANAGEMENT_G4RUNTOOLEVENTQUEUE_H
7
8
#include "
G4RunManagement/AtlasG4SyncEventUserInfo.h
"
9
10
#include <condition_variable>
11
#include <cstddef>
12
#include <memory>
13
#include <mutex>
14
#include <queue>
15
#include <vector>
16
24
class
G4RunToolEventQueue
25
{
26
public
:
27
using
UPEvent
= std::unique_ptr<AtlasG4SyncEventUserInfo>;
28
29
std::size_t
Size
()
const
;
31
void
PushEvent
(
UPEvent
event);
32
UPEvent
GetEvent
();
33
35
void
Close
() noexcept;
36
39
void
CompleteOutstandingEvents
() noexcept;
40
41
private
:
42
using
WeakSyncInterface
=
43
std
::weak_ptr<
G4EventSynchronizationInterface
>;
44
45
std
::queue<
UPEvent
>
m_events
;
46
std
::
vector
<
WeakSyncInterface
>
m_outstandingEvents
;
47
bool
m_closed
{
false
};
48
mutable
std::mutex
m_mutex
;
49
std::condition_variable
m_cv
;
50
};
51
52
#endif
AtlasG4SyncEventUserInfo.h
G4EventSynchronizationInterface
Definition
AtlasG4SyncEventUserInfo.h:28
G4RunToolEventQueue
Thread-safe event handoff between Athena and the Geant4 worker threads.
Definition
G4RunToolEventQueue.h:25
G4RunToolEventQueue::m_cv
std::condition_variable m_cv
Definition
G4RunToolEventQueue.h:49
G4RunToolEventQueue::PushEvent
void PushEvent(UPEvent event)
Submit a non-null event. Throws std::invalid_argument for null events.
Definition
G4RunToolEventQueue.cxx:17
G4RunToolEventQueue::m_events
std::queue< UPEvent > m_events
Definition
G4RunToolEventQueue.h:45
G4RunToolEventQueue::WeakSyncInterface
std::weak_ptr< G4EventSynchronizationInterface > WeakSyncInterface
Definition
G4RunToolEventQueue.h:42
G4RunToolEventQueue::CompleteOutstandingEvents
void CompleteOutstandingEvents() noexcept
Release abandoned events and report run termination to their waiters.
Definition
G4RunToolEventQueue.cxx:78
G4RunToolEventQueue::Size
std::size_t Size() const
Definition
G4RunToolEventQueue.cxx:11
G4RunToolEventQueue::m_closed
bool m_closed
Definition
G4RunToolEventQueue.h:47
G4RunToolEventQueue::UPEvent
std::unique_ptr< AtlasG4SyncEventUserInfo > UPEvent
Definition
G4RunToolEventQueue.h:27
G4RunToolEventQueue::m_mutex
std::mutex m_mutex
Definition
G4RunToolEventQueue.h:48
G4RunToolEventQueue::m_outstandingEvents
std::vector< WeakSyncInterface > m_outstandingEvents
Definition
G4RunToolEventQueue.h:46
G4RunToolEventQueue::Close
void Close() noexcept
Stop accepting events and wake all Geant4 workers. Idempotent.
Definition
G4RunToolEventQueue.cxx:69
G4RunToolEventQueue::GetEvent
UPEvent GetEvent()
Definition
G4RunToolEventQueue.cxx:56
vector
Definition
MultiHisto.h:13
std
STL namespace.
private
#define private
Definition
testRead.cxx:27
Generated on
for ATLAS Offline Software by
1.17.0