The Gaudi Framework
master (181af51f)
Loading...
Searching...
No Matches
Backend.cpp
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 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
#include <
Gaudi/TestSuite/Conditions/ConditionAccessorHolder.h
>
12
#include <
GaudiKernel/System.h
>
13
14
namespace
Gaudi::TestSuite::Conditions::details
{
15
ConditionsStore
&
ConditionsStore::instance
() {
16
static
ConditionsStore
store{};
17
return
store;
18
}
19
20
void
ConditionsStore::declareKey
(
const
ConditionKey
& key ) {
21
if
( std::get<1>(
m_requestedKeys
.emplace( key ) ) ) {
22
std::cout <<
"ConditionsStore: requested condition "
<< key <<
'\n'
;
23
}
24
}
25
26
const
ConditionsStore::ConditionContext
&
ConditionsStore::getConditionContext
(
const
EventContext
& ctx )
const
{
27
static
ConditionContext
current_iov = 0;
28
29
current_iov = ctx.evt() % 2;
30
return
current_iov;
31
}
32
33
const
std::any*
ConditionsStore::getConditionAny
(
const
ConditionKey
& key,
const
ConditionContext
& ctx )
const
{
34
auto
lg = std::scoped_lock{
m_storageMtx
};
35
if
(
m_storage
.find( ctx ) == end(
m_storage
) ) {
36
std::cout <<
"ConditionsStore: first access to store "
<< ctx <<
'\n'
;
37
auto
& store =
m_storage
[ctx];
38
for
(
const
auto
& key :
m_requestedKeys
) {
39
std::cout <<
"ConditionsStore: prepare condition "
<< key <<
'\n'
;
40
store.emplace( key, ctx );
41
}
42
}
else
{
43
std::cout <<
"ConditionsStore: using existing store "
<< ctx <<
'\n'
;
44
}
45
return
&
m_storage
[ctx][key];
46
}
47
}
// namespace Gaudi::TestSuite::Conditions::details
ConditionAccessorHolder.h
System.h
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:34
Gaudi::TestSuite::Conditions::details::ConditionsStore::declareKey
void declareKey(const ConditionKey &key)
Definition
Backend.cpp:20
Gaudi::TestSuite::Conditions::details::ConditionsStore::ConditionKey
std::string ConditionKey
Definition
ConditionAccessorHolder.h:27
Gaudi::TestSuite::Conditions::details::ConditionsStore::m_storageMtx
std::mutex m_storageMtx
Definition
ConditionAccessorHolder.h:47
Gaudi::TestSuite::Conditions::details::ConditionsStore::getConditionContext
const ConditionContext & getConditionContext(const EventContext &ctx) const
Definition
Backend.cpp:26
Gaudi::TestSuite::Conditions::details::ConditionsStore::instance
static ConditionsStore & instance()
Definition
Backend.cpp:15
Gaudi::TestSuite::Conditions::details::ConditionsStore::m_requestedKeys
std::set< ConditionKey > m_requestedKeys
Definition
ConditionAccessorHolder.h:49
Gaudi::TestSuite::Conditions::details::ConditionsStore::ConditionContext
int ConditionContext
Definition
ConditionAccessorHolder.h:26
Gaudi::TestSuite::Conditions::details::ConditionsStore::ConditionsStore
ConditionsStore()=default
Gaudi::TestSuite::Conditions::details::ConditionsStore::getConditionAny
const std::any * getConditionAny(const ConditionKey &key, const ConditionContext &ctx) const
Definition
Backend.cpp:33
Gaudi::TestSuite::Conditions::details::ConditionsStore::m_storage
IOVSlots m_storage
Definition
ConditionAccessorHolder.h:48
Gaudi::TestSuite::Conditions::details
Definition
ConditionAccessorHolder.h:22
GaudiTestSuite
src
ConditionAccessor
Backend.cpp
Generated on Wed Oct 8 2025 09:53:38 for The Gaudi Framework by
1.13.1