#include <wvar.h>
Inherited by Wt::WVar< VARTYPE, PARENT >, and Wt::WVar< VARTYPE, WVarBase< int >::RW >.
Public Member Functions | |
WVarBase (VARTYPE value=0) | |
VARTYPE | readValue () const |
VARTYPE | get (VARTYPE) const |
usefull for overrides and variables connection | |
void | set (VARTYPE value) |
void | connect (WVarBase &var) |
connect as a proxy to another WVar | |
operator VARTYPE () const | |
operator const std::string () const | |
WVarBase & | operator+= (const VARTYPE &value) |
WVarBase & | operator-= (const VARTYPE &value) |
WVarBase & | operator++ () |
prefix operator | |
WVarBase & | operator-- () |
WVarBase & | operator++ (int) |
postfix operator | |
WVarBase & | operator-- (int) |
Public Attributes | |
Signal012M< bool, VARTYPE, VARTYPE, Blocker > | aboutToChange |
Signal012< void, VARTYPE, VARTYPE > | changed |
Signal01< void, VARTYPE > | read |
sigc::signal1< VARTYPE, VARTYPE, Overrider > | override |
Protected Types | |
typedef std::pair< bool, VARTYPE > | ValidValue |
Protected Member Functions | |
const VARTYPE & | getValue () const |
avoids emitting read signal | |
void | setValue (const VARTYPE &value) |
avoids emitting aboutToChange, changed signal | |
WVarBase & | operator= (VARTYPE value) |
WVarBase & | operator= (const WVarBase &value) |
Classes | |
class | Blocker |
Marshaler. More... | |
class | OverideValue |
class | Overrider |
Marshaler to override all values but the last. More... | |
class | RW |
A WVar watched variable is a templated attempt to vanquish the get set methods that accompanies object oriented programming.
if a slot from the ones that are called during aboutToChange returns true then the change is aborted.
A WVar variable can be publically read/write or protected. The default is to be publically read/write. If you do not wish for your variable to be publically readable just make your damn variable protected/private.
WVar<int> a is a read/write int variable. WVar<int, C> a is a publically readable and read/write for class C.
Example: see test/vars.c
typedef std::pair<bool, VARTYPE> Wt::WVarBase< VARTYPE >::ValidValue [protected] |
Wt::WVarBase< VARTYPE >::WVarBase | ( | VARTYPE | value = 0 |
) | [inline] |
void Wt::WVarBase< VARTYPE >::connect | ( | WVarBase< VARTYPE > & | var | ) | [inline] |
connect as a proxy to another WVar
VARTYPE Wt::WVarBase< VARTYPE >::get | ( | VARTYPE | ) | const [inline] |
const VARTYPE& Wt::WVarBase< VARTYPE >::getValue | ( | ) | const [inline, protected] |
avoids emitting read signal
Wt::WVarBase< VARTYPE >::operator const std::string | ( | ) | const [inline] |
Wt::WVarBase< VARTYPE >::operator VARTYPE | ( | ) | const [inline] |
WVarBase& Wt::WVarBase< VARTYPE >::operator++ | ( | int | ) | [inline] |
postfix operator
WVarBase& Wt::WVarBase< VARTYPE >::operator++ | ( | ) | [inline] |
prefix operator
WVarBase& Wt::WVarBase< VARTYPE >::operator+= | ( | const VARTYPE & | value | ) | [inline] |
WVarBase& Wt::WVarBase< VARTYPE >::operator-- | ( | int | ) | [inline] |
WVarBase& Wt::WVarBase< VARTYPE >::operator-- | ( | ) | [inline] |
WVarBase& Wt::WVarBase< VARTYPE >::operator-= | ( | const VARTYPE & | value | ) | [inline] |
WVarBase& Wt::WVarBase< VARTYPE >::operator= | ( | const WVarBase< VARTYPE > & | value | ) | [inline, protected] |
WVarBase& Wt::WVarBase< VARTYPE >::operator= | ( | VARTYPE | value | ) | [inline, protected] |
VARTYPE Wt::WVarBase< VARTYPE >::readValue | ( | ) | const [inline] |
void Wt::WVarBase< VARTYPE >::set | ( | VARTYPE | value | ) | [inline] |
void Wt::WVarBase< VARTYPE >::setValue | ( | const VARTYPE & | value | ) | [inline, protected] |
avoids emitting aboutToChange, changed signal
Signal012M<bool, VARTYPE, VARTYPE, Blocker> Wt::WVarBase< VARTYPE >::aboutToChange |
Signal012<void, VARTYPE, VARTYPE> Wt::WVarBase< VARTYPE >::changed |
sigc::signal1<VARTYPE, VARTYPE, Overrider> Wt::WVarBase< VARTYPE >::override [mutable] |
Signal01<void, VARTYPE> Wt::WVarBase< VARTYPE >::read [mutable] |
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.