13#ifndef ATHCONTAINERS_AUXELEMENTBASE_H
14#define ATHCONTAINERS_AUXELEMENTBASE_H
20#include "AthLinks/DataLink.h"
37#ifndef XAOD_DEPRECATE_AUXDATA
38# if defined(XAOD_ANALYSIS)
39# define XAOD_DEPRECATE_AUXDATA 0
41# define XAOD_DEPRECATE_AUXDATA 1
44#if XAOD_DEPRECATE_AUXDATA
45# define XAOD_AUXDATA_DEPRECATED [[deprecated("auxdata/auxdecor are deprecated in non-analysis builds. Use SG::ConstAccessor/SG::Accessor/SG::Decorator instead.")]]
47# define XAOD_AUXDATA_DEPRECATED
57class AuxElementStandaloneData;
58class AuxVectorData_test;
60class AuxVectorBase_test;
123 using IAuxElement::index;
130 template <
class T,
class ALLOC = AuxAllocator_t<T> >
134 template <
class T,
class ALLOC = AuxAllocator_t<T> >
147 template <
class T,
class ALLOC = AuxAllocator_t<T> >
163 template <
class T,
class ALLOC = AuxAllocator_t<T> >
167 const std::string& clsname)
const;
178 template <
class T,
class ALLOC = AuxAllocator_t<T> >
193 template <
class T,
class ALLOC = AuxAllocator_t<T> >
197 const std::string& clsname)
const;
209 template <
class T,
class ALLOC = AuxAllocator_t<T> >
212 const std::string& clsname =
"")
const;
224 template <
class T,
class ALLOC = AuxAllocator_t<T> >
227 const std::string& clsname =
"")
const;
242 template <
class T,
class ALLOC = AuxAllocator_t<T> >
261 template <
class T,
class ALLOC = AuxAllocator_t<T> >
265 const std::string& clsname)
const;
564 using IAuxElement::index;
569 template <
class T,
class ALLOC = AuxAllocator_t<T> >
572 template <
class T,
class ALLOC = AuxAllocator_t<T> >
575 template <
class T,
class ALLOC = AuxAllocator_t<T> >
587 template <
class T,
class ALLOC = AuxAllocator_t<T> >
602 template <
class T,
class ALLOC = AuxAllocator_t<T> >
606 const std::string& clsname);
618 template <
class T,
class ALLOC = AuxAllocator_t<T> >
634 template <
class T,
class ALLOC = AuxAllocator_t<T> >
638 const std::string& clsname)
const;
649 template <
class T,
class ALLOC = AuxAllocator_t<T> >
664 template <
class T,
class ALLOC = AuxAllocator_t<T> >
668 const std::string& clsname)
const;
680 template <
class T,
class ALLOC = AuxAllocator_t<T> >
683 const std::string& clsname =
"")
const;
695 template <
class T,
class ALLOC = AuxAllocator_t<T> >
698 const std::string& clsname =
"");
710 template <
class T,
class ALLOC = AuxAllocator_t<T> >
713 const std::string& clsname =
"")
const;
728 template <
class T,
class ALLOC = AuxAllocator_t<T> >
747 template <
class T,
class ALLOC = AuxAllocator_t<T> >
751 const std::string& clsname)
const;
776 bool warnUnlocked =
false);
792 bool warnUnlocked =
false);
966 friend class SG::AuxVectorBase_test;
1039 AuxElementStandaloneData*
setStore1 (
const SG::IConstAuxStore* store);
1065 bool warnUnlocked =
false);
1068#ifdef ATHCONTAINERS_R21_COMPAT
1083 bool warnUnlocked =
false);
1123#ifdef ATHCONTAINERS_R21_COMPAT
1152#ifndef XAOD_STANDALONE
Allow customizing how aux data types are treated.
#define XAOD_AUXDATA_DEPRECATED
Handle mappings between names and auxid_t.
Manage lookup of vectors of auxiliary data.
Helper class to provide constant type-safe access to aux data.
Helper class to provide type-safe access to aux data.
Exceptions that can be thrown from AthContainers.
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Helper class to provide type-safe access to aux data.
Flag that a class may have auxiliary data associated with it.
#define ATHCONTAINERS_R21_COMPAT
Interface for non-const operations on an auxiliary store.
Interface for const operations on an auxiliary store.
Helper class to provide const generic access to aux data.
Helper class to provide type-safe access to aux data.
typename AuxDataTraits< T, ALLOC >::reference_type reference_type
Manage index tracking and synchronization of auxiliary data.
Manage lookup of vectors of auxiliary data.
Helper class to provide constant type-safe access to aux data.
typename AuxDataTraits< T, ALLOC >::const_reference_type const_reference_type
Const part of AuxElement.
SG::TypelessConstAccessor TypelessConstAccessor
Helper class to provide const generic access to aux data.
ConstAuxElement(const SG::AuxVectorData *container, size_t index)
Constructor with explicit container / index.
XAOD_AUXDATA_DEPRECATED ConstAccessor< T, ALLOC >::const_reference_type auxdata(const std::string &name, const std::string &clsname) const
Fetch an aux data variable, as a const reference.
const SG::AuxVectorData * m_container
The container of which this object is an element.
XAOD_AUXDATA_DEPRECATED bool isAvailableWritableAsDecoration(const std::string &name, const std::string &clsname="") const
Check if an aux variable is available for writing as a decoration.
ConstAuxElement()
Default constructor.
void setIndex(size_t index, const SG::AuxVectorData *container)
Set the index/container for this element.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
XAOD_AUXDATA_DEPRECATED ConstAccessor< T, ALLOC >::const_reference_type auxdata(const std::string &name) const
Fetch an aux data variable, as a const reference.
SG::Decorator< T, ALLOC > Decorator
class to provide type-safe access to aux data.
SG::ConstAccessor< T, ALLOC > ConstAccessor
Helper class to provide type-safe access to aux data.
XAOD_AUXDATA_DEPRECATED ConstAccessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name) const
Fetch an aux data variable, as a const reference.
~ConstAuxElement()
Destructor.
bool setIndexPrivate(size_t index, const SG::AuxVectorData *container)
Set the index/container for this element.
const SG::AuxVectorData * container() const
Return the container holding this element.
XAOD_AUXDATA_DEPRECATED bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if an aux variable is available for reading.
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
XAOD_AUXDATA_DEPRECATED ConstAccessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name, const std::string &clsname) const
Fetch an aux data variable, as a const reference.
ConstAuxElement(const ConstAuxElement &other)
Copy Constructor.
void releasePrivateStoreForDtor()
Out-of-line portion of destructor.
ConstAuxElement & operator=(const ConstAuxElement &other)=delete
No assignment to a const element.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name, const std::string &clsname) const
Fetch an aux decoration, as a non-const reference.
Interface for non-const operations on an auxiliary store.
Helper class to provide const generic access to aux data.
A set of aux data identifiers.
Define likely/unlikely macros for branch prediction.
AuxElementStandaloneData * setStore1(const SG::IConstAuxStore *store)
Set the store associated with this object.
void clearAux()
Clear all aux data associated with this element.
void makePrivateStore()
Create a new (empty) private store for this object.
ArenaHeapAllocator & operator=(const ArenaHeapAllocator &)=delete
void copyAux(const ConstAuxElement &other, bool warnUnlocked=false)
Copy aux data from another object.
void setIndex(size_t index, SG::AuxVectorData *container)
Set the index/container for this element.
const SG::IConstAuxStore * getConstStore() const
Return the current store, as a const interface.
void setNonConstStore(SG::IAuxStore *store)
Synonym for setStore with IAuxStore.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
void setConstStore(const SG::IConstAuxStore *store)
Synonym for setStore with IConstAuxStore.
XAOD_AUXDATA_DEPRECATED bool isAvailableWritableAsDecoration(const std::string &name, const std::string &clsname="") const
Check if an aux variable is available for writing as a decoration.
bool hasNonConstStore() const
Return true if this object has an associated non-const store.
bool setIndexPrivate(size_t index, SG::AuxVectorData *container)
Set the index/container for this element.
void makePrivateStore1(const void *other, bool warnUnlocked)
Create a new private store for this object and copy aux data.
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
IAuxElement()
Flag that a class may have auxiliary data associated with it.
XAOD_AUXDATA_DEPRECATED bool isAvailable(const std::string &name, const std::string &clsname="") const
Check if an aux variable is available for reading.
static void clearAuxHelper(AuxVectorData &container, size_t index)
Clear all aux data associated with an element.
void clearCache()
Clear the cached aux data pointers.
void releasePrivateStoreForDtor()
Out-of-line portion of destructor.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
SG::IAuxStore * getStore() const
Return the current store, as a non-const interface.
bool usingPrivateStore() const
Test to see if this object is currently using a private store.
bool usingStandaloneStore() const
Test to see if this object is currently using a standalone store.
const SG::AuxVectorData * container() const
Return the container holding this element.
bool hasStore() const
Return true if this object has an associated store.
void releasePrivateStore()
Release and free any private store associated with this object.
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::reference_type auxdata(const std::string &name)
Fetch an aux data variable, as a non-const reference.
static void copyAuxHelper(AuxVectorData &container, size_t index, const ConstAuxElement &other, bool warnUnlocked)
Copy aux data from another object.
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable(const std::string &name, const std::string &clsname="")
Check if an aux variable is available for writing.
bool trackIndices() const
Return true if index tracking is enabled for this object.
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
bool clearDecorations() const
Clear all decorations.
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name) const
Fetch an aux data variable, as a const reference.
void assign(const AuxElement &other, bool warnUnlocked=false)
Assignment.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
static constexpr bool supportsThinning
Mark that this type supports thinning operations. See AthContainers/supportsThinning....
Simplified version of the C++20 std::span.