ATLAS Offline Software
Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
EventContainers::IdentifiableContainerBase Class Reference

#include <IdentifiableContainerBase.h>

Inheritance diagram for EventContainers::IdentifiableContainerBase:
Collaboration diagram for EventContainers::IdentifiableContainerBase:

Public Types

typedef std::vector< IdentifierHashHash_Container
 

Public Member Functions

 IdentifiableContainerBase (EventContainers::IdentifiableCacheBase *cache)
 
 IdentifiableContainerBase (size_t maxsize)
 
 IdentifiableContainerBase (size_t maxsize, Mode mode)
 
 ~IdentifiableContainerBase ()=default
 

Protected Types

typedef EventContainers::IdentifiableCacheBase IdentifiableCacheBase
 

Protected Member Functions

std::vector< IdentifierHashGetAllCurrentHashes () const
 
bool insert (IdentifierHash hashId, const void *ptr)
 
void Wait () const
 
bool tryAddFromCache (IdentifierHash hashId, EventContainers::IDC_WriteHandleBase &lock)
 
bool tryAddFromCache (IdentifierHash hashId)
 
void cleanup (deleter_f *deleter)
 
size_t numberOfCollections () const
 
void ResetMask ()
 
StatusCode fetchOrCreate (IdentifierHash hashId)
 
StatusCode fetchOrCreate (const std::vector< IdentifierHash > &hashIds)
 
const void * indexFindPtr (IdentifierHash hashId) const
 

Protected Attributes

bool m_OnlineMode
 
std::unique_ptr< I_InternalIDCm_link
 

Detailed Description

Definition at line 14 of file IdentifiableContainerBase.h.

Member Typedef Documentation

◆ Hash_Container

Definition at line 18 of file IdentifiableContainerBase.h.

◆ IdentifiableCacheBase

Definition at line 25 of file IdentifiableContainerBase.h.

Constructor & Destructor Documentation

◆ IdentifiableContainerBase() [1/3]

IdentifiableContainerBase::IdentifiableContainerBase ( EventContainers::IdentifiableCacheBase cache)

Definition at line 15 of file IdentifiableContainerBase.cxx.

15  :
16  m_OnlineMode (true),
17  m_link (std::make_unique<EventContainers::InternalOnline>(cache))
18  {
19  }

◆ IdentifiableContainerBase() [2/3]

IdentifiableContainerBase::IdentifiableContainerBase ( size_t  maxsize)

Definition at line 21 of file IdentifiableContainerBase.cxx.

22  : m_OnlineMode (false),
23  m_link (std::make_unique<EventContainers::InternalOffline>(max))
24  {
25  }

◆ IdentifiableContainerBase() [3/3]

IdentifiableContainerBase::IdentifiableContainerBase ( size_t  maxsize,
Mode  mode 
)

Definition at line 28 of file IdentifiableContainerBase.cxx.

28  {
29  m_OnlineMode = false;
30  if(mode == Mode::OfflineLowMemory) m_link = std::make_unique<EventContainers::InternalOffline>(max);
31  else if(mode == Mode::OfflineFast) m_link = std::make_unique<EventContainers::InternalOfflineFast>(max);
32  else if(mode == Mode::OfflineMap) m_link = std::make_unique<EventContainers::InternalOfflineMap>(max);
33  else{
34  throw std::runtime_error("Invalid Mode specified");
35  }
36  }

◆ ~IdentifiableContainerBase()

EventContainers::IdentifiableContainerBase::~IdentifiableContainerBase ( )
default

Member Function Documentation

◆ cleanup()

void IdentifiableContainerBase::cleanup ( deleter_f deleter)
protected

Definition at line 38 of file IdentifiableContainerBase.cxx.

38  {
39  if(m_OnlineMode) throw std::runtime_error("Not implemented in online mode");
40  m_link->cleanUp(deleter);
41  }

◆ fetchOrCreate() [1/2]

StatusCode EventContainers::IdentifiableContainerBase::fetchOrCreate ( const std::vector< IdentifierHash > &  hashIds)
inlineprotected

Definition at line 37 of file IdentifiableContainerBase.h.

37 { return m_link->fetchOrCreate(hashIds); }

◆ fetchOrCreate() [2/2]

StatusCode EventContainers::IdentifiableContainerBase::fetchOrCreate ( IdentifierHash  hashId)
inlineprotected

Definition at line 36 of file IdentifiableContainerBase.h.

36 { return m_link->fetchOrCreate(hashId); }

◆ GetAllCurrentHashes()

std::vector<IdentifierHash> EventContainers::IdentifiableContainerBase::GetAllCurrentHashes ( ) const
inlineprotected

Definition at line 27 of file IdentifiableContainerBase.h.

27 { return m_link->getAllCurrentHashes(); }

◆ indexFindPtr()

const void* EventContainers::IdentifiableContainerBase::indexFindPtr ( IdentifierHash  hashId) const
inlineprotected

Definition at line 38 of file IdentifiableContainerBase.h.

38 { return m_link->findIndexPtr(hashId); }

◆ insert()

bool EventContainers::IdentifiableContainerBase::insert ( IdentifierHash  hashId,
const void *  ptr 
)
inlineprotected

Definition at line 28 of file IdentifiableContainerBase.h.

28 { return m_link->insert(hashId, ptr); }

◆ numberOfCollections()

size_t EventContainers::IdentifiableContainerBase::numberOfCollections ( ) const
inlineprotected

Definition at line 34 of file IdentifiableContainerBase.h.

34 { return m_link->numberOfCollections(); }

◆ ResetMask()

void EventContainers::IdentifiableContainerBase::ResetMask ( )
protected

◆ tryAddFromCache() [1/2]

bool EventContainers::IdentifiableContainerBase::tryAddFromCache ( IdentifierHash  hashId)
inlineprotected

Definition at line 32 of file IdentifiableContainerBase.h.

32 { return m_link->tryAddFromCache(hashId); }

◆ tryAddFromCache() [2/2]

bool EventContainers::IdentifiableContainerBase::tryAddFromCache ( IdentifierHash  hashId,
EventContainers::IDC_WriteHandleBase lock 
)
inlineprotected

Definition at line 30 of file IdentifiableContainerBase.h.

30  {
31  return m_link->tryAddFromCache(hashId, lock); }

◆ Wait()

void EventContainers::IdentifiableContainerBase::Wait ( ) const
inlineprotected

Definition at line 29 of file IdentifiableContainerBase.h.

29 { m_link->wait(); }

Member Data Documentation

◆ m_link

std::unique_ptr<I_InternalIDC> EventContainers::IdentifiableContainerBase::m_link
protected

Definition at line 26 of file IdentifiableContainerBase.h.

◆ m_OnlineMode

bool EventContainers::IdentifiableContainerBase::m_OnlineMode
protected

Definition at line 24 of file IdentifiableContainerBase.h.


The documentation for this class was generated from the following files:
max
#define max(a, b)
Definition: cfImp.cxx:41
EventContainers::Mode::OfflineMap
@ OfflineMap
EventContainers::Mode::OfflineLowMemory
@ OfflineLowMemory
dbg::ptr
void * ptr(T *p)
Definition: SGImplSvc.cxx:74
EventContainers::IdentifiableContainerBase::m_link
std::unique_ptr< I_InternalIDC > m_link
Definition: IdentifiableContainerBase.h:26
Preparation.mode
mode
Definition: Preparation.py:94
EventContainers::Mode::OfflineFast
@ OfflineFast
EventContainers::IdentifiableContainerBase::m_OnlineMode
bool m_OnlineMode
Definition: IdentifiableContainerBase.h:24