This is the lock free version of the AtomicValue.
More...
#include <Concurrent.h>
Inherits SingleElementStorage< T >.
|
| AtomicValue (std::unique_ptr< T > iValue) |
|
T const * | get () |
|
void | get (T &oElement) |
| Copy the value to oElement. More...
|
|
void | get (T *oElement) |
| Copy the value to *oElement. More...
|
|
T | getCopy () |
|
void | set (T const &iValue) |
| Copy the value to make it accessible to get. More...
|
|
void | set (T const *iValue) |
| Copy the value to make it accessible to get. More...
|
|
template<class ElementModifier > |
void | update (ElementModifier const &iElementModifier) |
| Use this flavor to avoid copy. More...
|
|
template<class ElementModifier > |
bool | updateIf (ElementModifier const &iElementModifier) |
| Use this flavor to avoid copy. More...
|
|
bool | __isLockFree () const |
| Used (from test) to make sure that it is a lock free implementation. More...
|
|
bool | isEmpty () const |
|
| SingleElementStorage (std::unique_ptr< T > iElement, bool iIsEmpty) noexcept |
|
| ~SingleElementStorage () |
|
template<typename T>
class pongasoft::Utils::Concurrent::LockFree::AtomicValue< T >
This is the lock free version of the AtomicValue.
Internally it uses a different pointer for get and set. As described in the comment for SingleElementStorage, all methods related to 'get' can be called in one thread while all methods related to 'set' can be called by another.
◆ Element
◆ AtomicValue()
◆ get() [1/3]
◆ get() [2/3]
Copy the value to oElement.
◆ get() [3/3]
Copy the value to *oElement.
◆ getCopy()
- Returns
- a copy of the value
◆ set() [1/2]
void set |
( |
T const & |
iValue | ) |
|
|
inline |
Copy the value to make it accessible to get.
◆ set() [2/2]
void set |
( |
T const * |
iValue | ) |
|
|
inline |
Copy the value to make it accessible to get.
◆ update()
void update |
( |
ElementModifier const & |
iElementModifier | ) |
|
|
inline |
Use this flavor to avoid copy.
ElementModifier will be called back with the internal pointer to update it.
◆ updateIf()
bool updateIf |
( |
ElementModifier const & |
iElementModifier | ) |
|
|
inline |
Use this flavor to avoid copy.
ElementModifier will be called back with the internal pointer to update it.This flavor uses a callback that returns true when the update should happen and false otherwise.
◆ fGetValue
◆ fSetValue
The documentation for this class was generated from the following file: