2 * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
6 * @file AthenaKernel/SlotSpecificObj.icc
7 * @author scott snyder <snyder@bnl.gov>
9 * @brief Maintain a set of objects, one per slot.
22 * The number of slots will be found by calling @c getNSlots().
26 SlotSpecificObj<T>::SlotSpecificObj()
27 : SlotSpecificObj (getNSlots())
33 * @brief Constructor, with number of slots specified explicitly.
34 * @param nslots The number of event slots.
38 SlotSpecificObj<T>::SlotSpecificObj (size_t nslots)
45 * @brief Return pointer to the object for slot given by @c ctx.
46 * @param ctx Event context giving the desired slot.
50 T* SlotSpecificObj<T>::get (const EventContext& ctx)
52 size_t slot = ctx.slot();
53 assert (slot < m_slots.size());
54 return &m_slots[slot];
59 * @brief Return pointer to the object for the current slot.
61 * The slot number is found by retrieving the global current context.
65 T* SlotSpecificObj<T>::get()
67 return get (Gaudi::Hive::currentContext());
72 * @brief Return pointer to the object for slot given by @c ctx.
73 * @param ctx Event context giving the desired slot.
77 const T* SlotSpecificObj<T>::get (const EventContext& ctx) const
79 size_t slot = ctx.slot();
80 assert (slot < m_slots.size());
81 return &m_slots[slot];
86 * @brief Return pointer to the object for the current slot.
88 * The slot number is found by retrieving the global current context.
92 const T* SlotSpecificObj<T>::get() const
94 return get (Gaudi::Hive::currentContext());
99 * @brief Dereference the pointer.
101 * The slot number is found by retrieving the global current context.
105 T& SlotSpecificObj<T>::operator* ()
112 * @brief Dereference the pointer.
114 * The slot number is found by retrieving the global current context.
118 const T& SlotSpecificObj<T>::operator* () const
125 * @brief Dereference the pointer.
127 * The slot number is found by retrieving the global current context.
131 T* SlotSpecificObj<T>::operator-> ()
138 * @brief Dereference the pointer.
140 * The slot number is found by retrieving the global current context.
144 const T* SlotSpecificObj<T>::operator-> () const
151 * @brief Begin iterator.
155 typename SlotSpecificObj<T>::iterator SlotSpecificObj<T>::begin()
157 return m_slots.begin();
162 * @brief Const begin iterator.
166 typename SlotSpecificObj<T>::const_iterator SlotSpecificObj<T>::begin() const
168 return m_slots.begin();
173 * @brief End iterator.
177 typename SlotSpecificObj<T>::iterator SlotSpecificObj<T>::end()
179 return m_slots.end();
184 * @brief Const end iterator.
188 typename SlotSpecificObj<T>::const_iterator SlotSpecificObj<T>::end() const
190 return m_slots.end();