Anklang C++ API 0.0.0
Loading...
Searching...
No Matches
AtomicStack< Value, GrowOnlyAllocator >

#include "atomics.hh"

Public Member Functions

boolempty () const
boolpop (Value &value)
boolpush (const Value &value)
boolpush (Value &&value)

Detailed Description

template<typename Value, template< class > class GrowOnlyAllocator = Loft::Allocator>
struct Ase::AtomicStack< Value, GrowOnlyAllocator >

Thread-safe, lock-free stack based on MpmcStack and an Allocator with `allows_read_after_free`.

Member Function Documentation

empty()

template<typename Value , template< class > class GrowOnlyAllocator = Loft::Allocator>
bool empty ( ) const

Return `true` if the stack holds no items.

push() [1/2]

template<typename Value , template< class > class GrowOnlyAllocator = Loft::Allocator>
bool push ( Value && value)

Add `value` to top of the stack, returns if the stack was empty (true).

push() [2/2]

template<typename Value , template< class > class GrowOnlyAllocator = Loft::Allocator>
bool push ( const Value & value)

Add a copy of `value` to top of the stack, returns if the stack was empty (true).

pop()

template<typename Value , template< class > class GrowOnlyAllocator = Loft::Allocator>
bool pop ( Value & value)

Pop `value` from top of the stack, returns if `value` was reassigned (true), otherwise the stack was empty.