Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Ase::AtomicStack< Value, GrowOnlyAllocator > Struct Template Reference

#include "atomics.hh"

Public Member Functions

bool empty () const
 Return true if the stack holds no items.
 
bool push (Value &&value)
 Add value to top of the stack, returns if the stack was empty (true).
 
bool push (const Value &value)
 Add a copy of value to top of the stack, returns if the stack was empty (true).
 
bool pop (Value &value)
 Pop value from top of the stack, returns if value was reassigned (true), otherwise the stack was empty.
 

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.

Definition at line 179 of file atomics.hh.

Member Function Documentation

◆ empty()

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

Return true if the stack holds no items.

Definition at line 181 of file atomics.hh.

◆ pop()

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

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

Definition at line 198 of file atomics.hh.

References std::destroy_at().

◆ push() [1/2]

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

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

Definition at line 192 of file atomics.hh.

References Ase::AtomicStack< Value, GrowOnlyAllocator >::push().

◆ push() [2/2]

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

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

Definition at line 184 of file atomics.hh.

References std::construct_at().

Referenced by Ase::AtomicStack< Value, GrowOnlyAllocator >::push().


The documentation for this struct was generated from the following file: