ATLAS Offline Software
IdentifiableContainerBase.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
5 #include <algorithm>
12 
13 using namespace EventContainers;
14 
16  m_OnlineMode (true),
17  m_link (std::make_unique<EventContainers::InternalOnline>(cache))
18  {
19  }
20 
22  : m_OnlineMode (false),
24  {
25  }
26 
27 
29  m_OnlineMode = false;
30  if(mode == Mode::OfflineLowMemory) m_link = std::make_unique<EventContainers::InternalOffline>(max);
31  else if(mode == Mode::OfflineFast) m_link = std::make_unique<EventContainers::InternalOfflineFast>(max);
32  else if(mode == Mode::OfflineMap) m_link = std::make_unique<EventContainers::InternalOfflineMap>(max);
33  else{
34  throw std::runtime_error("Invalid Mode specified");
35  }
36  }
37 
39  if(m_OnlineMode) throw std::runtime_error("Not implemented in online mode");
40  m_link->cleanUp(deleter);
41  }
InternalOnline.h
EventContainers::InternalOnline
Definition: InternalOnline.h:26
EventContainers::IdentifiableCacheBase
Definition: IdentifiableCacheBase.h:26
InternalOfflineMap.h
EventContainers::IdentifiableContainerBase::IdentifiableContainerBase
IdentifiableContainerBase(EventContainers::IdentifiableCacheBase *cache)
Definition: IdentifiableContainerBase.cxx:15
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
EventContainers::Mode::OfflineMap
@ OfflineMap
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
InternalOfflineFast.h
EventContainers::Mode::OfflineLowMemory
@ OfflineLowMemory
InternalOffline.h
EventContainers
Definition: T_AthenaPoolCreateFuncs.h:33
AthUnlikelyMacros.h
EventContainers::IdentifiableContainerBase::m_link
std::unique_ptr< I_InternalIDC > m_link
Definition: IdentifiableContainerBase.h:26
deleter_f
void deleter_f(const void *p)
Definition: deleter.h:12
IDC_WriteHandleBase.h
Preparation.mode
mode
Definition: Preparation.py:94
EventContainers::Mode
Mode
Definition: IdentifiableContainerBase.h:13
EventContainers::Mode::OfflineFast
@ OfflineFast
EventContainers::IdentifiableContainerBase::m_OnlineMode
bool m_OnlineMode
Definition: IdentifiableContainerBase.h:24
EventContainers::InternalOffline
Definition: InternalOffline.h:18
IdentifiableContainerBase.h
EventContainers::IdentifiableContainerBase::cleanup
void cleanup(deleter_f *deleter)
Definition: IdentifiableContainerBase.cxx:38