ATLAS Offline Software
ConstAccessor.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-2024 CERN for the benefit of the ATLAS collaboration.
4  */
17 #ifndef ATHCONTAINERS_CONSTACCESSOR_H
18 #define ATHCONTAINERS_CONSTACCESSOR_H
19 
20 
26 #include <string>
27 #include <typeinfo>
28 
29 
30 namespace SG {
31 
32 
53 template <class T, class ALLOC = AuxAllocator_t<T> >
55 {
56 public:
59 
63 
67 
70 
71 
78  ConstAccessor (const std::string& name);
79 
80 
88  ConstAccessor (const std::string& name, const std::string& clsname);
89 
90 
98 
99 
104  template <class ELT>
105  ATH_REQUIRES( IsConstAuxElement<ELT> )
106  const_reference_type operator() (const ELT& e) const;
107 
108 
119  operator() (const AuxVectorData& container, size_t index) const;
120 
121 
130  template <class ELT>
131  ATH_REQUIRES( IsConstAuxElement<ELT> )
133 
134 
147  withDefault (const AuxVectorData& container, size_t index, const T& deflt) const;
148 
149 
156 
157 
162  const_span
164 
165 
170  template <class ELT>
171  ATH_REQUIRES( IsConstAuxElement<ELT> )
172  bool isAvailable (const ELT& e) const;
173 
174 
180 
181 
186 
187 
188 protected:
197  ConstAccessor (const std::string& name,
198  const std::string& clsname,
200 
201 
211 
212 
215 };
216 
217 
218 } // namespace SG
219 
220 
221 #include "AthContainers/ConstAccessor.icc"
222 
223 
224 #endif // not ATHCONTAINERS_CONSTACCESSOR_H
SG::ConstAccessor< PackedLink< CONT >, ALLOC >::element_type
typename AuxDataTraits< PackedLink< CONT >, ALLOC >::element_type element_type
Type the user sees.
Definition: ConstAccessor.h:58
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
AuxElementConcepts.h
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IAuxElement.h
Flag that a class may have auxiliary data associated with it.
SG::ConstAccessor::getDataSpan
const_span getDataSpan(const AuxVectorData &container) const
Get a span over the auxilary data array.
index
Definition: index.py:1
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
SG::ConstAccessor< PackedLink< CONT >, ALLOC >::const_container_pointer_type
typename AuxDataTraits< PackedLink< CONT >, ALLOC >::const_container_pointer_type const_container_pointer_type
Pointer into the container holding this item.
Definition: ConstAccessor.h:66
SG::ConstAccessor::auxid
SG::auxid_t auxid() const
Return the aux id for this variable.
SG::AuxDataTraits::const_reference_type
const element_type & const_reference_type
Definition: AuxDataTraits.h:47
SG::ConstAccessor< PackedLink< CONT >, ALLOC >::const_span
typename AuxDataTraits< PackedLink< CONT >, ALLOC >::const_span const_span
A span over elements in the container.
Definition: ConstAccessor.h:69
taskman.template
dictionary template
Definition: taskman.py:317
SG::ConstAccessor::ConstAccessor
ConstAccessor(const std::string &name)
Constructor.
SG::ConstAccessor::ConstAccessor
ConstAccessor(const SG::auxid_t auxid)
Constructor taking an auxid directly.
ATH_REQUIRES
#define ATH_REQUIRES(...)
Definition: concepts.h:110
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition: ConstAccessor.h:55
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::AuxDataTraits::const_container_pointer_type
typename vector_type::const_pointer const_container_pointer_type
Definition: AuxDataTraits.h:58
protected
#define protected
Definition: DetDescrConditionsDict_dict_fixes.cxx:14
CxxUtils::span
Simplified version of the C++20 std::span.
Definition: span.h:67
SG::ConstAccessor< PackedLink< CONT >, ALLOC >::const_reference_type
typename AuxDataTraits< PackedLink< CONT >, ALLOC >::const_reference_type const_reference_type
Type referencing an item.
Definition: ConstAccessor.h:62
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::ConstAccessor::m_auxid
SG::auxid_t m_auxid
The cached auxid.
Definition: ConstAccessor.h:214
SG::AuxVarFlags
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition: AuxTypes.h:58
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
SG::AuxDataTraits::element_type
T element_type
The type the user sees.
Definition: AuxDataTraits.h:43
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AuxTypes.h
Basic definitions for auxiliary types.
SG::ConstAccessor::ConstAccessor
ConstAccessor(const std::string &name, const std::string &clsname)
Constructor.
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
SG::ConstAccessor::getDataArray
const_container_pointer_type getDataArray(const AuxVectorData &container) const
Get a pointer to the start of the auxiliary data array.
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
python.compressB64.c
def c
Definition: compressB64.py:93
SG::ConstAccessor::withDefault
const_reference_type withDefault(const ELT &e, const T &deflt) const
Fetch the variable for one element, as a const reference, with a default.