ATLAS Offline Software
Loading...
Searching...
No Matches
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
12using namespace CondContainer;
13
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
28SG::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}
Hold mappings of ranges to condition objects.
uint32_t CLID
The Class ID type.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
Interface for RCU service.
Definition IRCUSvc.h:40
SG::DataObjectSharedPtr< DataObject > Create(Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const
void regMaker(const CLID &clid, ICondContMaker *maker)
static CondContFactory & Instance()
std::map< CLID, ICondContMaker * > m_makers
virtual SG::DataObjectSharedPtr< DataObject > Create(Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const =0
CxxUtils::RefCountedPtr< T > DataObjectSharedPtr