ATLAS Offline Software
Loading...
Searching...
No Matches
IAuxElement.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*/
11
12
13#ifndef ATHCONTAINERSINTERFACES_IAUXELEMENT_H
14#define ATHCONTAINERSINTERFACES_IAUXELEMENT_H
15
16
17#include <cstdlib>
18#include <cstdint>
19#include <cassert>
20
21
22// If set, we need to write data that's forward-compatible with r21.
23#define ATHCONTAINERS_R21_COMPAT
24
25
26namespace SG {
27
28
29class ConstAuxElement;
30class AuxElement;
31
32
50class IAuxElement
51{
52public:
58
59
65
66
70 size_t index() const;
71
72
73protected:
77 bool noPrivateData() const;
78
79
83 bool havePrivateData() const;
84
85
90 bool hadPrivateData() const;
91
92
93
94private:
95 // These functions are for the use of SG::*AuxElement, but should not
96 // be accessible to any further derived classes. So make them private
97 // with friendship rather than protected.
98 friend class SG::ConstAuxElement;
99 friend class SG::AuxElement;
100
101
105 void setIndex (size_t index);
106
107
112
113
118
119
124
125
128 size_t m_index;
129
131 enum class PrivateStoreState : uint8_t
132 {
136 };
138
139 // We have 7 bytes of padding here. It's tempting to pack the two
140 // fields above into 64 bits, but that's observed to spoil opimizations.
141};
142
143
144} // namespace SG
145
146
148
149
150#endif // not ATHCONTAINERSINTERFACES_IAUXELEMENT_H
Const part of AuxElement.
Definition AuxElement.h:71
Forward declaration.
void setHavePrivateData()
Record that this element currently has private data.
void setIndex(size_t index, SG::AuxVectorData *container)
Set the index/container for this element.
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.
IAuxElement()
Flag that a class may have auxiliary data associated with it.
void setHadPrivateData()
Record that this element used to have private data.
PrivateStoreState m_privateStoreState
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.
void setNoPrivateData()
Record that this element does not have private data.
PrivateStoreState
The current private data state.
size_t m_index
The index of this element within its container. Should be 0 if this object is not within a container.
bool noPrivateData() const
True if this element has no private data.
Definition index.py:1