ATLAS Offline Software
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 
9 #include <sstream>
10 #include <stdexcept>
11 
12 using namespace CondContainer;
13 
15  static CondContFactory factory ATLAS_THREAD_SAFE;
16  return factory;
17 }
18 
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()) {
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.
CondContainer::CondContFactory::Instance
static CondContFactory & Instance()
Definition: CondContFactory.cxx:14
CondContainer::CondContFactory::Create
SG::DataObjectSharedPtr< DataObject > Create(Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const
Definition: CondContFactory.cxx:28
CondContainer::CondContFactory
Definition: CondContFactory.h:20
CondContainer::CondContFactory::regMaker
void regMaker(const CLID &clid, ICondContMaker *maker)
Definition: CondContFactory.cxx:19
lumiFormat.i
int i
Definition: lumiFormat.py:92
CondContainer
Definition: CondContFactory.h:19
Athena::IRCUSvc
Interface for RCU service.
Definition: IRCUSvc.h:40
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
CondContainer::ICondContMaker::Create
virtual SG::DataObjectSharedPtr< DataObject > Create(Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const =0
CondContainer::CondContFactory::m_mapMutex
std::mutex m_mapMutex
Definition: CondContFactory.h:33
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
SG::DataObjectSharedPtr
Smart pointer to manage DataObject reference counts.
Definition: DataObjectSharedPtr.h:46
checker_macros.h
Define macros for attributes used to control the static checker.
CondContainer::CondContFactory::m_makers
std::map< CLID, ICondContMaker * > m_makers
Definition: CondContFactory.h:32
CondContainer::ICondContMaker
Definition: ICondContMaker.h:22
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37