ATLAS Offline Software
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$
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 
25 namespace SG {
26 
27 
31 size_t getNSlots();
32 
33 
39 void setNSlotsHiveMgrName ATLAS_NOT_THREAD_SAFE (const std::string& s);
40 
41 
68 template <class T>
70 {
71 public:
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 
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 
183 private:
185  std::vector<T> m_slots;
186 };
187 
188 
189 } // namespace SG
190 
191 
193 
194 
195 #endif // not ATHENAKERNEL_SLOTSPECIFICOBJ_H
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
SG::SlotSpecificObj::get
const T * get() const
Return pointer to the object for the current slot.
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::SlotSpecificObj::get
T * get(const EventContext &ctx)
Return pointer to the object for slot given by ctx.
SG::SlotSpecificObj::SlotSpecificObj
SlotSpecificObj(size_t nslots)
Constructor, with number of slots specified explicitly.
SG::SlotSpecificObj::m_slots
std::vector< T > m_slots
Set of per-slot objects.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:185
SG::SlotSpecificObj::end
iterator end()
End iterator.
SG::SlotSpecificObj::end
const_iterator end() const
Const end iterator.
SG::SlotSpecificObj::get
T * get()
Return pointer to the object for the current slot.
SlotSpecificObj.icc
SG::SlotSpecificObj::operator->
T * operator->()
Dereference the pointer.
SG::SlotSpecificObj::begin
iterator begin()
Begin iterator.
SG::SlotSpecificObj
Maintain a set of objects, one per slot.
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:70
SG::SlotSpecificObj::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:155
SG::ATLAS_NOT_THREAD_SAFE
void setNSlotsHiveMgrName ATLAS_NOT_THREAD_SAFE(const std::string &s)
Allow setting the name of the whiteboard service.
Definition: SlotSpecificObj.cxx:35
SG::SlotSpecificObj::value_type
std::vector< T >::value_type value_type
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:156
SG::getNSlots
size_t getNSlots()
Return the number of event slots.
Definition: SlotSpecificObj.cxx:64
SG::SlotSpecificObj::iterator
std::vector< T >::iterator iterator
Definition: AthenaKernel/AthenaKernel/SlotSpecificObj.h:154
SG::SlotSpecificObj::begin
const_iterator begin() const
Const begin iterator.
SG::SlotSpecificObj::SlotSpecificObj
SlotSpecificObj()
Constructor.
checker_macros.h
Define macros for attributes used to control the static checker.
SG::SlotSpecificObj::get
const T * get(const EventContext &ctx) const
Return pointer to the object for slot given by ctx.
SG::SlotSpecificObj::operator*
T & operator*()
Dereference the pointer.