nux-1.14.0
nux::RWProperty< VALUE_TYPE > Class Template Reference

A read/write property that uses a functions to get and set the value. More...

#include <NuxCore/Property.h>

Inheritance diagram for nux::RWProperty< VALUE_TYPE >:
nux::PropertyChangedSignal< VALUE_TYPE >

List of all members.

Public Types

typedef VALUE_TYPE ValueType
typedef PropertyChangedSignal
< VALUE_TYPE > 
SignalBase
typedef sigc::slot< bool,
VALUE_TYPE const & > 
SetterFunction
typedef sigc::slot< VALUE_TYPE > GetterFunction

Public Member Functions

 RWProperty (GetterFunction getter_function, SetterFunction setter_function)
VALUE_TYPE operator= (VALUE_TYPE const &value)
 operator VALUE_TYPE () const
VALUE_TYPE operator() () const
VALUE_TYPE operator() (VALUE_TYPE const &value)
VALUE_TYPE Get () const
VALUE_TYPE Set (VALUE_TYPE const &value)
void SetGetterFunction (GetterFunction getter_function)
void SetSetterFunction (SetterFunction setter_function)

Detailed Description

template<typename VALUE_TYPE>
class nux::RWProperty< VALUE_TYPE >

A read/write property that uses a functions to get and set the value.

The value type is not stored in the propery, but maintained by the setter and getter functions.

A changed signal is emitted if the setter function specifies that the value has changed.

The default setter does nothing and emits no signal, and the default getter returns a default constructed VALUE_TYPE. The default getter and setter should be overridden through either the constructor args or through the SetGetterFunction / SetSetterFunction.

Definition at line 152 of file Property.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends