ATLAS Offline Software
Loading...
Searching...
No Matches
InternalOffline.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_INTERNALOFFLINE_H
6#define EVENTCONTAINERS_INTERNALOFFLINE_H
8
9namespace EventContainers{
10/*
11This class implements the IdentifiableContainer code for the offline case.
12To avoid excess memory usage just the key-value pair is stored and can be directly
13iterated upon.
14
15Faster consecutive iteration, slower random access.
16Prefer iteration over FindIndexPtr and indexFind
17*/
18class InternalOffline final : public I_InternalIDC {
19public:
20 InternalOffline(size_t max);
21 virtual ~InternalOffline()=default;
22 virtual InternalConstItr cbegin() const override;
23 virtual InternalConstItr cend() const override;
24 virtual InternalConstItr indexFind( IdentifierHash hashId ) const override;
25 virtual const std::vector < hashPair >& getAllHashPtrPair() const override;
26 virtual bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock) override;
27 virtual bool tryAddFromCache(IdentifierHash hashId) override;
28 virtual void wait() const override;
29 virtual std::vector<IdentifierHash> getAllCurrentHashes() const override;
30 virtual size_t numberOfCollections() const override;
31 virtual void cleanUp(deleter_f* deleter) noexcept override;
32 virtual size_t fullSize() const noexcept override {return m_maximumSize;}
33 virtual StatusCode fetchOrCreate(IdentifierHash hashId) override;
34 virtual StatusCode fetchOrCreate(const std::vector<IdentifierHash> &hashIds) override;
35 virtual bool insert(IdentifierHash hashId, const void* ptr) override;
36 virtual const void* findIndexPtr(IdentifierHash hashId) const noexcept override;
37 virtual StatusCode addLock(IdentifierHash hashId, const void* ptr) override;
38 virtual void* removeCollection( IdentifierHash hashId ) override;
39 virtual void destructor(deleter_f*) noexcept override;
40private:
41 std::vector<I_InternalIDC::hashPair> m_map;
43};
44
45}
46#endif
#define max(a, b)
Definition cfImp.cxx:41
std::vector< hashPair >::const_iterator InternalConstItr
void deleter_f(const void *p)
virtual void destructor(deleter_f *) noexcept override
virtual bool insert(IdentifierHash hashId, const void *ptr) override
virtual InternalConstItr indexFind(IdentifierHash hashId) const override
virtual const void * findIndexPtr(IdentifierHash hashId) const noexcept override
virtual size_t fullSize() const noexcept override
virtual size_t numberOfCollections() const override
virtual bool tryAddFromCache(IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock) override
virtual StatusCode fetchOrCreate(IdentifierHash hashId) override
virtual InternalConstItr cbegin() const override
virtual void wait() const override
virtual std::vector< IdentifierHash > getAllCurrentHashes() const override
virtual void * removeCollection(IdentifierHash hashId) override
virtual StatusCode addLock(IdentifierHash hashId, const void *ptr) override
virtual ~InternalOffline()=default
virtual void cleanUp(deleter_f *deleter) noexcept override
std::vector< I_InternalIDC::hashPair > m_map
virtual const std::vector< hashPair > & getAllHashPtrPair() const override
virtual InternalConstItr cend() const override
This is a "hash" representation of an Identifier.
void deleter_f(const void *p)
Definition deleter.h:13