ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Event
EventContainers
EventContainers
I_InternalIDC.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef EVENTCONTAINERS_I_INTERNALIDC_H
6
#define EVENTCONTAINERS_I_INTERNALIDC_H
7
8
#include "
Identifier/IdentifierHash.h
"
9
#include "GaudiKernel/StatusCode.h"
10
#include <memory>
11
#include <vector>
12
13
namespace
EventContainers
{
14
class
IDC_WriteHandleBase
;
15
/*
16
The intention of the IdentifiableContainer is to provide a key-value map
17
for collection pointers. To increase memory and cpu efficiency the online trigger
18
system different ''views'' can share collection that are created concurrently.
19
To efficiently support these different uses while not imposing overhead on the
20
offline case and to maintain a consistent interface the internals of the class are
21
virtualised.
22
23
A standard iterator is provided for fast iteration in a sequential order.
24
*/
25
template
<
typename
T>
26
struct
hashPair
{
27
IdentifierHash::value_type
first
;
28
const
T*
second
;
29
constexpr
hashPair
(
IdentifierHash::value_type
f,
const
T* s) :
first
(f),
second
(s) { }
30
bool
operator <
(
const
hashPair
&b)
const
noexcept
{
31
return
first
< b.first;
32
}
33
};
34
35
class
I_InternalIDC
{
36
public
:
37
typedef
EventContainers::hashPair<void>
hashPair
;
38
typedef
std::vector < hashPair >::const_iterator
InternalConstItr
;
39
#include "
EventContainers/deleter.h
"
40
virtual
InternalConstItr
cbegin
()
const
=0;
41
virtual
InternalConstItr
cend
()
const
=0;
42
virtual
InternalConstItr
indexFind
(
IdentifierHash
hashId )
const
=0;
43
virtual
~I_InternalIDC
() =
default
;
44
virtual
void
wait
()
const
= 0;
45
virtual
bool
tryAddFromCache
(
IdentifierHash
hashId,
EventContainers::IDC_WriteHandleBase
&
lock
) = 0;
46
virtual
bool
tryAddFromCache
(
IdentifierHash
hashId) = 0;
47
virtual
std::vector<IdentifierHash>
getAllCurrentHashes
()
const
=0;
48
virtual
const
std::vector < hashPair >&
getAllHashPtrPair
()
const
= 0;
49
virtual
size_t
numberOfCollections
()
const
= 0;
50
virtual
size_t
fullSize
()
const
noexcept =0;
51
virtual StatusCode
fetchOrCreate
(
IdentifierHash
hashId) =0;
52
virtual StatusCode
fetchOrCreate
(
const
std
::
vector
<
IdentifierHash
> &hashIds) =0;
53
virtual
bool
insert
(
IdentifierHash
hashId,
const
void
* ptr) =0;
54
virtual
const
void
*
findIndexPtr
(
IdentifierHash
hashId)
const
noexcept = 0;
55
virtual StatusCode
addLock
(
IdentifierHash
hashId,
const
void
* ptr) = 0;
56
virtual
void
*
removeCollection
(
IdentifierHash
hashId ) =0;
57
virtual
void
destructor
(
deleter_f
*) noexcept =0;
58
virtual
void
cleanUp
(
deleter_f
*) noexcept =0;
59
};
60
61
}
62
#endif
lock
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
IdentifierHash.h
EventContainers::IDC_WriteHandleBase
Definition
IDC_WriteHandleBase.h:13
EventContainers::I_InternalIDC
Definition
I_InternalIDC.h:35
EventContainers::I_InternalIDC::fullSize
virtual size_t fullSize() const noexcept=0
EventContainers::I_InternalIDC::removeCollection
virtual void * removeCollection(IdentifierHash hashId)=0
EventContainers::I_InternalIDC::~I_InternalIDC
virtual ~I_InternalIDC()=default
EventContainers::I_InternalIDC::cleanUp
virtual void cleanUp(deleter_f *) noexcept=0
EventContainers::I_InternalIDC::wait
virtual void wait() const =0
EventContainers::I_InternalIDC::tryAddFromCache
virtual bool tryAddFromCache(IdentifierHash hashId)=0
EventContainers::I_InternalIDC::insert
virtual bool insert(IdentifierHash hashId, const void *ptr)=0
EventContainers::I_InternalIDC::InternalConstItr
std::vector< hashPair >::const_iterator InternalConstItr
Definition
I_InternalIDC.h:38
EventContainers::I_InternalIDC::cbegin
virtual InternalConstItr cbegin() const =0
EventContainers::I_InternalIDC::numberOfCollections
virtual size_t numberOfCollections() const =0
EventContainers::I_InternalIDC::tryAddFromCache
virtual bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock)=0
EventContainers::I_InternalIDC::destructor
virtual void destructor(deleter_f *) noexcept=0
EventContainers::I_InternalIDC::getAllCurrentHashes
virtual std::vector< IdentifierHash > getAllCurrentHashes() const =0
EventContainers::I_InternalIDC::fetchOrCreate
virtual StatusCode fetchOrCreate(IdentifierHash hashId)=0
EventContainers::I_InternalIDC::getAllHashPtrPair
virtual const std::vector< hashPair > & getAllHashPtrPair() const =0
EventContainers::I_InternalIDC::indexFind
virtual InternalConstItr indexFind(IdentifierHash hashId) const =0
EventContainers::I_InternalIDC::addLock
virtual StatusCode addLock(IdentifierHash hashId, const void *ptr)=0
EventContainers::I_InternalIDC::hashPair
EventContainers::hashPair< void > hashPair
Definition
I_InternalIDC.h:37
EventContainers::I_InternalIDC::deleter_f
void deleter_f(const void *p)
Definition
I_InternalIDC.h:14
EventContainers::I_InternalIDC::cend
virtual InternalConstItr cend() const =0
EventContainers::I_InternalIDC::findIndexPtr
virtual const void * findIndexPtr(IdentifierHash hashId) const noexcept=0
IdentifierHash
This is a "hash" representation of an Identifier.
Definition
IdentifierHash.h:25
IdentifierHash::value_type
unsigned int value_type
Definition
IdentifierHash.h:27
vector
Definition
MultiHisto.h:13
deleter.h
const
EventContainers
Definition
T_AthenaPoolCreateFuncs.h:33
std
STL namespace.
EventContainers::hashPair
Definition
I_InternalIDC.h:26
EventContainers::hashPair< void >::second
const void * second
Definition
I_InternalIDC.h:28
EventContainers::hashPair::operator<
bool operator<(const hashPair &b) const noexcept
Definition
I_InternalIDC.h:30
EventContainers::hashPair::hashPair
constexpr hashPair(IdentifierHash::value_type f, const T *s)
Definition
I_InternalIDC.h:29
EventContainers::hashPair< void >::first
IdentifierHash::value_type first
Definition
I_InternalIDC.h:27
Generated on
for ATLAS Offline Software by
1.17.0