A double buffer template class. More...
#include "murl_double_buffer.h"
Public Types | |
using | ValueType = DataType |
The template parameter value type. | |
Public Member Functions | |
DoubleBuffer () | |
The default constructor. | |
DoubleBuffer (const DataType &value) | |
The constructor taking a default value. More... | |
void | Reset () |
Reset the read and write value with the value's default constructor. | |
void | Reset (const DataType &value) |
Reset the read and write value with a given value. More... | |
void | ResetReadValue () |
Reset the read value with the value's default constructor. | |
void | ResetReadValue (const DataType &value) |
Reset the read value with a given value. More... | |
void | ResetWriteValue () |
Reset the write value with the value's default constructor. | |
void | ResetWriteValue (const DataType &value) |
Reset the write value with a given value. More... | |
void | Update () |
Assign the write value to the read value. | |
void | Update (const DataType &value) |
Assign the write value to the read value and set the write value. More... | |
Bool | HasChanged () const |
Check if the write value has changed. More... | |
Bool | UpdateChanged () |
Check if the write value has changed and update. More... | |
void | SetValue (const DataType &value) |
Set the write value. More... | |
const DataType & | GetValue () const |
Get the read value. More... | |
DataType & | GetValue () |
Get the mutable read value. More... | |
const DataType & | GetWriteValue () const |
Get the write value. More... | |
DataType & | GetWriteValue () |
Get the mutable write value. More... | |
DoubleBuffer & | operator= (const DataType &value) |
Set the write value (assignment operator). More... | |
operator const DataType & () const | |
Get the read value (conversion operator). More... | |
Detailed Description
template<class DataType>
class Murl::DoubleBuffer< DataType >
A double buffer template class.
The double buffer holds a read and write value and can check the change of the values.
Constructor & Destructor Documentation
◆ DoubleBuffer()
|
inlineexplicit |
The constructor taking a default value.
- Parameters
-
value The read and write value.
Member Function Documentation
◆ Reset()
|
inline |
Reset the read and write value with a given value.
- Parameters
-
value The read and write value.
◆ ResetReadValue()
|
inline |
Reset the read value with a given value.
- Parameters
-
value The read value.
◆ ResetWriteValue()
|
inline |
Reset the write value with a given value.
- Parameters
-
value The write value.
◆ Update()
|
inline |
Assign the write value to the read value and set the write value.
- Parameters
-
value The write value.
References Murl::DoubleBuffer< DataType >::Update().
◆ HasChanged()
|
inline |
Check if the write value has changed.
- Returns
- true if the write value is not equal to the read value.
Referenced by Murl::DoubleBuffer< DataType >::UpdateChanged().
◆ UpdateChanged()
|
inline |
Check if the write value has changed and update.
If true assign the write value to the read value.
- Returns
- true if the write value was not equal to the read value.
References Murl::DoubleBuffer< DataType >::HasChanged(), and Murl::DoubleBuffer< DataType >::Update().
◆ SetValue()
|
inline |
Set the write value.
- Parameters
-
value The write value.
Referenced by Murl::DoubleBuffer< DataType >::operator=().
◆ GetValue() [1/2]
|
inline |
Get the read value.
- Returns
- The read value.
Referenced by Murl::DoubleBuffer< AccountStatus >::operator const AccountStatus &().
◆ GetValue() [2/2]
|
inline |
Get the mutable read value.
- Returns
- The mutable read value.
◆ GetWriteValue() [1/2]
|
inline |
Get the write value.
- Returns
- The write value.
◆ GetWriteValue() [2/2]
|
inline |
Get the mutable write value.
- Returns
- The mutable write value.
◆ operator=()
|
inline |
Set the write value (assignment operator).
- Parameters
-
value The write value.
- Returns
- The object itself.
References Murl::DoubleBuffer< DataType >::SetValue().
◆ operator const DataType &()
|
inline |
Get the read value (conversion operator).
- Returns
- The read value.
The documentation for this class was generated from the following file:
- murl_double_buffer.h