ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Tracking
Acts
ActsGeometry
ActsGeometry
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
*/
11
12
13
#ifndef ACTSGEOMETRY_ACTSELEMENTVECTOR_H
14
#define ACTSGEOMETRY_ACTSELEMENTVECTOR_H
15
16
17
#include "
ActsGeometry/ActsDetectorElement.h
"
18
#include "
CxxUtils/checker_macros.h
"
19
#include <mutex>
20
21
29
class
ActsElementVector
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
// Allow access if we have a mutable reference
42
std::vector<std::shared_ptr<const ActsDetectorElement>>&
vector
() {
43
return
m_vec;
44
}
45
46
private
:
47
mutable
std::vector<std::shared_ptr<const ActsDetectorElement>> m_vec
ATLAS_THREAD_SAFE
;
48
mutable
std::mutex
m_mutex
;
49
};
50
51
52
#endif
// not ACTSGEOMETRY_ACTSELEMENTVECTOR_H
ActsDetectorElement.h
lock
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
checker_macros.h
Define macros for attributes used to control the static checker.
ActsElementVector
Helper to hold elements for deletion.
Definition
ActsElementVector.h:30
ActsElementVector::vector
std::vector< std::shared_ptr< const ActsDetectorElement > > & vector()
Definition
ActsElementVector.h:42
ActsElementVector::ATLAS_THREAD_SAFE
std::vector< std::shared_ptr< const ActsDetectorElement > > m_vec ATLAS_THREAD_SAFE
Definition
ActsElementVector.h:47
ActsElementVector::m_mutex
std::mutex m_mutex
Definition
ActsElementVector.h:48
ActsElementVector::push_back
void push_back(std::shared_ptr< const ActsDetectorElement > p) const
Definition
ActsElementVector.h:35
Generated on
for ATLAS Offline Software by
1.17.0