The atomic integer class. More...

#include "murl_system_mutex.h"

Inheritance diagram for Murl::System::AtomicSInt32:

Public Member Functions

 AtomicSInt32 (const SInt32 value)
 The constructor. More...
 
SInt32 operator++ ()
 Increment prefix operator. More...
 
SInt32 operator++ (int)
 Increment suffix operator. More...
 
SInt32 operator-- ()
 Decrement prefix operator. More...
 
SInt32 operator-- (int)
 Decrement suffix operator. More...
 
SInt32 ExchangeAndAdd (SInt32 valueToAdd)
 Exchange and add a value. More...
 
 operator SInt32 ()
 Conversion operator. More...
 
- Public Member Functions inherited from Murl::NonCopyable
 NonCopyable ()=default
 The default constructor.
 

Protected Attributes

SInt32 mValue
 The value store.
 

Detailed Description

The atomic integer class.

The atomic integer is a thread-safe integer. On modern platforms the operations are supported by intrinsic CPU commands without using a mutex.

Constructor & Destructor Documentation

◆ AtomicSInt32()

Murl::System::AtomicSInt32::AtomicSInt32 ( const SInt32  value)
inlineexplicit

The constructor.

Parameters
valueThe initial value.

Member Function Documentation

◆ operator++() [1/2]

SInt32 Murl::System::AtomicSInt32::operator++ ( )

Increment prefix operator.

Returns
The incremented value.

◆ operator++() [2/2]

SInt32 Murl::System::AtomicSInt32::operator++ ( int  )

Increment suffix operator.

Returns
The value before incrementation.

◆ operator--() [1/2]

SInt32 Murl::System::AtomicSInt32::operator-- ( )

Decrement prefix operator.

Returns
The decremented value.

◆ operator--() [2/2]

SInt32 Murl::System::AtomicSInt32::operator-- ( int  )

Decrement suffix operator.

Returns
The value before decrementing.

◆ ExchangeAndAdd()

SInt32 Murl::System::AtomicSInt32::ExchangeAndAdd ( SInt32  valueToAdd)

Exchange and add a value.

Parameters
valueToAddThe value to add.
Returns
The value before addition.

Referenced by operator SInt32().

◆ operator SInt32()

Murl::System::AtomicSInt32::operator SInt32 ( )
inline

Conversion operator.

Returns
The value.

References ExchangeAndAdd().


The documentation for this class was generated from the following file:
  • murl_system_mutex.h


Copyright © 2011-2024 Spraylight GmbH.