ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaKernel
src
CondContFactory.cxx
Go to the documentation of this file.
1
/*
2
* Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
3
*/
4
5
6
#include "
AthenaKernel/CondContFactory.h
"
7
#include "
AthenaKernel/CondCont.h
"
8
#include "
CxxUtils/checker_macros.h
"
9
#include <sstream>
10
#include <stdexcept>
11
12
using namespace
CondContainer
;
13
14
CondContFactory
&
CondContFactory::Instance
() {
15
static
CondContFactory
factory
ATLAS_THREAD_SAFE
;
16
return
factory;
17
}
18
19
void
CondContFactory::regMaker
(
const
CLID
& key,
ICondContMaker
* maker) {
20
std::lock_guard<std::mutex> guard(
m_mapMutex
);
21
if
(
m_makers
.find(key) !=
m_makers
.end()) {
22
// std::cerr << "multiple makers for CLID " << key << std::endl;
23
}
else
{
24
m_makers
[key] = maker;
25
}
26
}
27
28
SG::DataObjectSharedPtr<DataObject>
CondContFactory::Create
(
Athena::IRCUSvc
& rcusvc,
const
CLID
& clid,
const
std::string& key )
const
{
29
std::lock_guard<std::mutex> guard(
m_mapMutex
);
30
auto
i =
m_makers
.find(clid);
31
if
( i ==
m_makers
.end()) {
32
return
SG::DataObjectSharedPtr<DataObject>
();
33
}
34
ICondContMaker
* maker = i->second;
35
return
maker->
Create
(rcusvc, clid,key);
36
}
CondContFactory.h
CondCont.h
Hold mappings of ranges to condition objects.
CLID
uint32_t CLID
The Class ID type.
Definition
Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
checker_macros.h
Define macros for attributes used to control the static checker.
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition
checker_macros.h:211
Athena::IRCUSvc
Interface for RCU service.
Definition
IRCUSvc.h:40
CondContainer::CondContFactory::Create
SG::DataObjectSharedPtr< DataObject > Create(Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const
Definition
CondContFactory.cxx:28
CondContainer::CondContFactory::regMaker
void regMaker(const CLID &clid, ICondContMaker *maker)
Definition
CondContFactory.cxx:19
CondContainer::CondContFactory::CondContFactory
CondContFactory()
Definition
CondContFactory.h:27
CondContainer::CondContFactory::Instance
static CondContFactory & Instance()
Definition
CondContFactory.cxx:14
CondContainer::CondContFactory::m_mapMutex
std::mutex m_mapMutex
Definition
CondContFactory.h:33
CondContainer::CondContFactory::m_makers
std::map< CLID, ICondContMaker * > m_makers
Definition
CondContFactory.h:32
CondContainer::ICondContMaker
Definition
ICondContMaker.h:22
CondContainer::ICondContMaker::Create
virtual SG::DataObjectSharedPtr< DataObject > Create(Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const =0
CondContainer
Definition
CondContFactory.h:19
SG::DataObjectSharedPtr
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr
Definition
DataObjectSharedPtr.h:27
Generated on
for ATLAS Offline Software by
1.17.0