ATLAS Offline Software
I_InternalIDC.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 #ifndef EVENTCONTAINERS_I_INTERNALIDC_H
6 #define EVENTCONTAINERS_I_INTERNALIDC_H
7 
9 #include "GaudiKernel/StatusCode.h"
10 #include <vector>
11 
12 namespace EventContainers{
13 class IDC_WriteHandleBase;
14 /*
15 The intention of the IdentifiableContainer is to provide a key-value map
16 for collection pointers. To increase memory and cpu efficiency the online trigger
17 system different ''views'' can share collection that are created concurrently.
18 To efficiently support these different uses while not imposing overhead on the
19 offline case and to maintain a consistent interface the internals of the class are
20 virtualised.
21 
22 A standard iterator is provided for fast iteration in a sequential order.
23 */
24 template<typename T>
25 struct hashPair{
27  const T* second;
28  constexpr hashPair(IdentifierHash::value_type f, const T* s) : first(f), second(s) { }
29  bool operator <(const hashPair &b) const noexcept{
30  return first < b.first;
31  }
32 };
33 
35 public:
37  typedef std::vector < hashPair >::const_iterator InternalConstItr;
38  #include "EventContainers/deleter.h"
39  virtual InternalConstItr cbegin() const=0;
40  virtual InternalConstItr cend() const=0;
41  virtual InternalConstItr indexFind( IdentifierHash hashId ) const =0;
42  virtual ~I_InternalIDC() = default;
43  virtual void wait() const = 0;
45  virtual bool tryAddFromCache(IdentifierHash hashId) = 0;
46  virtual std::vector<IdentifierHash> getAllCurrentHashes() const =0;
47  virtual const std::vector < hashPair >& getAllHashPtrPair() const = 0;
48  virtual size_t numberOfCollections() const = 0;
49  virtual size_t fullSize() const noexcept =0;
51  virtual StatusCode fetchOrCreate(const std::vector<IdentifierHash> &hashIds) =0;
52  virtual bool insert(IdentifierHash hashId, const void* ptr) =0;
53  virtual const void* findIndexPtr(IdentifierHash hashId) const noexcept = 0;
54  virtual StatusCode addLock(IdentifierHash hashId, const void* ptr) = 0;
55  virtual void* removeCollection( IdentifierHash hashId ) =0;
56  virtual void destructor(deleter_f*) noexcept =0;
57  virtual void cleanUp(deleter_f*) noexcept =0;
58 };
59 
60 }
61 #endif
EventContainers::I_InternalIDC::getAllHashPtrPair
virtual const std::vector< hashPair > & getAllHashPtrPair() const =0
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
EventContainers::I_InternalIDC::removeCollection
virtual void * removeCollection(IdentifierHash hashId)=0
EventContainers::hashPair::first
IdentifierHash::value_type first
Definition: I_InternalIDC.h:26
EventContainers::hashPair::operator<
bool operator<(const hashPair &b) const noexcept
Definition: I_InternalIDC.h:29
EventContainers::I_InternalIDC::getAllCurrentHashes
virtual std::vector< IdentifierHash > getAllCurrentHashes() const =0
IdentifierHash::value_type
unsigned int value_type
Definition: IdentifierHash.h:27
EventContainers
Definition: T_AthenaPoolCreateFuncs.h:33
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
EventContainers::hashPair
Definition: I_InternalIDC.h:25
EventContainers::I_InternalIDC
Definition: I_InternalIDC.h:34
EventContainers::I_InternalIDC::findIndexPtr
virtual const void * findIndexPtr(IdentifierHash hashId) const noexcept=0
EventContainers::I_InternalIDC::hashPair
EventContainers::hashPair< void > hashPair
Definition: I_InternalIDC.h:36
EventContainers::I_InternalIDC::fetchOrCreate
virtual StatusCode fetchOrCreate(IdentifierHash hashId)=0
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
vector
Definition: MultiHisto.h:13
deleter_f
void deleter_f(const void *p)
Definition: deleter.h:12
EventContainers::I_InternalIDC::fullSize
virtual size_t fullSize() const noexcept=0
hist_file_dump.f
f
Definition: hist_file_dump.py:141
EventContainers::I_InternalIDC::indexFind
virtual InternalConstItr indexFind(IdentifierHash hashId) const =0
EventContainers::I_InternalIDC::insert
virtual bool insert(IdentifierHash hashId, const void *ptr)=0
EventContainers::I_InternalIDC::cleanUp
virtual void cleanUp(deleter_f *) noexcept=0
EventContainers::I_InternalIDC::numberOfCollections
virtual size_t numberOfCollections() const =0
EventContainers::I_InternalIDC::destructor
virtual void destructor(deleter_f *) noexcept=0
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
IdentifierHash.h
EventContainers::I_InternalIDC::tryAddFromCache
virtual bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock)=0
EventContainers::IDC_WriteHandleBase
Definition: IDC_WriteHandleBase.h:13
EventContainers::I_InternalIDC::cend
virtual InternalConstItr cend() const =0
EventContainers::I_InternalIDC::wait
virtual void wait() const =0
deleter.h
EventContainers::I_InternalIDC::addLock
virtual StatusCode addLock(IdentifierHash hashId, const void *ptr)=0
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
EventContainers::I_InternalIDC::~I_InternalIDC
virtual ~I_InternalIDC()=default
EventContainers::hashPair::second
const T * second
Definition: I_InternalIDC.h:27
EventContainers::I_InternalIDC::InternalConstItr
std::vector< hashPair >::const_iterator InternalConstItr
Definition: I_InternalIDC.h:37
EventContainers::I_InternalIDC::cbegin
virtual InternalConstItr cbegin() const =0
EventContainers::hashPair::hashPair
constexpr hashPair(IdentifierHash::value_type f, const T *s)
Definition: I_InternalIDC.h:28
EventContainers::I_InternalIDC::tryAddFromCache
virtual bool tryAddFromCache(IdentifierHash hashId)=0