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 SG::IAuxTypeVector* getVector (SG::auxid_t auxid) const override final;
106 
108  virtual const auxid_set_t& getAuxIDs() const override;
109 
111  virtual const auxid_set_t& getDecorIDs() const override;
112 
114  virtual bool isDecoration (auxid_t auxid) const override;
115 
117  virtual void* getDecoration (auxid_t auxid, size_t size, size_t capacity) override;
119  virtual void lock() override;
121  virtual bool clearDecorations() override;
123  virtual size_t size() const override;
125  virtual void lockDecoration (SG::auxid_t auxid) override;
127 
130 
132  virtual void* getData( auxid_t auxid, size_t size,
133  size_t capacity ) override;
134 
136  virtual const auxid_set_t& getWritableAuxIDs() const override;
137 
139  virtual bool resize( size_t size ) override;
141  virtual void reserve( size_t size ) override;
143  virtual void shift( size_t pos, ptrdiff_t offs ) override;
145  virtual bool insertMove (size_t pos,
146  IAuxStore& other,
147  const SG::auxid_set_t& ignore) override;
148 
150 
153 
155  virtual const void* getIOData( auxid_t auxid ) const override;
156 
158  virtual const std::type_info* getIOType( auxid_t auxid ) const override;
159 
161  virtual const auxid_set_t& getDynamicAuxIDs() const override;
162 
164  virtual auxid_set_t getSelectedAuxIDs() const override;
165 
167 
170 
172  const char* name() const;
174  void setName( const char* name );
175 
177 
178  private:
179  void remakeAuxIDs() const;
180 
183 
191  bool m_locked;
192 
199 
201  typedef AthContainers_detail::recursive_mutex mutex_t;
202  typedef AthContainers_detail::lock_guard<mutex_t> guard_t;
203  mutable mutex_t m_mutex;
204 
205  // Mutable is thread-safe since we lock access, and the object
206  // is a ConcurrentBitset.
207  mutable auxid_set_t m_auxids ATLAS_THREAD_SAFE;
208  mutable auxid_set_t m_decorids ATLAS_THREAD_SAFE;
209  mutable bool m_auxidsValid ATLAS_THREAD_SAFE;
210 
212  std::string m_name;
213 
214  }; // class ShallowAuxContainer
215 
216 } // namespace xAOD
217 
218 // Declare a class ID for the class:
219 #include "xAODCore/CLASS_DEF.h"
220 CLASS_DEF( xAOD::ShallowAuxContainer, 1111823638, 1 )
221 
222 // Describe the inheritance of the class:
223 #include "xAODCore/BaseInfo.h"
226 
227 #endif // XAODCORE_SHALLOWAUXCONTAINER_H
store
StoreGateSvc * store
Definition: fbtTestBasics.cxx:71
xAOD::ShallowAuxContainer::ATLAS_THREAD_SAFE
auxid_set_t m_auxids ATLAS_THREAD_SAFE
Definition: ShallowAuxContainer.h:207
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:344
xAOD::ShallowAuxContainer::ATLAS_THREAD_SAFE
auxid_set_t m_decorids ATLAS_THREAD_SAFE
Definition: ShallowAuxContainer.h:208
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:536
L1CaloPhase1Monitoring.standalone
standalone
Definition: L1CaloPhase1Monitoring.py:112
xAOD::ShallowAuxContainer::getDynamicAuxIDs
virtual const auxid_set_t & getDynamicAuxIDs() const override
Get the types(names) of variables created dynamically.
Definition: ShallowAuxContainer.cxx:563
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:493
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::getVector
virtual const SG::IAuxTypeVector * getVector(SG::auxid_t auxid) const override final
Return vector interface for one aux data item.
Definition: ShallowAuxContainer.cxx:196
xAOD::ShallowAuxContainer::reserve
virtual void reserve(size_t size) override
Reserve a given size for the arrays.
Definition: ShallowAuxContainer.cxx:479
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:202
xAOD::other
@ other
Definition: TrackingPrimitives.h:509
athena.value
value
Definition: athena.py:124
xAOD::ShallowAuxContainer::name
const char * name() const
Get the name of the container instance.
Definition: ShallowAuxContainer.cxx:595
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:353
xAOD::ShallowAuxContainer::m_selection
AuxSelection m_selection
Dynamic attributes selection implementation.
Definition: ShallowAuxContainer.h:182
xAOD::ShallowAuxContainer::m_shallowIO
bool m_shallowIO
Flag for whether to do "shallow IO" or not.
Definition: ShallowAuxContainer.h:198
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:360
xAOD::ShallowAuxContainer::m_ownsStore
bool m_ownsStore
Flag deciding if the object owns the dynamic store or not.
Definition: ShallowAuxContainer.h:189
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:258
DiTauMassTools::ignore
void ignore(T &&)
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:58
xAOD::ShallowAuxContainer::m_name
std::string m_name
Name of the container in memory. Set externally.
Definition: ShallowAuxContainer.h:212
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:194
xAOD::ShallowAuxContainer::m_mutex
mutex_t m_mutex
Definition: ShallowAuxContainer.h:203
xAOD::ShallowAuxContainer::getDecorIDs
virtual const auxid_set_t & getDecorIDs() const override
Get the types(names) of decorations handled by this container.
Definition: ShallowAuxContainer.cxx:237
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:187
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:510
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:486
xAOD::ShallowAuxContainer::getWritableAuxIDs
virtual const auxid_set_t & getWritableAuxIDs() const override
Return a set of writable data identifiers.
Definition: ShallowAuxContainer.cxx:462
xAOD::ShallowAuxContainer::getAuxIDs
virtual const auxid_set_t & getAuxIDs() const override
Get the types(names) of variables handled by this container.
Definition: ShallowAuxContainer.cxx:227
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:246
xAOD::ShallowAuxContainer::m_parentIO
const SG::IAuxStoreIO * m_parentIO
Optional pointer to the IO interface of the parent object.
Definition: ShallowAuxContainer.h:196
xAOD::ShallowAuxContainer::m_locked
bool m_locked
Flag keeping track of whether this object is locked or not.
Definition: ShallowAuxContainer.h:191
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:209
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:600
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
SG::IAuxTypeVector
Abstract interface for manipulating vectors of arbitrary types.
Definition: IAuxTypeVector.h:42
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:185
xAOD::ShallowAuxContainer::mutex_t
AthContainers_detail::recursive_mutex mutex_t
Mutex for multithread synchronization.
Definition: ShallowAuxContainer.h:201
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:578
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:469
xAOD::ShallowAuxContainer::remakeAuxIDs
void remakeAuxIDs() const
Definition: ShallowAuxContainer.cxx:606
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:374