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-2017 CERN for the benefit of the ATLAS collaboration.
4 */
5// $Id$
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
68template <class T>
70{
71public:
78
79
84 SlotSpecificObj (size_t nslots);
85
86
91 T* get (const EventContext& ctx);
92
93
99 T* get();
100
101
106 const T* get (const EventContext& ctx) const;
107
108
114 const T* get() const;
115
116
123
124
130 const T& operator* () const;
131
132
139
140
146 const T* operator-> () const;
147
148
149 //**********************************************************************
150 // Allow iterating over slots.
151 // Remember that any needed locking of the payload objects
152 // is the responsibility of the caller.
153
154 typedef typename std::vector<T>::iterator iterator;
155 typedef typename std::vector<T>::const_iterator const_iterator;
156 typedef typename std::vector<T>::value_type value_type;
157
158
163
164
169
170
175
176
181
182
183private:
185 std::vector<T> m_slots;
186};
187
188
189} // namespace SG
190
191
193
194
195#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
T & operator*()
Dereference the pointer.
const T * get(const EventContext &ctx) const
Return pointer to the object for slot given by ctx.
const_iterator begin() const
Const begin iterator.
const_iterator end() const
Const end iterator.
iterator end()
End iterator.
SlotSpecificObj(size_t nslots)
Constructor, with number of slots specified explicitly.
SlotSpecificObj()
Constructor.
T * get()
Return pointer to the object for the current slot.
iterator begin()
Begin iterator.
const T * get() const
Return pointer to the object for the current slot.
T * operator->()
Dereference the pointer.
T * get(const EventContext &ctx)
Return pointer to the object for slot given by ctx.
std::vector< T > m_slots
Set of per-slot objects.
std::vector< T >::const_iterator const_iterator
Forward declaration.
size_t getNSlots()
Return the number of event slots.