![]() |
Clapkit
|
Defines an observable value. More...
#include <ckProperty.h>
Public Member Functions | |
CKProperty ()=default | |
CKProperty (T v) | |
operator const T & () const | |
const T & | get () const |
T & | get () |
template<typename U = T> | |
auto | operator-> () -> typename std::enable_if<!std::is_pointer< U >::value, U * >::type |
template<typename U = T> | |
auto | operator-> () const -> typename std::enable_if<!std::is_pointer< U >::value, const U * >::type |
template<typename U = T> | |
auto | operator-> () -> typename std::enable_if< std::is_pointer< U >::value, typename std::remove_pointer< U >::type * >::type |
template<typename U = T> | |
auto | operator-> () const -> typename std::enable_if< std::is_pointer< U >::value, typename std::remove_pointer< U >::type * >::type |
CKProperty & | operator= (const T &v) |
CKProperty & | operator+= (const T &v) |
CKProperty & | operator-= (const T &v) |
CKProperty & | operator*= (const T &v) |
CKProperty & | operator/= (const T &v) |
CKProperty & | operator%= (const T &v) |
CKProperty & | operator++ () |
CKProperty | operator++ (int) |
CKProperty & | operator-- () |
CKProperty | operator-- (int) |
Public Attributes | |
std::function< void()> | onChange |
The function to be called when the value changes. | |
Defines an observable value.
These are mostly used to react to property changes on UI elements to refresh the screen.
In most cases, you can use a CKProperty just like a regular data type like an int or bool, but in some cases you will need to use get() to get the raw data type.
In most cases, you'll need to set the onChange to your control's property change handler, using the macro CKOBSERVEVALUE.
Then you can use RaisePropertyChange to respond to changes.
T |
|
default |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::function<void()> CKProperty< T >::onChange |
The function to be called when the value changes.