![]() |
ATLAS Offline Software
|
Helper class to cache a non owning or owning pointer in an atomic way. More...
#include <PointerCache.h>
Public Member Functions | |
| PointerCache ()=default | |
| ~PointerCache () | |
| void | setIfUnset (const T &obj) |
| set a pointer without handing over ownership | |
| void | setIfUnset (std::unique_ptr< T > &&ptr) |
| set a pointer andhand over ownership | |
| operator bool () const | |
| set whether a valid pointer is set | |
| const T * | operator-> () const |
| dereference the pointer | |
Private Member Functions | |
| void | setPointer (const T *ptr, bool owner) |
Private Attributes | |
| std::atomic< const T * > | m_ptr |
| std::atomic< bool > | m_owner |
Helper class to cache a non owning or owning pointer in an atomic way.
Definition at line 12 of file PointerCache.h.
|
default |
|
inline |
Definition at line 16 of file PointerCache.h.
|
inline |
set whether a valid pointer is set
Definition at line 31 of file PointerCache.h.
|
inline |
dereference the pointer
Definition at line 36 of file PointerCache.h.
|
inline |
set a pointer without handing over ownership
Definition at line 23 of file PointerCache.h.
|
inline |
set a pointer andhand over ownership
Definition at line 27 of file PointerCache.h.
|
inlineprivate |
|
private |
Definition at line 57 of file PointerCache.h.
|
private |
Definition at line 56 of file PointerCache.h.