ATLAS Offline Software
ShallowAuxContainer.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: ShallowAuxContainer.h 793737 2017-01-24 20:11:10Z ssnyder $
8 #ifndef XAODCORE_SHALLOWAUXCONTAINER_H
9 #define XAODCORE_SHALLOWAUXCONTAINER_H
10 
11 // EDM include(s):
12 #include "AthLinks/DataLink.h"
17 #ifndef XAOD_STANDALONE
18 # include "AthenaKernel/ILockable.h"
19 #endif // not XAOD_STANDALONE
21 
22 // Local include(s):
23 #include "xAODCore/AuxSelection.h"
24 
25 namespace xAOD {
26 
49  public SG::IAuxStoreIO,
50  public SG::IAuxStoreHolder
51 #ifndef XAOD_STANDALONE
52  , public ILockable
53 #endif // not XAOD_STANDALONE
54  {
55 
56  public:
61 
63  ShallowAuxContainer( bool standalone = false );
68  bool standalone = false );
71 
74 
78  void setParent( const DataLink< SG::IConstAuxStore >& link );
79 
81  bool shallowIO() const;
83  void setShallowIO( bool value );
84 
87 
89  virtual SG::IAuxStore* getStore() override;
90  virtual const SG::IAuxStore* getStore() const override;
92  virtual void setStore( SG::IAuxStore* store ) override;
94  virtual AuxStoreType getStoreType() const override { return AST_ContainerStore; }
95 
97 
100 
102  virtual const void* getData( auxid_t auxid ) const override;
103 
105  virtual const auxid_set_t& getAuxIDs() const override;
106 
108  virtual bool isDecoration (auxid_t auxid) const override;
109 
111  virtual void* getDecoration (auxid_t auxid, size_t size, size_t capacity) override;
113  virtual void lock() override;
115  virtual bool clearDecorations() override;
117  virtual size_t size() const override;
119  virtual void lockDecoration (SG::auxid_t auxid) override;
121 
124 
126  virtual void* getData( auxid_t auxid, size_t size,
127  size_t capacity ) override;
128 
130  virtual const auxid_set_t& getWritableAuxIDs() const override;
131 
133  virtual bool resize( size_t size ) override;
135  virtual void reserve( size_t size ) override;
137  virtual void shift( size_t pos, ptrdiff_t offs ) override;
139  virtual bool insertMove (size_t pos,
140  IAuxStore& other,
141  const SG::auxid_set_t& ignore) override;
142 
144 
147 
149  virtual const void* getIOData( auxid_t auxid ) const override;
150 
152  virtual const std::type_info* getIOType( auxid_t auxid ) const override;
153 
155  virtual const auxid_set_t& getDynamicAuxIDs() const override;
156 
158  virtual auxid_set_t getSelectedAuxIDs() const override;
159 
161 
164 
166  const char* name() const;
168  void setName( const char* name );
169 
171 
172  private:
173  void remakeAuxIDs() const;
174 
177 
185  bool m_locked;
186 
193 
195  typedef AthContainers_detail::recursive_mutex mutex_t;
196  typedef AthContainers_detail::lock_guard<mutex_t> guard_t;
197  mutable mutex_t m_mutex;
198 
199  // Mutable is thread-safe since we lock access, and the object
200  // is a ConcurrentBitset.
201  mutable auxid_set_t m_auxids ATLAS_THREAD_SAFE;
202  mutable bool m_auxidsValid ATLAS_THREAD_SAFE;
203 
205  std::string m_name;
206 
207  }; // class ShallowAuxContainer
208 
209 } // namespace xAOD
210 
211 // Declare a class ID for the class:
212 #include "xAODCore/CLASS_DEF.h"
213 CLASS_DEF( xAOD::ShallowAuxContainer, 1111823638, 1 )
214 
215 // Describe the inheritance of the class:
216 #include "xAODCore/BaseInfo.h"
219 
220 #endif // XAODCORE_SHALLOWAUXCONTAINER_H
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:69
xAOD::ShallowAuxContainer::ATLAS_THREAD_SAFE
auxid_set_t m_auxids ATLAS_THREAD_SAFE
Definition: ShallowAuxContainer.h:201
xAOD::ShallowAuxContainer::operator=
ShallowAuxContainer & operator=(const ShallowAuxContainer &rhs)
Assignment operator.
Definition: ShallowAuxContainer.cxx:85
IAuxStoreHolder.h
xAOD::ShallowAuxContainer::lock
virtual void lock() override
Lock the container.
Definition: ShallowAuxContainer.cxx:325
xAOD::ShallowAuxContainer::getIOType
virtual const std::type_info * getIOType(auxid_t auxid) const override
Return the type of the data to be stored for one aux data item.
Definition: ShallowAuxContainer.cxx:516
xAOD::ShallowAuxContainer::getDynamicAuxIDs
virtual const auxid_set_t & getDynamicAuxIDs() const override
Get the types(names) of variables created dynamically.
Definition: ShallowAuxContainer.cxx:543
xAOD::ShallowAuxContainer::insertMove
virtual bool insertMove(size_t pos, IAuxStore &other, const SG::auxid_set_t &ignore) override
Insert contents of another store via move.
Definition: ShallowAuxContainer.cxx:473
xAOD::ShallowAuxContainer::parent
const DataLink< SG::IConstAuxStore > & parent() const
Get the parent store.
Definition: ShallowAuxContainer.cxx:117
xAOD::ShallowAuxContainer::ShallowAuxContainer
ShallowAuxContainer(bool standalone=false)
Default constructor.
Definition: ShallowAuxContainer.cxx:31
xAOD::ShallowAuxContainer::reserve
virtual void reserve(size_t size) override
Reserve a given size for the arrays.
Definition: ShallowAuxContainer.cxx:459
ILockable.h
Interface to allow an object to lock itself when made const in SG.
xAOD::ShallowAuxContainer
Class creating a shallow copy of an existing auxiliary container.
Definition: ShallowAuxContainer.h:54
xAOD::ShallowAuxContainer::guard_t
AthContainers_detail::lock_guard< mutex_t > guard_t
Definition: ShallowAuxContainer.h:196
xAOD::other
@ other
Definition: TrackingPrimitives.h:509
athena.value
value
Definition: athena.py:122
xAOD::ShallowAuxContainer::name
const char * name() const
Get the name of the container instance.
Definition: ShallowAuxContainer.cxx:575
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::ShallowAuxContainer::lockDecoration
virtual void lockDecoration(SG::auxid_t auxid) override
Lock a decoration.
Definition: ShallowAuxContainer.cxx:334
xAOD::ShallowAuxContainer::m_selection
AuxSelection m_selection
Dynamic attributes selection implementation.
Definition: ShallowAuxContainer.h:176
xAOD::ShallowAuxContainer::m_shallowIO
bool m_shallowIO
Flag for whether to do "shallow IO" or not.
Definition: ShallowAuxContainer.h:192
xAOD::ShallowAuxContainer::setParent
void setParent(const DataLink< SG::IConstAuxStore > &link)
Set the parent store.
Definition: ShallowAuxContainer.cxx:123
xAOD::ShallowAuxContainer::size
virtual size_t size() const override
Get the size of the container.
Definition: ShallowAuxContainer.cxx:340
xAOD::ShallowAuxContainer::m_ownsStore
bool m_ownsStore
Flag deciding if the object owns the dynamic store or not.
Definition: ShallowAuxContainer.h:183
SG::IAuxStoreIO
Interface providing I/O for a generic auxiliary store.
Definition: IAuxStoreIO.h:44
xAOD::ShallowAuxContainer::setShallowIO
void setShallowIO(bool value)
Set whether only the overriden parameters should be written out.
Definition: ShallowAuxContainer.cxx:137
SG::IAuxStoreHolder::AuxStoreType
AuxStoreType
Type of the auxiliary store.
Definition: IAuxStoreHolder.h:66
xAOD::ShallowAuxContainer::getDecoration
virtual void * getDecoration(auxid_t auxid, size_t size, size_t capacity) override
Return the data vector for one aux data decoration item.
Definition: ShallowAuxContainer.cxx:239
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:54
xAOD::ShallowAuxContainer::m_name
std::string m_name
Name of the container in memory. Set externally.
Definition: ShallowAuxContainer.h:205
SG::auxid_t
size_t auxid_t
Identifier for a particular aux data item.
Definition: AuxTypes.h:27
xAOD::ShallowAuxContainer::m_parentLink
DataLink< SG::IConstAuxStore > m_parentLink
Link to the parent object.
Definition: ShallowAuxContainer.h:188
xAOD::ShallowAuxContainer::m_mutex
mutex_t m_mutex
Definition: ShallowAuxContainer.h:197
IAuxStoreIO.h
Interface providing I/O for a generic auxiliary store.
xAOD::ShallowAuxContainer::m_storeIO
SG::IAuxStoreIO * m_storeIO
The IO interface to the internal auxiliary store.
Definition: ShallowAuxContainer.h:181
xAOD::ShallowAuxContainer::getStore
virtual SG::IAuxStore * getStore() override
Get the currently used internal store object.
Definition: ShallowAuxContainer.cxx:149
xAOD::ShallowAuxContainer::shallowIO
bool shallowIO() const
Check whether only the overriden parameters will be written out or not.
Definition: ShallowAuxContainer.cxx:132
xAOD::ShallowAuxContainer::getIOData
virtual const void * getIOData(auxid_t auxid) const override
Get a pointer to the data being stored for one aux data item.
Definition: ShallowAuxContainer.cxx:490
xAOD::ShallowAuxContainer::getStoreType
virtual AuxStoreType getStoreType() const override
Return the type of the store object.
Definition: ShallowAuxContainer.h:94
xAOD::ShallowAuxContainer::shift
virtual void shift(size_t pos, ptrdiff_t offs) override
Shift the contents of the stored arrays.
Definition: ShallowAuxContainer.cxx:466
xAOD::ShallowAuxContainer::getWritableAuxIDs
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
Definition: ShallowAuxContainer.cxx:442
xAOD::ShallowAuxContainer::getAuxIDs
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
Definition: ShallowAuxContainer.cxx:218
xAOD::AuxSelection
Class helping in dealing with dynamic branch selection.
Definition: AuxSelection.h:31
xAOD::ShallowAuxContainer::isDecoration
virtual bool isDecoration(auxid_t auxid) const override
Test if a variable is a decoration.
Definition: ShallowAuxContainer.cxx:227
xAOD::ShallowAuxContainer::m_parentIO
const SG::IAuxStoreIO * m_parentIO
Optional pointer to the IO interface of the parent object.
Definition: ShallowAuxContainer.h:190
xAOD::ShallowAuxContainer::m_locked
bool m_locked
Flag keeping track of whether this object is locked or not.
Definition: ShallowAuxContainer.h:185
SG_BASES3
SG_BASES3(xAOD::ShallowAuxContainer, SG::IAuxStore, SG::IAuxStoreIO, SG::IAuxStoreHolder)
xAOD::ShallowAuxContainer::ATLAS_THREAD_SAFE
bool m_auxidsValid ATLAS_THREAD_SAFE
Definition: ShallowAuxContainer.h:202
threading.h
Threading definitions.
CLASS_DEF.h
File providing the different SG_BASE macros.
xAOD::ShallowAuxContainer::setName
void setName(const char *name)
Set the name of the container instance.
Definition: ShallowAuxContainer.cxx:580
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
SG::IAuxStore
Interface for non-const operations on an auxiliary store.
Definition: IAuxStore.h:48
AuxSelection.h
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
IAuxStore.h
Interface for non-const operations on an auxiliary store.
ILockable
Interface to allow an object to lock itself when made const in SG.
Definition: ILockable.h:32
SG::auxid_set_t
A set of aux data identifiers.
Definition: AuxTypes.h:47
xAOD::ShallowAuxContainer::auxid_set_t
SG::auxid_set_t auxid_set_t
The aux ID set type definition.
Definition: ShallowAuxContainer.h:60
xAOD::ShallowAuxContainer::m_store
SG::IAuxStore * m_store
Internal dynamic auxiliary store object.
Definition: ShallowAuxContainer.h:179
xAOD::ShallowAuxContainer::mutex_t
AthContainers_detail::recursive_mutex mutex_t
Mutex for multithread synchronization.
Definition: ShallowAuxContainer.h:195
xAOD::ShallowAuxContainer::setStore
virtual void setStore(SG::IAuxStore *store) override
Set a different internal store object.
Definition: ShallowAuxContainer.cxx:159
xAOD::ShallowAuxContainer::auxid_t
SG::auxid_t auxid_t
The aux ID type definition.
Definition: ShallowAuxContainer.h:58
checker_macros.h
Define macros for attributes used to control the static checker.
SG::IAuxStoreHolder
Interface for objects taking part in direct ROOT I/O.
Definition: IAuxStoreHolder.h:36
xAOD::ShallowAuxContainer::getData
virtual const void * getData(auxid_t auxid) const override
Get a pointer to a given array.
Definition: ShallowAuxContainer.cxx:187
xAOD::ShallowAuxContainer::getSelectedAuxIDs
virtual auxid_set_t getSelectedAuxIDs() const override
Get the IDs of the selected dynamic Aux variables (for writing)
Definition: ShallowAuxContainer.cxx:558
xAOD::ShallowAuxContainer::~ShallowAuxContainer
~ShallowAuxContainer()
Destructor.
Definition: ShallowAuxContainer.cxx:77
xAOD::ShallowAuxContainer::resize
virtual bool resize(size_t size) override
Resize the arrays to a given size.
Definition: ShallowAuxContainer.cxx:449
xAOD::ShallowAuxContainer::remakeAuxIDs
void remakeAuxIDs() const
Definition: ShallowAuxContainer.cxx:586
SG::IAuxStoreHolder::AST_ContainerStore
@ AST_ContainerStore
The store describes a container.
Definition: IAuxStoreHolder.h:68
xAOD::ShallowAuxContainer::clearDecorations
virtual bool clearDecorations() override
Clear all decorations.
Definition: ShallowAuxContainer.cxx:354