ATLAS Offline Software
Control/AthContainers/AthContainers/Accessor.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_ACCESSOR_H
18 #define ATHCONTAINERS_ACCESSOR_H
19 
20 
27 #include <string>
28 #include <typeinfo>
29 
30 
31 namespace SG {
32 
33 
65 template <class T, class ALLOC = AuxAllocator_t<T> >
66 class Accessor
67  : public ConstAccessor<T, ALLOC>
68 {
69 public:
72 
75 
79 
82 
86 
87 
94  Accessor (const std::string& name);
95 
96 
104  Accessor (const std::string& name, const std::string& clsname);
105 
106 
114 
115 
120  template <class ELT>
121  ATH_REQUIRES( IsAuxElement<ELT> )
122  reference_type operator() (ELT& e) const;
123 
124 
134  reference_type operator() (AuxVectorData& container, size_t index) const;
135 
136 
142  template <class ELT>
143  ATH_REQUIRES( IsAuxElement<ELT> )
144  void set (ELT& e, const element_type& x) const;
145 
146 
152 
153 
158  span
160 
161 
166  template <class ELT>
167  ATH_REQUIRES( IsAuxElement<ELT> )
169 
170 
176 };
177 
178 
179 } // namespace SG
180 
181 
182 #include "AthContainers/Accessor.icc"
183 
184 
185 #endif // not ATHCONTAINERS_ACCESSOR_H
SG::AuxDataTraits::container_pointer_type
typename vector_type::pointer container_pointer_type
Pointers to the data within the container.
Definition: AuxDataTraits.h:57
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
SG::AuxDataTraits::reference_type
element_type & reference_type
Reference types returned by aux data accessors.
Definition: AuxDataTraits.h:46
AuxElementConcepts.h
SG::Accessor::set
void set(ELT &e, const element_type &x) const
Set the variable for one element.
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
IAuxElement.h
Flag that a class may have auxiliary data associated with it.
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
index
Definition: index.py:1
SG::ConstAccessor< T, AuxAllocator_t< T > >::auxid
SG::auxid_t auxid() const
Return the aux id for this variable.
taskman.template
dictionary template
Definition: taskman.py:317
SG::Accessor::Accessor
Accessor(const std::string &name, const std::string &clsname)
Constructor.
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
x
#define x
SG::Accessor::Accessor
Accessor(const std::string &name)
Constructor.
CxxUtils::span
Simplified version of the C++20 std::span.
Definition: span.h:67
SG::Accessor::getDataSpan
span getDataSpan(AuxVectorData &container) const
Get a span over the auxilary data array.
SG::Accessor< ATYPE1 >::container_pointer_type
typename AuxDataTraits< ATYPE1, AuxAllocator_t< ATYPE1 > >::container_pointer_type container_pointer_type
Pointer into the container holding this item.
Definition: Control/AthContainers/AthContainers/Accessor.h:78
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::Accessor::Accessor
Accessor(const SG::auxid_t auxid)
Constructor taking an auxid directly.
SG::Accessor< ATYPE1 >::reference_type
typename AuxDataTraits< ATYPE1, AuxAllocator_t< ATYPE1 > >::reference_type reference_type
Type referencing an item.
Definition: Control/AthContainers/AthContainers/Accessor.h:71
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
SG::Accessor< ATYPE1 >::element_type
typename AuxDataTraits< ATYPE1, AuxAllocator_t< ATYPE1 > >::element_type element_type
Type the user sees.
Definition: Control/AthContainers/AthContainers/Accessor.h:74
SG::AuxDataTraits::element_type
T element_type
The type the user sees.
Definition: AuxDataTraits.h:43
SG::Accessor::getDataArray
container_pointer_type getDataArray(AuxVectorData &container) const
Get a pointer to the start of the auxiliary data array.
SG::Accessor< ATYPE1 >::span
typename AuxDataTraits< ATYPE1, AuxAllocator_t< ATYPE1 > >::span span
A span over elements in the container.
Definition: Control/AthContainers/AthContainers/Accessor.h:81
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
AuxTypes.h
Basic definitions for auxiliary types.
SG::Accessor::isAvailableWritable
bool isAvailableWritable(ELT &e) const
Test to see if this variable exists in the store and is writable.
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
python.compressB64.c
def c
Definition: compressB64.py:93