|
Foundation
|
Atomic, unbounded LIFO stack with lock-free push and pop operations. More...
#include <AtomicStack.hpp>
Classes | |
| struct | Node |
| struct | PTag |
Public Member Functions | |
| AtomicStack (Allocator *alloc) | |
| Construct the Stack. | |
| template<typename U > | |
| void | Push (U &&value) |
| Push a value onto the stack. | |
| bool | Pop (T &out) |
| Pop a value from the stack. | |
| ~AtomicStack () | |
Private Attributes | |
| Atomic< PTag > | mTop {} |
| Allocator * | mAlloc |
Atomic, unbounded LIFO stack with lock-free push and pop operations.
| T | Data type, must be default constructible. |
|
inline |
Construct the Stack.
| alloc | Allocator to use for element allocations. |
|
inline |
Pop a value from the stack.
| out | Reference to receive the popped value. This is only valid if the function returns true. |
|
inline |
Push a value onto the stack.
| U | Type of the value to push. May be different from T, but must be convertible to T. |
| value | The value to push. This is forwarded to T's constructor. |
|
private |