Foundation
|
Atomic, unbounded LIFO stack with lock-free push and pop operations. More...
#include <Stack.hpp>
Classes | |
struct | Node |
struct | PTag |
Public Member Functions | |
Stack (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. | |
Private Attributes | |
Atomic< PTag > | mTop {} |
Allocator * | mAlloc |
Atomic, unbounded LIFO stack with lock-free push and pop operations.
T | Data type. |
|
inline |
Construct the Stack.
alloc | Allocator to use for element allocations. |
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 |