Clio develop
The XRP Ledger API server.
Loading...
Searching...
No Matches
util::Atomic< NumberType > Class Template Reference

Atomic wrapper for integral and floating point types. More...

#include <Atomic.hpp>

Public Types

using ValueType = NumberType
 

Public Member Functions

 Atomic (ValueType const value)
 Construct a new Atomic object.
 
 Atomic (Atomic const &)=delete
 
 Atomic (Atomic &&)=delete
 
Atomicoperator= (Atomic const &)=delete
 
Atomicoperator= (Atomic &&)=delete
 
void add (ValueType const value)
 Add a value to the current value.
 
void set (ValueType const value)
 Update the current value to the new value.
 
ValueType value () const
 Get the current value.
 

Detailed Description

template<SomeNumberType NumberType>
class util::Atomic< NumberType >

Atomic wrapper for integral and floating point types.

Constructor & Destructor Documentation

◆ Atomic()

template<SomeNumberType NumberType>
util::Atomic< NumberType >::Atomic ( ValueType const value)
inline

Construct a new Atomic object.

Parameters
valueThe initial value

Member Function Documentation

◆ add()

template<SomeNumberType NumberType>
void util::Atomic< NumberType >::add ( ValueType const value)
inline

Add a value to the current value.

Parameters
valueThe value to add

◆ set()

template<SomeNumberType NumberType>
void util::Atomic< NumberType >::set ( ValueType const value)
inline

Update the current value to the new value.

Parameters
valueThe new value

◆ value()

template<SomeNumberType NumberType>
ValueType util::Atomic< NumberType >::value ( ) const
inline

Get the current value.

Returns
The current value

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