activemq-cpp-3.9.5
decaf::internal::util::concurrent::AtomicReference< T > Class Template Reference

An Pointer reference that may be updated atomically. More...

#include <src/main/decaf/util/concurrent/atomic/AtomicReference.h>

Public Member Functions

 AtomicReference ()
 
 AtomicReference (T *value)
 
virtual ~AtomicReference ()
 
T * get () const
 Gets the Current Value.
 
void set (T *newValue)
 Sets the Current value of this Reference.
 
bool compareAndSet (T *expect, T *update)
 Atomically sets the value to the given updated value if the current value == the expected value.
 
T * getAndSet (T *newValue)
 Atomically sets to the given value and returns the old value.
 
std::string toString () const
 Returns the String representation of the current value.
 

Detailed Description

template<typename T>
class decaf::internal::util::concurrent::AtomicReference< T >

An Pointer reference that may be updated atomically.

Constructor & Destructor Documentation

◆ AtomicReference() [1/2]

template<typename T>
decaf::util::concurrent::atomic::AtomicReference< T >::AtomicReference ( )
inline

◆ AtomicReference() [2/2]

template<typename T>
decaf::util::concurrent::atomic::AtomicReference< T >::AtomicReference ( T * value)
inline

◆ ~AtomicReference()

template<typename T>
virtual decaf::util::concurrent::atomic::AtomicReference< T >::~AtomicReference ( )
inlinevirtual

Member Function Documentation

◆ compareAndSet()

template<typename T>
bool decaf::util::concurrent::atomic::AtomicReference< T >::compareAndSet ( T * expect,
T * update )
inline

Atomically sets the value to the given updated value if the current value == the expected value.

Parameters
expect- the expected value
update- the new value
Returns
true if successful. False return indicates that the actual value was not equal to the expected value.

◆ get()

template<typename T>
T * decaf::util::concurrent::atomic::AtomicReference< T >::get ( ) const
inline

Gets the Current Value.

Returns
the current value of this Reference.

◆ getAndSet()

template<typename T>
T * decaf::util::concurrent::atomic::AtomicReference< T >::getAndSet ( T * newValue)
inline

Atomically sets to the given value and returns the old value.

Parameters
newValue-the new value
Returns
the previous value.

◆ set()

template<typename T>
void decaf::util::concurrent::atomic::AtomicReference< T >::set ( T * newValue)
inline

Sets the Current value of this Reference.

Parameters
newValueThe new Value of this Reference.

◆ toString()

template<typename T>
std::string decaf::util::concurrent::atomic::AtomicReference< T >::toString ( ) const
inline

Returns the String representation of the current value.

Returns
string representation of the current value.

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