Proton DotNet
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Properties | List of all members
Apache.Qpid.Proton.Client.Concurrent.AtomicInteger Class Reference

Simple Atomic abstraction around the integer type to make atomic operations on integer types simpler to manage in code. The default value of this type is zero. More...

Public Member Functions

 AtomicInteger (int initialValue=0)
 Create a new instance with the given value or default to zero.
 
bool CompareAndSet (int expect, int update)
 Atomically sets the value to the new one if the current value == expected.
 
int IncrementAndGet ()
 Atomically increments the current value.
 
int DecrementAndGet ()
 Atomically decrements the current value.
 
int Get ()
 Reads the value of the integer atomically and returns it.
 
void Set (int newValue)
 Performs an atomic write of the integer value.
 

Static Public Member Functions

static implicit operator int (AtomicInteger atomic)
 

Properties

int Value [get]
 Read the value of the integer atomically and return it.
 

Detailed Description

Simple Atomic abstraction around the integer type to make atomic operations on integer types simpler to manage in code. The default value of this type is zero.

Constructor & Destructor Documentation

◆ AtomicInteger()

Apache.Qpid.Proton.Client.Concurrent.AtomicInteger.AtomicInteger ( int  initialValue = 0)
inline

Create a new instance with the given value or default to zero.

Parameters
initialValueInitial value for the int

Member Function Documentation

◆ CompareAndSet()

bool Apache.Qpid.Proton.Client.Concurrent.AtomicInteger.CompareAndSet ( int  expect,
int  update 
)
inline

Atomically sets the value to the new one if the current value == expected.

Parameters
expectThe value that is expected
updateThe value to assign if the expectation is met.
Returns

◆ DecrementAndGet()

int Apache.Qpid.Proton.Client.Concurrent.AtomicInteger.DecrementAndGet ( )
inline

Atomically decrements the current value.

Returns
The decremented value

◆ Get()

int Apache.Qpid.Proton.Client.Concurrent.AtomicInteger.Get ( )
inline

Reads the value of the integer atomically and returns it.

Returns
The value of the integer

◆ IncrementAndGet()

int Apache.Qpid.Proton.Client.Concurrent.AtomicInteger.IncrementAndGet ( )
inline

Atomically increments the current value.

Returns
The incremented value

◆ Set()

void Apache.Qpid.Proton.Client.Concurrent.AtomicInteger.Set ( int  newValue)
inline

Performs an atomic write of the integer value.

Parameters
newValueThe new value to assign to the integer

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