ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CondContainer::CondContFactory Class Reference

#include <CondContFactory.h>

Collaboration diagram for CondContainer::CondContFactory:

Public Member Functions

void regMaker (const CLID &clid, ICondContMaker *maker)
 
SG::DataObjectSharedPtr< DataObject > Create (Athena::IRCUSvc &rcusvc, const CLID &clid, const std::string &key) const
 

Static Public Member Functions

static CondContFactoryInstance ()
 

Private Member Functions

 CondContFactory ()
 
 CondContFactory (const CondContFactory &)
 
CondContFactoryoperator= (const CondContFactory &)
 

Private Attributes

std::map< CLID, ICondContMaker * > m_makers
 
std::mutex m_mapMutex
 

Detailed Description

Definition at line 20 of file CondContFactory.h.

Constructor & Destructor Documentation

◆ CondContFactory() [1/2]

CondContainer::CondContFactory::CondContFactory ( )
inlineprivate

Definition at line 27 of file CondContFactory.h.

27 {}

◆ CondContFactory() [2/2]

CondContainer::CondContFactory::CondContFactory ( const CondContFactory )
private

Member Function Documentation

◆ Create()

SG::DataObjectSharedPtr< DataObject > CondContFactory::Create ( Athena::IRCUSvc rcusvc,
const CLID clid,
const std::string &  key 
) const

Definition at line 28 of file CondContFactory.cxx.

28  {
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 }

◆ Instance()

CondContFactory & CondContFactory::Instance ( )
static

Definition at line 14 of file CondContFactory.cxx.

14  {
15  static CondContFactory factory ATLAS_THREAD_SAFE;
16  return factory;
17 }

◆ operator=()

CondContFactory& CondContainer::CondContFactory::operator= ( const CondContFactory )
private

◆ regMaker()

void CondContFactory::regMaker ( const CLID clid,
ICondContMaker maker 
)

Definition at line 19 of file CondContFactory.cxx.

19  {
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 }

Member Data Documentation

◆ m_makers

std::map<CLID, ICondContMaker*> CondContainer::CondContFactory::m_makers
private

Definition at line 32 of file CondContFactory.h.

◆ m_mapMutex

std::mutex CondContainer::CondContFactory::m_mapMutex
mutableprivate

Definition at line 33 of file CondContFactory.h.


The documentation for this class was generated from the following files:
CondContainer::CondContFactory
Definition: CondContFactory.h:20
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
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