ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaKernel/AthenaKernel/SlotSpecificObj.h
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-2026 CERN for the benefit of the ATLAS collaboration.
4 */
5
12
13
14#ifndef ATHENAKERNEL_SLOTSPECIFICOBJ_H
15#define ATHENAKERNEL_SLOTSPECIFICOBJ_H
16
17
19#include "GaudiKernel/ThreadLocalContext.h"
20#include "GaudiKernel/EventContext.h"
21#include <vector>
22#include <string>
23
24
25namespace SG {
26
27
31size_t getNSlots();
32
33
39void setNSlotsHiveMgrName ATLAS_NOT_THREAD_SAFE (const std::string& s);
40
41
46
47
82template <class T, InvalidSlot = InvalidSlot::Disabled>
84{
85public:
92
93
98 explicit SlotSpecificObj (size_t nslots);
99
100
105 T* get (const EventContext& ctx);
106
107
113 T* get();
114
115
120 const T* get (const EventContext& ctx) const;
121
122
128 const T* get() const;
129
130
137
138
144 const T& operator* () const;
145
146
153
154
160 const T* operator-> () const;
161
162
163 //**********************************************************************
164 // Allow iterating over slots.
165 // Remember that any needed locking of the payload objects
166 // is the responsibility of the caller.
167
168 typedef typename std::vector<T>::iterator iterator;
169 typedef typename std::vector<T>::const_iterator const_iterator;
170 typedef typename std::vector<T>::value_type value_type;
171
172
177
178
183
184
189
190
195
196
197private:
199 std::vector<T> m_slots;
200};
201
202
203} // namespace SG
204
205
207
208
209#endif // not ATHENAKERNEL_SLOTSPECIFICOBJ_H
Define macros for attributes used to control the static checker.
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
const T * get(const EventContext &ctx) const
Return pointer to the object for slot given by ctx.
SlotSpecificObj()
Constructor.
const T * get() const
Return pointer to the object for the current slot.
SlotSpecificObj(size_t nslots)
Constructor, with number of slots specified explicitly.
T * operator->()
Dereference the pointer.
const_iterator begin() const
Const begin iterator.
std::vector< T >::const_iterator const_iterator
T * get(const EventContext &ctx)
Return pointer to the object for slot given by ctx.
T & operator*()
Dereference the pointer.
iterator begin()
Begin iterator.
iterator end()
End iterator.
const_iterator end() const
Const end iterator.
T * get()
Return pointer to the object for the current slot.
std::vector< T > m_slots
Set of per-slot objects.
Forward declaration.
InvalidSlot
Support of the invalid EventContext in SlotSpecificObj.
size_t getNSlots()
Return the number of event slots.