An Pointer reference that may be updated atomically.
More...
#include <src/main/decaf/util/concurrent/atomic/AtomicReference.h>
|
| | 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.
|
| |
An Pointer reference that may be updated atomically.
◆ AtomicReference() [1/2]
◆ AtomicReference() [2/2]
◆ ~AtomicReference()
◆ compareAndSet()
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()
Gets the Current Value.
- Returns
- the current value of this Reference.
◆ getAndSet()
Atomically sets to the given value and returns the old value.
- Parameters
-
- Returns
- the previous value.
◆ set()
Sets the Current value of this Reference.
- Parameters
-
| newValue | The new Value of this Reference. |
◆ toString()
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: