ATLAS Offline Software
Loading...
Searching...
No Matches
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
9#include "GaudiKernel/StatusCode.h"
10#include <memory>
11#include <vector>
12
13namespace EventContainers{
15/*
16The intention of the IdentifiableContainer is to provide a key-value map
17for collection pointers. To increase memory and cpu efficiency the online trigger
18system different ''views'' can share collection that are created concurrently.
19To efficiently support these different uses while not imposing overhead on the
20offline case and to maintain a consistent interface the internals of the class are
21virtualised.
22
23A standard iterator is provided for fast iteration in a sequential order.
24*/
25template<typename T>
26struct hashPair{
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
36public:
38 typedef std::vector < hashPair >::const_iterator InternalConstItr;
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;
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
virtual size_t fullSize() const noexcept=0
virtual void * removeCollection(IdentifierHash hashId)=0
virtual ~I_InternalIDC()=default
virtual void cleanUp(deleter_f *) noexcept=0
virtual void wait() const =0
virtual bool tryAddFromCache(IdentifierHash hashId)=0
virtual bool insert(IdentifierHash hashId, const void *ptr)=0
std::vector< hashPair >::const_iterator InternalConstItr
virtual InternalConstItr cbegin() const =0
virtual size_t numberOfCollections() const =0
virtual bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock)=0
virtual void destructor(deleter_f *) noexcept=0
virtual std::vector< IdentifierHash > getAllCurrentHashes() const =0
virtual StatusCode fetchOrCreate(IdentifierHash hashId)=0
virtual const std::vector< hashPair > & getAllHashPtrPair() const =0
virtual InternalConstItr indexFind(IdentifierHash hashId) const =0
virtual StatusCode addLock(IdentifierHash hashId, const void *ptr)=0
EventContainers::hashPair< void > hashPair
void deleter_f(const void *p)
virtual InternalConstItr cend() const =0
virtual const void * findIndexPtr(IdentifierHash hashId) const noexcept=0
This is a "hash" representation of an Identifier.
unsigned int value_type
STL namespace.
bool operator<(const hashPair &b) const noexcept
constexpr hashPair(IdentifierHash::value_type f, const T *s)
IdentifierHash::value_type first