33 virtual size_t size_v()
const override {
return 1; }
64class AuxElementStandaloneData
110 IAuxElement::setIndex (0);
111 IAuxElement::setHavePrivateData();
125 IAuxElement::setIndex (
index);
126 IAuxElement::setHadPrivateData();
135 "from a container.");
138 IAuxElement::setIndex (
index);
175 return m_container->getConstStore()->getDecorIDs();
192void AuxElement::makePrivateStore()
199 IAuxElement::setIndex (0);
200 IAuxElement::setHavePrivateData();
210void AuxElement::releasePrivateStore()
215 IAuxElement::setNoPrivateData();
226 IAuxElement::setIndex (0);
227 IAuxElement::setNoPrivateData();
241void AuxElement::setStore (
const SG::IConstAuxStore* store)
245 data->setStore (store);
257void AuxElement::setStore (SG::IAuxStore* store)
261 data->setStore (store);
269void AuxElement::setStore (
const DataLink< SG::IConstAuxStore >& store)
273 data->setStore (store);
280bool AuxElement::usingPrivateStore()
const
290bool AuxElement::usingStandaloneStore()
const
293 typeid(*m_container) ==
typeid(AuxElementStandaloneData);
304const SG::IConstAuxStore* AuxElement::getConstStore()
const
307 return m_container->getConstStore();
319SG::IAuxStore* AuxElement::getStore()
const
322#ifdef ATHCONTAINERS_R21_COMPAT
327 return container_nc->getStore();
339void AuxElement::clearCache()
355const SG::auxid_set_t& AuxElement::getAuxIDs()
const
357#ifdef ATHCONTAINERS_R21_COMPAT
359 return m_container->getConstStore()->getAuxIDs();
362 static const SG::auxid_set_t null_set;
378const SG::auxid_set_t& AuxElement::getDecorIDs()
const
380#ifdef ATHCONTAINERS_R21_COMPAT
382 return m_container->getConstStore()->getDecorIDs();
385 static const SG::auxid_set_t null_set;
398bool AuxElement::hasNonConstStore()
const
401 return m_container->hasNonConstStore();
415bool AuxElement::clearDecorations()
const
418 return m_container->clearDecorations();
428void AuxElement::releasePrivateStoreForDtor()
430#ifdef ATHCONTAINERS_R21_COMPAT
447AuxElementStandaloneData*
448AuxElement::setStore1 (
const SG::IConstAuxStore* store)
454 AuxElementStandaloneData*
data =
new AuxElementStandaloneData;
455 IAuxElement::setHavePrivateData();
461 return static_cast<AuxElementStandaloneData*
> (
container());
465 "object in a container or with a private store.");
471 IAuxElement::setNoPrivateData();
475 else if (m_container != 0)
477 "object in a container or with a private store.");
494#ifdef ATHCONTAINERS_R21_COMPAT
505 IAuxElement::setIndex (0);
506 IAuxElement::setHavePrivateData();
507 m_container = privateData;
512 typeid(*m_container) ==
typeid(AuxElementPrivateData))
520 IAuxElement::setIndex (
index);
521 IAuxElement::setHadPrivateData();
529 throw SG::ExcBadPrivateStore (
"Attempt to add/remove a standalone object "
530 "from a container.");
533 IAuxElement::setIndex (
index);
557 this->
copyAux (*other, warnUnlocked);
567void AuxElement::clearAux()
569 if (!m_container)
return;
590 if (!m_container)
return;
595#ifdef ATHCONTAINERS_R21_COMPAT
609void AuxElement::copyAux (
const AuxElement& other,
612 if (!m_container)
return;
657 [[maybe_unused]]
bool warnUnlocked)
670#ifndef XAOD_STANDALONE
675 size_t oindex = other.index();
679#ifndef XAOD_STANDALONE
680 if (other_decors.test (
auxid)) {
682 other_ids.reset (
auxid);
685 if (warnUnlocked &&
r.getName(
auxid) !=
"mcEventWeights") {
686 std::ostringstream
ss;
687 ss <<
"skipped unlocked decoration " <<
r.getName(
auxid)
688 <<
" (" <<
auxid <<
")";
694 if (!
r.isLinked (
auxid)) {
700 if (!other_ids.test (
auxid)) {
707#ifdef ATHCONTAINERS_R21_COMPAT
722void AuxElement::copyAuxHelper (AuxVectorData&
container,
725 [[maybe_unused]]
bool warnUnlocked)
738#ifndef XAOD_STANDALONE
739 const SG::auxid_set_t& other_decors = ocont->
getDecorIDs();
741 SG::auxid_set_t other_ids = ocont->
getAuxIDs();
743 size_t oindex =
other.index();
747#ifndef XAOD_STANDALONE
748 if (other_decors.test (
auxid)) {
750 other_ids.reset (
auxid);
753 if (warnUnlocked &&
r.getName(
auxid) !=
"mcEventWeights") {
754 std::ostringstream
ss;
755 ss <<
"skipped unlocked decoration " <<
r.getName(
auxid)
756 <<
" (" <<
auxid <<
")";
762 if (!
r.isLinked (
auxid)) {
768 if (!other_ids.test (
auxid)) {
Base class for elements of a container that can have aux data.
Auxiliary data store for standalone objects.
Exceptions that can be thrown from AthContainers.
char data[hepevt_bytes_allocation_ATLAS]
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
virtual size_t size_v() const override
Return the size of the container.
virtual size_t capacity_v() const override
Return the capacity of the container.
Internal data container for private store.
AuxStoreStandalone m_store
Auxiliary data store for standalone objects.
Handle mappings between names and auxid_t.
static AuxTypeRegistry & instance()
Return the singleton registry instance.
Manage lookup of vectors of auxiliary data.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items in store associated with this object.
void setStore(SG::IAuxStore *store)
Set the store associated with this object.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
bool hasNonConstStore() const
Return true if this object has an associated non-const store.
void clearCache()
Clear the cached aux data pointers.
AuxVectorData()
Constructor.
const SG::auxid_set_t & getWritableAuxIDs() const
Return a set of identifiers for writable data items in this store.
bool hasStore() const
Return true if this object has an associated store.
Const part of AuxElement.
const SG::AuxVectorData * m_container
The container of which this object is an element.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
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.
void releasePrivateStoreForDtor()
Out-of-line portion of destructor.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.
Exception — Bad use of private store.
Exception — Non-const operation performed on const aux data.
A set of aux data identifiers.
Helper for emitting error messages.
#define ATHCONTAINERS_WARNING(ctx, msg)
AuxElementStandaloneData * setStore1(const SG::IConstAuxStore *store)
Set the store associated with this object.
void makePrivateStore()
Create a new (empty) private store for this object.
void copyAux(const ConstAuxElement &other, bool warnUnlocked=false)
Copy aux data from another object.
static const auxid_t null_auxid
To signal no aux data item.
AuxElement(SG::AuxVectorData *container, size_t index)
Base class for elements of a container that can have aux data.
bool havePrivateData() const
True if this element currently has private data.
SG::auxid_t auxid() const
Return the aux id for this variable.
static void clearAuxHelper(AuxVectorData &container, size_t index)
Clear all aux data associated with an element.
bool usingStandaloneStore() const
Test to see if this object is currently using a standalone store.
bool hadPrivateData() const
True if this element had private data before it was added to its current container.
size_t index() const
Return the index of this element within its container.
const SG::AuxVectorData * container() const
Return the container holding this element.
static void copyAuxHelper(AuxVectorData &container, size_t index, const ConstAuxElement &other, bool warnUnlocked)
Copy aux data from another object.
void setStore(const SG::IConstAuxStore *store)
Set the store associated with this object.
size_t auxid_t
Identifier for a particular aux data item.