ATLAS Offline Software
ActsElementVector.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-2022 CERN for the benefit of the ATLAS collaboration.
4  */
13 #ifndef ACTSGEOMETRY_ACTSELEMENTVECTOR_H
14 #define ACTSGEOMETRY_ACTSELEMENTVECTOR_H
15 
16 
19 #include <mutex>
20 
21 
30 {
31 public:
32  // The only thing we can do is add another element to the list.
33  // Declared const so that the thread-safety checker won't complain ---
34  // we lock the vector internally.
35  void push_back (std::shared_ptr<const ActsDetectorElement> p) const
36  {
37  std::scoped_lock lock (m_mutex);
38  m_vec.push_back (p);
39  }
40 
41 
42 private:
43  mutable std::vector<std::shared_ptr<const ActsDetectorElement>> m_vec ATLAS_THREAD_SAFE;
45 };
46 
47 
48 #endif // not ACTSGEOMETRY_ACTSELEMENTVECTOR_H
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
ActsElementVector::m_mutex
std::mutex m_mutex
Definition: ActsElementVector.h:44
ActsDetectorElement.h
ActsElementVector::ATLAS_THREAD_SAFE
std::vector< std::shared_ptr< const ActsDetectorElement > > m_vec ATLAS_THREAD_SAFE
Definition: ActsElementVector.h:43
ActsElementVector
Helper to hold elements for deletion.
Definition: ActsElementVector.h:30
ActsElementVector::push_back
void push_back(std::shared_ptr< const ActsDetectorElement > p) const
Definition: ActsElementVector.h:35
checker_macros.h
Define macros for attributes used to control the static checker.