Audio Processing Framework (APF) version 0.5.0
|
Hold current and old value of any type. More...
#include <apf/misc.h>
Public Member Functions | |
template<typename... Args> | |
BlockParameter (Args &&... args) | |
Constructor. Any arguments are forwarded to both old and current value. More... | |
template<typename Arg > | |
T & | operator= (Arg &&arg) |
Assignment operator. More... | |
const T & | get () const |
Get current value. More... | |
const T & | old () const |
Get old value. More... | |
operator const T & () const | |
Conversion operator. For avoiding to call get() all the time. More... | |
bool | changed () const |
Check if value has changed between before the last assignment and now. More... | |
both_proxy | both () const |
bool | no_multiple_assignments () const |
bool | exactly_one_assignment () const |
Operators which do not change the old value: | |
BlockParameter & | operator+= (const T &rhs) |
BlockParameter & | operator-= (const T &rhs) |
BlockParameter & | operator*= (const T &rhs) |
BlockParameter & | operator/= (const T &rhs) |
BlockParameter & | operator%= (const T &rhs) |
BlockParameter & | operator&= (const T &rhs) |
BlockParameter & | operator|= (const T &rhs) |
BlockParameter & | operator<<= (const T &rhs) |
BlockParameter & | operator>>= (const T &rhs) |
BlockParameter & | operator++ () |
BlockParameter & | operator-- () |
T | operator++ (int) |
T | operator-- (int) |
Hold current and old value of any type.
A new value can be assigned with operator=(). The current and old value can be obtained with get() and old(), respectively. To find out if the old and current value are different, use changed(). BlockParameter is supposed to avoid pairs of variables where one represents an old value and the other a new one. The old value of BlockParameter is updated in operator=() (and only there).
T | The contained type. |
|
inlineexplicit |
|
inline |
|
inline |
Get current value.
Definition at line 121 of file misc.h.
Referenced by apf::BlockParameter< T >::changed(), and apf::BlockParameter< T >::operator const T &().
|
inline |
Get old value.
Definition at line 122 of file misc.h.
Referenced by apf::BlockParameter< T >::changed().
|
inline |
Conversion operator. For avoiding to call get() all the time.
Definition at line 125 of file misc.h.
References apf::BlockParameter< T >::get().
|
inline |
Check if value has changed between before the last assignment and now.
Definition at line 128 of file misc.h.
References apf::BlockParameter< T >::get(), and apf::BlockParameter< T >::old().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |