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\***********************************************************************************/
12#include <GaudiKernel/System.h>
13
16 static ConditionsStore store{};
17 return store;
18 }
19
21 if ( std::get<1>( m_requestedKeys.emplace( key ) ) ) {
22 std::cout << "ConditionsStore: requested condition " << key << '\n';
23 }
24 }
25
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
This class represents an entry point to all the event specific data.
const ConditionContext & getConditionContext(const EventContext &ctx) const
Definition Backend.cpp:26
const std::any * getConditionAny(const ConditionKey &key, const ConditionContext &ctx) const
Definition Backend.cpp:33