decaf::util::concurrent::atomic::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::util::concurrent::atomic::AtomicReference< T >
An Pointer reference that may be updated atomically.
Constructor & Destructor Documentation
Member Function Documentation
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.
Gets the Current Value.
- Returns:
- the current value of this Reference.
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: