Proton DotNet
All Classes Namespaces Functions Variables Enumerations Enumerator Properties Pages
Public Member Functions | Static Public Member Functions | Properties | List of all members
Apache.Qpid.Proton.Client.Concurrent.AtomicReference< T > Class Template Reference

Provides an object reference that may be updated and read atomically. More...

Public Member Functions

 AtomicReference ()
 Creates a new AtomicReference instance where the contained value is default to null. More...
 
 AtomicReference (T value)
 Creates a new AtomicReference instance where the contained value is set to the provided value. More...
 
Get ()
 Atomic read of the contained value. More...
 
void Set (T target)
 Atomic write of the given value into the contained object reference. More...
 
bool CompareAndSet (T expectedValue, T newValue)
 Atomically set the value to the new value if and only if the value that is currently set matches the target expected value. More...
 
CompareAndExchange (T expectedValue, T newValue)
 Compare the current value to the expected value and if they match set the current value to the new value as an atomic operation. More...
 
override string ToString ()
 Performs a to string operation on the currently set value. More...
 

Static Public Member Functions

static implicit operator T (AtomicReference< T > reference)
 Implicit conversion of an atomic reference type to the contained value using a volatile read operation. More...
 

Properties

Value [get, set]
 Atomic access to the contained value. More...
 

Detailed Description

Provides an object reference that may be updated and read atomically.

Type Constraints
T :class 

Constructor & Destructor Documentation

◆ AtomicReference() [1/2]

Creates a new AtomicReference instance where the contained value is default to null.

◆ AtomicReference() [2/2]

Creates a new AtomicReference instance where the contained value is set to the provided value.

Parameters
valueThe value to initialize the reference with

Member Function Documentation

◆ CompareAndExchange()

T Apache.Qpid.Proton.Client.Concurrent.AtomicReference< T >.CompareAndExchange ( expectedValue,
newValue 
)
inline

Compare the current value to the expected value and if they match set the current value to the new value as an atomic operation.

Parameters
expectedValuethe value that must currently be set
newValuethe value to set if the current value matches the expectation
Returns
The value that was set when the compare occurred which equals the expected if successful

◆ CompareAndSet()

bool Apache.Qpid.Proton.Client.Concurrent.AtomicReference< T >.CompareAndSet ( expectedValue,
newValue 
)
inline

Atomically set the value to the new value if and only if the value that is currently set matches the target expected value.

Parameters
expectedValueThe value that is required before the new value is applied
newValueThe new value to set if the current value matches the expectation
Returns

◆ Get()

Atomic read of the contained value.

Returns
The value that was read

◆ operator T()

static implicit Apache.Qpid.Proton.Client.Concurrent.AtomicReference< T >.operator T ( AtomicReference< T >  reference)
inlinestatic

Implicit conversion of an atomic reference type to the contained value using a volatile read operation.

Parameters
referenceThe atomic reference to read from

◆ Set()

void Apache.Qpid.Proton.Client.Concurrent.AtomicReference< T >.Set ( target)
inline

Atomic write of the given value into the contained object reference.

Parameters
targetThe object reference value to set.

◆ ToString()

override string Apache.Qpid.Proton.Client.Concurrent.AtomicReference< T >.ToString ( )
inline

Performs a to string operation on the currently set value.

Returns
The stringified version of the current value

Property Documentation

◆ Value

Atomic access to the contained value.


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