ATLAS Offline Software
|
A pointer type that holds a lock on an allocator object. More...
#include <LockedAllocator.h>
Public Member Functions | |
LockedAllocator (ArenaAllocatorBase *alloc, std::mutex &mutex) | |
Constructor. More... | |
ArenaAllocatorBase & | operator* () |
Dereference the pointer. More... | |
ArenaAllocatorBase * | operator-> () |
Dereference the pointer. More... | |
ArenaAllocatorBase * | get () |
Return the underlying pointer. More... | |
const ArenaAllocatorBase * | get () const |
Return the underlying pointer. More... | |
Private Attributes | |
ArenaAllocatorBase * | m_alloc |
The allocator to which we point. More... | |
std::unique_lock< std::mutex > | m_lock |
The lock for the allocator. More... | |
A pointer type that holds a lock on an allocator object.
A SG::LockedAllocator
object functions as a pointer to a SG::ArenaAllocatorBase
object. It also holds a lock associated with that object; the lock is released when the SG::LockedAllocator
is destroyed.
These objects may be moved, but not copied.
Definition at line 39 of file LockedAllocator.h.
SG::LockedAllocator::LockedAllocator | ( | ArenaAllocatorBase * | alloc, |
std::mutex & | mutex | ||
) |
Constructor.
alloc | The allocator object to which we're pointing. |
mutex | The mutex to lock. |
ArenaAllocatorBase* SG::LockedAllocator::get | ( | ) |
Return the underlying pointer.
const ArenaAllocatorBase* SG::LockedAllocator::get | ( | ) | const |
Return the underlying pointer.
ArenaAllocatorBase& SG::LockedAllocator::operator* | ( | ) |
Dereference the pointer.
ArenaAllocatorBase* SG::LockedAllocator::operator-> | ( | ) |
Dereference the pointer.
|
private |
The allocator to which we point.
Definition at line 76 of file LockedAllocator.h.
|
private |
The lock for the allocator.
Definition at line 79 of file LockedAllocator.h.