ATLAS Offline Software
AuxStoreConstMem.cxx
Go to the documentation of this file.
1 // This file's extension implies that it's C, but it's really -*- C++ -*-.
2 /*
3  * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration.
4  */
14 
15 
16 namespace SG {
17 
18 
24  : m_size (size)
25 {
26 }
27 
28 
40 void AuxStoreConstMem::addBuffer (SG::auxid_t auxid, const void* buf)
41 {
42  if (m_buffers.size() <= auxid)
43  m_buffers.resize (auxid+1);
44  m_buffers[auxid] = buf;
45  m_auxids.insert (auxid);
46 }
47 
48 
59 const void* AuxStoreConstMem::getData (SG::auxid_t auxid) const
60 {
61  if (auxid < m_buffers.size()) {
62  return m_buffers[auxid];
63  }
64  return nullptr;
65 }
66 
67 
78 void* AuxStoreConstMem::getDecoration (auxid_t /*auxid*/, size_t /*size*/, size_t /*capacity*/)
79 {
80  return nullptr;
81 }
82 
83 
92 {
93  return m_auxids;
94 }
95 
96 
104 {
105  return false;
106 }
107 
108 
117 {
118 }
119 
120 
127 {
128  return false;
129 }
130 
131 
138 {
139  return m_size;
140 }
141 
142 
150 {
151 }
152 
153 
154 } // namespace SG
SG::AuxStoreConstMem::getDecoration
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
Definition: AuxStoreConstMem.cxx:78
SG::AuxStoreConstMem::m_size
size_t m_size
Definition: AuxStoreConstMem.h:142
AuxStoreConstMem.h
IConstAuxStore implementation referencing external buffers.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::AuxStoreConstMem::lock
virtual void lock() override
Lock the container.
Definition: AuxStoreConstMem.cxx:116
SG::AuxStoreConstMem::getAuxIDs
virtual const SG::auxid_set_t & getAuxIDs() const override
Return a set of identifiers for existing data items in this store.
Definition: AuxStoreConstMem.cxx:91
SG::AuxStoreConstMem::size
virtual size_t size() const override
Return the number of elements in the store.
Definition: AuxStoreConstMem.cxx:137
SG::AuxStoreConstMem::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a particular variable is tagged as a decoration.
Definition: AuxStoreConstMem.cxx:103
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::AuxStoreConstMem::clearDecorations
virtual bool clearDecorations() override
Clear all decorations.
Definition: AuxStoreConstMem.cxx:126
SG::AuxStoreConstMem::addBuffer
void addBuffer(SG::auxid_t auxid, const void *buf)
Add a new, external buffer.
Definition: AuxStoreConstMem.cxx:40
CxxUtils::ConcurrentBitset::insert
ConcurrentBitset & insert(bit_t bit, bit_t new_nbits=0)
Set a bit to 1.
SG::AuxStoreConstMem::getData
virtual const void * getData(SG::auxid_t auxid) const override
Return the data vector for one aux data item.
Definition: AuxStoreConstMem.cxx:59
SG::AuxStoreConstMem::m_auxids
SG::auxid_set_t m_auxids
Set of auxid's for which we've added a buffer.
Definition: AuxStoreConstMem.h:146
SG::AuxStoreConstMem::m_buffers
std::vector< const void * > m_buffers
Definition: AuxStoreConstMem.h:143
SG::AuxStoreConstMem::AuxStoreConstMem
AuxStoreConstMem(size_t size)
Constructor.
Definition: AuxStoreConstMem.cxx:23
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
SG::AuxStoreConstMem::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: AuxStoreConstMem.cxx:149