ATLAS Offline Software
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 */
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 
26 namespace SG {
27 
28 
29 class ConstAuxElement;
30 class AuxElement;
31 
32 
51 {
52 public:
58 
59 
64  IAuxElement(size_t index);
65 
66 
70  size_t index() const;
71 
72 
73 protected:
77  bool noPrivateData() const;
78 
79 
83  bool havePrivateData() const;
84 
85 
90  bool hadPrivateData() const;
91 
92 
93 
94 private:
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 
132  {
133  NO_PRIVATE = 0,
134  HAVE_PRIVATE = 1,
135  HAD_PRIVATE = 2,
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
SG
Forward declaration.
Definition: CaloCellPacker_400_500.h:32
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
index
Definition: index.py:1
SG::AuxElement
Base class for elements of a container that can have aux data.
Definition: AuxElement.h:446
SG::IAuxElement::IAuxElement
IAuxElement(size_t index)
Constructor.
SG::IAuxElement::noPrivateData
bool noPrivateData() const
True if this element has no private data.
SG::IAuxElement::PrivateStoreState::HAVE_PRIVATE
@ HAVE_PRIVATE
SG::IAuxElement::setNoPrivateData
void setNoPrivateData()
Record that this element does not have private data.
SG::IAuxElement
Flag that a class may have auxiliary data associated with it.
Definition: IAuxElement.h:51
SG::IAuxElement::index
size_t index() const
Return the index of this element within its container.
SG::IAuxElement::setHadPrivateData
void setHadPrivateData()
Record that this element used to have private data.
SG::IAuxElement::PrivateStoreState::HAD_PRIVATE
@ HAD_PRIVATE
IAuxElement.icc
SG::IAuxElement::havePrivateData
bool havePrivateData() const
True if this element currently has private data.
SG::IAuxElement::m_privateStoreState
PrivateStoreState m_privateStoreState
Definition: IAuxElement.h:137
SG::ConstAuxElement
Const part of AuxElement.
Definition: AuxElement.h:53
SG::IAuxElement::setHavePrivateData
void setHavePrivateData()
Record that this element currently has private data.
SG::IAuxElement::IAuxElement
IAuxElement()
Default constructor.
SG::IAuxElement::setIndex
void setIndex(size_t index)
Set the index of this element within its container.
SG::IAuxElement::m_index
size_t m_index
The index of this element within its container.
Definition: IAuxElement.h:128
SG::IAuxElement::PrivateStoreState
PrivateStoreState
The current private data state.
Definition: IAuxElement.h:132
SG::IAuxElement::PrivateStoreState::NO_PRIVATE
@ NO_PRIVATE
SG::IAuxElement::hadPrivateData
bool hadPrivateData() const
True if this element had private data before it was added to its current container.