11#ifndef ATHENAKERNEL_INPUTFILEINCIDENTGUARD_H
12#define ATHENAKERNEL_INPUTFILEINCIDENTGUARD_H
67#include "GaudiKernel/IIncidentSvc.h"
68#include "GaudiKernel/FileIncident.h"
92 [[nodiscard(
"End incident will not fire if the guard is discarded")]]
94 std::string_view source,
95 std::string_view beginFileName,
96 std::string_view guid,
97 std::string_view endFileName = {},
98 std::string_view beginType = IncidentType::BeginInputFile,
99 std::string_view endType = IncidentType::EndInputFile) {
101 endFileName.empty() ?
"FID:" + std::string(guid)
102 : std::string(endFileName),
117 static void transition(std::optional<InputFileIncidentGuard>& guard,
118 IIncidentSvc& incSvc,
119 std::string_view source,
120 std::string_view beginFileName,
121 std::string_view guid,
122 std::string_view endFileName = {},
123 std::string_view beginType = IncidentType::BeginInputFile,
124 std::string_view endType = IncidentType::EndInputFile) {
126 guard =
begin(incSvc, source, beginFileName, guid,
127 endFileName, beginType, endType);
142 :
m_incSvc(std::exchange(other.m_incSvc,
nullptr))
143 ,
m_source(std::move(other.m_source))
144 ,
m_guid(std::move(other.m_guid))
152 if (
this != &other) {
158 m_incSvc = std::exchange(other.m_incSvc,
nullptr);
159 m_source = std::move(other.m_source);
160 m_guid = std::move(other.m_guid);
175 std::string_view source,
176 std::string_view beginFileName,
177 std::string_view guid,
178 std::string endFileName,
179 std::string_view beginType,
180 std::string_view endType)
188 FileIncident(
m_source, std::string(beginType),
189 std::string(beginFileName),
m_guid));