ATLAS Offline Software
Decorator.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_DECORATOR_H
18 #define ATHCONTAINERS_DECORATOR_H
19 
20 
26 #include <string>
27 #include <typeinfo>
28 
29 
30 namespace SG {
31 
32 
57 template <class T, class ALLOC = AuxAllocator_t<T> >
58 class Decorator
59 {
60 public:
63 
66 
72 
76 
77 
84  Decorator (const std::string& name);
85 
86 
94  Decorator (const std::string& name, const std::string& clsname);
95 
96 
104 
105 
114  template <class ELT>
115  ATH_REQUIRES( IsConstAuxElement<ELT> )
116  reference_type operator() (const ELT& e) const;
117 
118 
133  operator() (const AuxVectorData& container, size_t index) const;
134 
135 
141  template <class ELT>
142  ATH_REQUIRES( IsConstAuxElement<ELT> )
143  void set (const ELT& e, const element_type& x) const;
144 
145 
151 
152 
162 
163 
168  const_span
170 
171 
180  span
182 
183 
188  template <class ELT>
189  ATH_REQUIRES( IsConstAuxElement<ELT> )
190  bool isAvailable (const ELT& e) const;
191 
192 
197  template <class ELT>
198  ATH_REQUIRES( IsConstAuxElement<ELT> )
200 
201 
207 
208 
214 
215 
220 
221 
222 protected:
231  Decorator (const std::string& name,
232  const std::string& clsname,
234 
235 
245 
246 
247 private:
250 };
251 
252 
253 } // namespace SG
254 
255 
256 #include "AthContainers/Decorator.icc"
257 
258 
259 #endif // not ATHCONTAINERS_DECORATOR_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::Decorator< std::pair< float, std::string > >::const_container_pointer_type
typename AuxDataTraits< std::pair< float, std::string >, AuxAllocator_t< std::pair< float, std::string > > >::const_container_pointer_type const_container_pointer_type
Definition: Decorator.h:71
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
SG::Decorator::getDataSpan
const_span getDataSpan(const AuxVectorData &container) const
Get a span over the auxilary data array.
IAuxElement.h
Flag that a class may have auxiliary data associated with it.
SG::Decorator::Decorator
Decorator(const SG::auxid_t auxid)
Constructor taking an auxid directly.
index
Definition: index.py:1
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
SG::Decorator::Decorator
Decorator(const std::string &name, const std::string &clsname)
Constructor.
taskman.template
dictionary template
Definition: taskman.py:317
SG::Decorator< std::pair< float, std::string > >::span
typename AuxDataTraits< std::pair< float, std::string >, AuxAllocator_t< std::pair< float, std::string > > >::span span
A span over elements in the container.
Definition: Decorator.h:74
SG::Decorator::getDecorationArray
container_pointer_type getDecorationArray(const AuxVectorData &container) const
Get a pointer to the start of the auxiliary data array.
ATH_REQUIRES
#define ATH_REQUIRES(...)
Definition: concepts.h:110
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
SG::Decorator::auxid
SG::auxid_t auxid() const
Return the aux id for this variable.
x
#define x
SG::Decorator::getDataArray
const_container_pointer_type getDataArray(const AuxVectorData &container) const
Get a pointer to the start of the auxiliary data array.
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
SG::Decorator::set
void set(const ELT &e, const element_type &x) const
Set the variable for one element.
CxxUtils::span
Simplified version of the C++20 std::span.
Definition: span.h:67
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
SG::Decorator
Helper class to provide type-safe access to aux data.
Definition: Decorator.h:59
SG::AuxVarFlags
AuxVarFlags
Additional flags to qualify an auxiliary variable.
Definition: AuxTypes.h:58
SG::Decorator< std::pair< float, std::string > >::container_pointer_type
typename AuxDataTraits< std::pair< float, std::string >, AuxAllocator_t< std::pair< float, std::string > > >::container_pointer_type container_pointer_type
Pointer into the container holding this item.
Definition: Decorator.h:69
AuxVectorData.h
Manage lookup of vectors of auxiliary data.
SG::Decorator< std::pair< float, std::string > >::reference_type
typename AuxDataTraits< std::pair< float, std::string >, AuxAllocator_t< std::pair< float, std::string > > >::reference_type reference_type
Type referencing an item.
Definition: Decorator.h:62
SG::AuxDataTraits::element_type
T element_type
The type the user sees.
Definition: AuxDataTraits.h:43
private
#define private
Definition: DetDescrConditionsDict_dict_fixes.cxx:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
SG::Decorator::m_auxid
SG::auxid_t m_auxid
The cached auxid.
Definition: Decorator.h:249
AuxTypes.h
Basic definitions for auxiliary types.
SG::Decorator::Decorator
Decorator(const std::string &name)
Constructor.
SG::Decorator::getDecorationSpan
span getDecorationSpan(const AuxVectorData &container) const
Get a span over the auxilary data array.
SG::Decorator< std::pair< float, std::string > >::const_span
typename AuxDataTraits< std::pair< float, std::string >, AuxAllocator_t< std::pair< float, std::string > > >::const_span const_span
Definition: Decorator.h:75
SG::Decorator::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
AuxTypeRegistry.h
Handle mappings between names and auxid_t.
SG::AuxVectorData
Manage lookup of vectors of auxiliary data.
Definition: AuxVectorData.h:168
SG::Decorator::isAvailableWritable
bool isAvailableWritable(const ELT &e) const
Test to see if this variable exists in the store and is writable.
python.compressB64.c
def c
Definition: compressB64.py:93
SG::Decorator< std::pair< float, std::string > >::element_type
typename AuxDataTraits< std::pair< float, std::string >, AuxAllocator_t< std::pair< float, std::string > > >::element_type element_type
Type the user sees.
Definition: Decorator.h:65