CoreComponents 3.0.0
A Modern C++ Toolkit
|
Property bindings More...
#include <cc/Property>
Public Member Functions | |
Property () | |
Create property with default value (T{}) | |
Property (const T &b) | |
Create property with initial value b. | |
Property (std::initializer_list< T > b) | |
Create property with initial value b. | |
Property (Function< T()> &&f) | |
Create property with defining function f. | |
Property (const Property &b) | |
Property (Property *b) | |
Create an alias of property b. | |
Property & | operator= (const Property &b) |
Assign value of (and break prior bindings) | |
Property (Property &&b) | |
Property & | operator= (Property &&b) |
~Property () | |
Cleanup: disconnect all bindings and listeners. | |
void | define (Function< T()> &&f) |
Set a new defining function f | |
void | operator() (const T &b) |
Assign a new value b (and break prior bindings) | |
void | operator() (Function< T()> &&f) |
Set a new defining function f | |
void | restrict (Function< bool(T &, T)> &&g) |
Setup restrictor function g The restrictor gets the new and the old value passed. | |
void | onChanged (Function< void()> &&f) const |
Register function f to be called when the property value changes. | |
bool | readFrom (const String &text) |
Read value from text. | |
T | operator() () const |
Evaluate current property value. | |
operator T () const | |
Evaluate current property value. | |
Property & | operator= (const T &b) |
Assign a new value b (and break prior bindings) | |
template<class T2 > | |
Property & | operator= (const T2 &b) |
Assign a new value b (and break prior bindings) | |
template<class T2 > | |
Property & | operator+= (const T2 &b) |
Increment the current value by b (and break prior bindings) | |
template<class T2 > | |
Property & | operator-= (const T2 &b) |
Decrement the current value by b (and break prior bindings) | |
template<class T2 > | |
Property & | operator*= (const T2 &b) |
Multiply the current value by b (and break prior bindings) | |
template<class T2 > | |
Property & | operator/= (const T2 &b) |
Divide the current value by b (and break prior bindings) | |
template<class T2 > | |
Property & | operator<<= (const T2 &b) |
Shift left the current value by b (and break prior bindings) | |
template<class T2 > | |
Property & | operator>>= (const T2 &b) |
Shift right the current value by b (and break prior bindings) | |
Property & | operator++ () |
Prefix increment operator: Add 1 to the current value and return the new value | |
Property & | operator-- () |
Prefix decrement operator: Subtract 1 from the current value and return the new value | |
T | operator++ (int) |
Postfix increment operator: Add 1 to the current value and return the old value. | |
T & | operator-- (int) |
Postfix decrement operator: Subtract 1 from the current value and return the old value. | |
Property bindings
T | Value type |
Property | ( | ) |
Create property with default value (T{})
Property | ( | const T & | b | ) |
Create property with initial value b.
Property | ( | std::initializer_list< T > | b | ) |
Create property with initial value b.
Create property with defining function f.
~Property | ( | ) |
Cleanup: disconnect all bindings and listeners.
Assign value of (and break prior bindings)
void define | ( | Function< T()> && | f | ) |
Set a new defining function f
void operator() | ( | const T & | b | ) |
Assign a new value b (and break prior bindings)
void operator() | ( | Function< T()> && | f | ) |
Set a new defining function f
void restrict | ( | Function< bool(T &, T)> && | g | ) |
Setup restrictor function g The restrictor gets the new and the old value passed.
It returns true if the value change is allowed to take place. The restrictor function can also modify the new value.
void onChanged | ( | Function< void()> && | f | ) | const |
Register function f to be called when the property value changes.
bool readFrom | ( | const String & | text | ) |
Read value from text.
T operator() | ( | ) | const |
Evaluate current property value.
operator T | ( | ) | const |
Evaluate current property value.
Property & operator= | ( | const T & | b | ) |
Assign a new value b (and break prior bindings)
Assign a new value b (and break prior bindings)
T2 | Value type |
Increment the current value by b (and break prior bindings)
T2 | Delta type |
Decrement the current value by b (and break prior bindings)
T2 | Delta type |
Multiply the current value by b (and break prior bindings)
T2 | Multiplication factor type |
Divide the current value by b (and break prior bindings)
T2 | Divisor type |
Shift left the current value by b (and break prior bindings)
T2 | Shift distance type |
Shift right the current value by b (and break prior bindings)
T2 | Shift distance type |
Property & operator++ | ( | ) |
Prefix increment operator: Add 1 to the current value and return the new value
Property & operator-- | ( | ) |
Prefix decrement operator: Subtract 1 from the current value and return the new value
T operator++ | ( | int | ) |
Postfix increment operator: Add 1 to the current value and return the old value.
T & operator-- | ( | int | ) |
Postfix decrement operator: Subtract 1 from the current value and return the old value.