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;
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;
568 template <
class T,
class ALLOC = AuxAllocator_t<T> >
571 template <
class T,
class ALLOC = AuxAllocator_t<T> >
574 template <
class T,
class ALLOC = AuxAllocator_t<T> >
586 template <
class T,
class ALLOC = AuxAllocator_t<T> >
601 template <
class T,
class ALLOC = AuxAllocator_t<T> >
605 const std::string& clsname);
617 template <
class T,
class ALLOC = AuxAllocator_t<T> >
633 template <
class T,
class ALLOC = AuxAllocator_t<T> >
637 const std::string& clsname)
const;
648 template <
class T,
class ALLOC = AuxAllocator_t<T> >
663 template <
class T,
class ALLOC = AuxAllocator_t<T> >
667 const std::string& clsname)
const;
679 template <
class T,
class ALLOC = AuxAllocator_t<T> >
682 const std::string& clsname =
"")
const;
694 template <
class T,
class ALLOC = AuxAllocator_t<T> >
697 const std::string& clsname =
"");
709 template <
class T,
class ALLOC = AuxAllocator_t<T> >
712 const std::string& clsname =
"")
const;
727 template <
class T,
class ALLOC = AuxAllocator_t<T> >
746 template <
class T,
class ALLOC = AuxAllocator_t<T> >
750 const std::string& clsname)
const;
775 bool warnUnlocked =
false);
791 bool warnUnlocked =
false);
1064 bool warnUnlocked =
false);
1067#ifdef ATHCONTAINERS_R21_COMPAT
1082 bool warnUnlocked =
false);
1122#ifdef ATHCONTAINERS_R21_COMPAT
1151#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
Internal data container for standalone store.
Base class for elements of a container that can have aux data.
void releasePrivateStoreForDtor()
Out-of-line portion of destructor.
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor(const std::string &name) const
Fetch an aux decoration, as a non-const reference.
AuxElementStandaloneData * setStore1(const SG::IConstAuxStore *store)
Set the store associated with this object.
void clearCache()
Clear the cached aux data pointers.
void clearAux()
Clear all aux data associated with this element.
const SG::IConstAuxStore * getConstStore() const
Return the current store, as a const interface.
void makePrivateStore()
Create a new (empty) private store for this object.
ConstAuxElement::TypelessConstAccessor TypelessConstAccessor
AuxElement & operator=(const AuxElement &other)
Assignment.
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::reference_type auxdata(const std::string &name)
Fetch an aux data variable, as a non-const reference.
void assign(const AuxElement &other, bool warnUnlocked=false)
Assignment.
void copyAux(const ConstAuxElement &other, bool warnUnlocked=false)
Copy aux data from another object.
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.
void setConstStore(const SG::IConstAuxStore *store)
Synonym for setStore with IConstAuxStore.
SG::ConstAccessor< T, ALLOC > ConstAccessor
AuxElement(SG::AuxVectorData *container, size_t index)
Constructor with explicit container / index.
void makePrivateStore(const U1 *other, bool warnUnlocked=false)
Create a new private store for this object and copy aux data.
static constexpr bool supportsThinning
Mark that this type supports thinning operations.
friend class SG::AuxVectorBase_test
SG::Decorator< T, ALLOC > Decorator
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.
bool hasStore() const
Return true if this object has an associated store.
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdata(const std::string &name) const
Fetch an aux data variable, as a const reference.
void setNonConstStore(SG::IAuxStore *store)
Synonym for setStore with IAuxStore.
bool trackIndices() const
Return true if index tracking is enabled for this object.
bool setIndexPrivate(size_t index, SG::AuxVectorData *container)
Set the index/container for this element.
static void clearAuxHelper(AuxVectorData &container, size_t index)
Clear all aux data associated with an element.
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name, const std::string &clsname) const
Fetch an aux data variable, as a const reference.
void setIndex(size_t index, SG::AuxVectorData *container)
Set the index/container for this element.
SG::AuxVectorData * container()
Return the container holding this element.
bool usingPrivateStore() const
Test to see if this object is currently using a private store.
bool hasNonConstStore() const
Return true if this object has an associated non-const store.
bool usingStandaloneStore() const
Test to see if this object is currently using a standalone store.
void makePrivateStore(const U1 &other, bool warnUnlocked=false)
Create a new private store for this object and copy aux data.
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::reference_type auxdata(const std::string &name, const std::string &clsname)
Fetch an aux data variable, as a non-const reference.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
void releasePrivateStore()
Release and free any private store associated with this object.
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 Accessor< T, ALLOC >::const_reference_type auxdataConst(const std::string &name) const
Fetch an aux data variable, as a const reference.
friend class SG::ConstAuxElement
void makePrivateStore1(const void *other, bool warnUnlocked)
Create a new private store for this object and copy aux data.
static void copyAuxHelper(AuxVectorData &container, size_t index, const ConstAuxElement &other, bool warnUnlocked)
Copy aux data from another object.
AuxElement(const AuxElement &other)
Copy Constructor.
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.
SG::Accessor< T, ALLOC > Accessor
bool clearDecorations() const
Clear all decorations.
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdata(const std::string &name, const std::string &clsname) const
Fetch an aux data variable, as a const reference.
SG::IAuxStore * getStore() const
Return the current store, as a non-const interface.
const SG::AuxVectorData * container() const
Return the container holding this element.
AuxElement()
Default constructor.
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable(const std::string &name, const std::string &clsname="")
Check if an aux variable is available for writing.
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.
Helper class to provide type-safe access to aux data.
typename AuxDataTraits< T, ALLOC >::reference_type reference_type
Flag that a class may have auxiliary data associated with it.
size_t index() const
Return the index of this element within its container.
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.
A set of aux data identifiers.
Define likely/unlikely macros for branch prediction.
Simplified version of the C++20 std::span.