ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
EventContainers
EventContainers
IdentifiableContainerBase.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
6
#ifndef EVENTCONTAINERS_IDENTIFIABLECONTAINERBASE_H
7
#define EVENTCONTAINERS_IDENTIFIABLECONTAINERBASE_H
8
#include "
EventContainers/I_InternalIDC.h
"
9
#include "
CxxUtils/checker_macros.h
"
10
11
12
namespace
EventContainers
{
class
IdentifiableCacheBase
;
13
enum class
Mode
{
OfflineLowMemory
,
OfflineFast
,
OfflineMap
};
14
class
IdentifiableContainerBase
{
15
public
:
16
#include "
EventContainers/deleter.h
"
17
18
typedef
std::vector<IdentifierHash>
Hash_Container
;
19
IdentifiableContainerBase
(
EventContainers::IdentifiableCacheBase
*cache);
20
IdentifiableContainerBase
(
size_t
maxsize);
21
IdentifiableContainerBase
(
size_t
maxsize,
Mode
mode);
22
~IdentifiableContainerBase
() =
default
;
23
protected
:
24
bool
m_OnlineMode
;
25
typedef
EventContainers::IdentifiableCacheBase
IdentifiableCacheBase
;
26
std::unique_ptr<I_InternalIDC>
m_link
;
27
std::vector<IdentifierHash>
GetAllCurrentHashes
()
const
{
return
m_link
->getAllCurrentHashes(); }
28
bool
insert
(
IdentifierHash
hashId,
const
void
* ptr) {
return
m_link
->insert(hashId, ptr); }
29
void
Wait
()
const
{
m_link
->wait(); }
30
bool
tryAddFromCache
(
IdentifierHash
hashId,
EventContainers::IDC_WriteHandleBase
&
lock
) {
31
return
m_link
->tryAddFromCache(hashId,
lock
); }
32
bool
tryAddFromCache
(
IdentifierHash
hashId){
return
m_link
->tryAddFromCache(hashId); }
33
void
cleanup
(
deleter_f
* deleter);
34
size_t
numberOfCollections
()
const
{
return
m_link
->numberOfCollections(); }
35
void
ResetMask
();
36
StatusCode
fetchOrCreate
(
IdentifierHash
hashId){
return
m_link
->fetchOrCreate(hashId); }
37
StatusCode
fetchOrCreate
(
const
std::vector<IdentifierHash> &hashIds) {
return
m_link
->fetchOrCreate(hashIds); }
38
const
void
*
indexFindPtr
(
IdentifierHash
hashId )
const
{
return
m_link
->findIndexPtr(hashId); }
39
};
40
41
}
42
43
44
#endif
lock
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
I_InternalIDC.h
checker_macros.h
Define macros for attributes used to control the static checker.
EventContainers::IDC_WriteHandleBase
Definition
IDC_WriteHandleBase.h:13
EventContainers::IdentifiableCacheBase
Definition
IdentifiableCacheBase.h:23
EventContainers::IdentifiableContainerBase::tryAddFromCache
bool tryAddFromCache(IdentifierHash hashId)
Definition
IdentifiableContainerBase.h:32
EventContainers::IdentifiableContainerBase::m_OnlineMode
bool m_OnlineMode
Definition
IdentifiableContainerBase.h:24
EventContainers::IdentifiableContainerBase::indexFindPtr
const void * indexFindPtr(IdentifierHash hashId) const
Definition
IdentifiableContainerBase.h:38
EventContainers::IdentifiableContainerBase::Hash_Container
std::vector< IdentifierHash > Hash_Container
Definition
IdentifiableContainerBase.h:18
EventContainers::IdentifiableContainerBase::m_link
std::unique_ptr< I_InternalIDC > m_link
Definition
IdentifiableContainerBase.h:26
EventContainers::IdentifiableContainerBase::IdentifiableContainerBase
IdentifiableContainerBase(EventContainers::IdentifiableCacheBase *cache)
Definition
IdentifiableContainerBase.cxx:15
EventContainers::IdentifiableContainerBase::IdentifiableCacheBase
EventContainers::IdentifiableCacheBase IdentifiableCacheBase
Definition
IdentifiableContainerBase.h:25
EventContainers::IdentifiableContainerBase::Wait
void Wait() const
Definition
IdentifiableContainerBase.h:29
EventContainers::IdentifiableContainerBase::fetchOrCreate
StatusCode fetchOrCreate(const std::vector< IdentifierHash > &hashIds)
Definition
IdentifiableContainerBase.h:37
EventContainers::IdentifiableContainerBase::numberOfCollections
size_t numberOfCollections() const
Definition
IdentifiableContainerBase.h:34
EventContainers::IdentifiableContainerBase::tryAddFromCache
bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock)
Definition
IdentifiableContainerBase.h:30
EventContainers::IdentifiableContainerBase::~IdentifiableContainerBase
~IdentifiableContainerBase()=default
EventContainers::IdentifiableContainerBase::insert
bool insert(IdentifierHash hashId, const void *ptr)
Definition
IdentifiableContainerBase.h:28
EventContainers::IdentifiableContainerBase::ResetMask
void ResetMask()
EventContainers::IdentifiableContainerBase::GetAllCurrentHashes
std::vector< IdentifierHash > GetAllCurrentHashes() const
Definition
IdentifiableContainerBase.h:27
EventContainers::IdentifiableContainerBase::cleanup
void cleanup(deleter_f *deleter)
Definition
IdentifiableContainerBase.cxx:38
EventContainers::IdentifiableContainerBase::fetchOrCreate
StatusCode fetchOrCreate(IdentifierHash hashId)
Definition
IdentifiableContainerBase.h:36
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
deleter.h
deleter_f
void deleter_f(const void *p)
Definition
deleter.h:13
EventContainers
Definition
T_AthenaPoolCreateFuncs.h:33
EventContainers::Mode
Mode
Definition
IdentifiableContainerBase.h:13
EventContainers::Mode::OfflineLowMemory
@ OfflineLowMemory
Definition
IdentifiableContainerBase.h:13
EventContainers::Mode::OfflineFast
@ OfflineFast
Definition
IdentifiableContainerBase.h:13
EventContainers::Mode::OfflineMap
@ OfflineMap
Definition
IdentifiableContainerBase.h:13
Generated on
for ATLAS Offline Software by
1.17.0