join 1.0
lightweight network framework library
Loading...
Searching...
No Matches
join::BumpAtomic Class Reference

bump sync policy using a lock-free cursor. More...

#include <bump_allocator.hpp>

Public Member Functions

 BumpAtomic () noexcept=default
 default constructor.
 
 BumpAtomic (BumpAtomic &&other) noexcept
 move constructor.
 
BumpAtomic & operator= (BumpAtomic &&other) noexcept
 move assignment operator.
 
uint64_t load () const noexcept
 load the cursor.
 
void store (uint64_t value) noexcept
 store the cursor.
 
bool advance (uint64_t &expected, uint64_t desired) noexcept
 advance the cursor.
 

Detailed Description

bump sync policy using a lock-free cursor.

Constructor & Destructor Documentation

◆ BumpAtomic() [1/2]

join::BumpAtomic::BumpAtomic ( )
defaultnoexcept

default constructor.

◆ BumpAtomic() [2/2]

join::BumpAtomic::BumpAtomic ( BumpAtomic && other)
inlinenoexcept

move constructor.

Parameters
otherother object to move.

Member Function Documentation

◆ advance()

bool join::BumpAtomic::advance ( uint64_t & expected,
uint64_t desired )
inlinenoexcept

advance the cursor.

Parameters
expectedexpected cursor value, updated on failure.
desirednew cursor value.
Returns
true if the cursor was advanced, false if another thread moved it first.

◆ load()

uint64_t join::BumpAtomic::load ( ) const
inlinenoexcept

load the cursor.

Returns
cursor value.

◆ operator=()

BumpAtomic & join::BumpAtomic::operator= ( BumpAtomic && other)
inlinenoexcept

move assignment operator.

Parameters
otherother object to move.
Returns
this.

◆ store()

void join::BumpAtomic::store ( uint64_t value)
inlinenoexcept

store the cursor.

Parameters
valuenew cursor value.

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