astra_ros
|
A "live" value that can be changed at runtime. Changes are broadcast to a listener. More...
#include <Parameter.hpp>
Public Types | |
typedef ParameterImpl< T >::ValueType | ValueType |
typedef ParameterImpl< T >::OnChange | OnChange |
Public Member Functions | |
Parameter () | |
Parameter (const T &value) | |
bool | set (const T &value) |
const T & | get () const |
const T & | operator* () const |
void | setOnChangeHandler (const boost::optional< OnChange > &on_change) |
template<typename F , typename... Args> | |
void | bindOnChangeHandler (F &&f, Args &&...args) |
const boost::optional< OnChange > & | getOnChangeHandler () const |
Static Public Member Functions | |
template<typename F , typename... Args> | |
static OnChange | bind (F &&f, Args &&...args) |
A "live" value that can be changed at runtime. Changes are broadcast to a listener.
Parameters can be copied cheaply. They are backed by ParameterImpl
, which implements the actual logic.
|
inline |
Create a Parameter
with the value T()
(the default value for the type T
)
|
inline |
Create a Parameter
with a given value
|
inlinestatic |
Helper method used by bindOnChangeHandler. Wraps std::bind in an OnChange.
|
inline |
Convience method for setting the OnChange
handler with semantics equivalent to std::bind
.
|
inline |
Retrieve the value of the Parameter
.
|
inline |
Retrieve the current onChange handler
|
inline |
Convenience method. Equivalent to get()
.
|
inline |
Update the value of the Parameter
. Changes are broadcast to the OnChange
listener.
|
inline |
Set the OnChange
handler that is called when values change. This shouldn't be used by the Parameter "client".