ATLAS Offline Software
Event
EventContainers
src
IdentifiableContainerBase.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3
*/
4
#include "
EventContainers/IdentifiableContainerBase.h
"
5
#include <algorithm>
6
#include "
EventContainers/IDC_WriteHandleBase.h
"
7
#include "
CxxUtils/AthUnlikelyMacros.h
"
8
#include "
EventContainers/InternalOnline.h
"
9
#include "
EventContainers/InternalOffline.h
"
10
#include "
EventContainers/InternalOfflineFast.h
"
11
#include "
EventContainers/InternalOfflineMap.h
"
12
13
using namespace
EventContainers
;
14
15
IdentifiableContainerBase::IdentifiableContainerBase
(
EventContainers::IdentifiableCacheBase
*cache) :
16
m_OnlineMode (true),
17
m_link (std::
make_unique
<
EventContainers
::
InternalOnline
>(cache))
18
{
19
}
20
21
IdentifiableContainerBase::IdentifiableContainerBase
(
size_t
max
)
22
: m_OnlineMode (false),
23
m_link (std::
make_unique
<
EventContainers
::
InternalOffline
>(
max
))
24
{
25
}
26
27
28
IdentifiableContainerBase::IdentifiableContainerBase
(
size_t
max
,
Mode
mode
){
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
38
void
IdentifiableContainerBase::cleanup
(
deleter_f
* deleter){
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
Generated on Sat Dec 21 2024 21:11:25 for ATLAS Offline Software by
1.8.18