ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthAllocators
AthAllocators
LockedAllocator.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
/*
4
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5
*/
6
7
// $Id$
14
15
16
#include <mutex>
17
18
19
#ifndef ATHALLOCATORS_LOCKEDALLOCATOR_H
20
#define ATHALLOCATORS_LOCKEDALLOCATOR_H
21
22
23
namespace
SG
{
24
25
26
class
ArenaAllocatorBase
;
27
28
39
class
LockedAllocator
40
{
41
public
:
47
LockedAllocator
(
ArenaAllocatorBase
* alloc, std::mutex&
mutex
);
48
49
53
ArenaAllocatorBase
&
operator*
();
54
55
59
ArenaAllocatorBase
*
operator->
();
60
61
65
ArenaAllocatorBase
*
get
();
66
67
71
const
ArenaAllocatorBase
*
get
()
const
;
72
73
74
private
:
76
ArenaAllocatorBase
*
m_alloc
;
77
79
std::unique_lock<std::mutex>
m_lock
;
80
};
81
82
83
}
// namespace SG
84
85
86
#include "
AthAllocators/LockedAllocator.icc
"
87
88
89
#endif
// not ATHALLOCATORS_LOCKEDALLOCATOR_H
LockedAllocator.icc
SG::ArenaAllocatorBase
Common base class for arena allocator classes.
Definition
ArenaAllocatorBase.h:134
SG::LockedAllocator::m_alloc
ArenaAllocatorBase * m_alloc
The allocator to which we point.
Definition
LockedAllocator.h:76
SG::LockedAllocator::m_lock
std::unique_lock< std::mutex > m_lock
The lock for the allocator.
Definition
LockedAllocator.h:79
SG::LockedAllocator::operator*
ArenaAllocatorBase & operator*()
Dereference the pointer.
SG::LockedAllocator::get
ArenaAllocatorBase * get()
Return the underlying pointer.
SG::LockedAllocator::LockedAllocator
LockedAllocator(ArenaAllocatorBase *alloc, std::mutex &mutex)
Constructor.
SG::LockedAllocator::operator->
ArenaAllocatorBase * operator->()
Dereference the pointer.
SG::LockedAllocator::get
const ArenaAllocatorBase * get() const
Return the underlying pointer.
mutex
STL class.
SG
Forward declaration.
Definition
CaloCellPacker_400_500.h:32
Generated on
for ATLAS Offline Software by
1.17.0