Observable Reference
Generic observable objects for C++
Public Member Functions | List of all members
observable::value_updater< ValueType > Class Template Referenceabstract

Description

template<typename ValueType>
class observable::value_updater< ValueType >

Interface used to update a value.

Public Member Functions

virtual void set_value_notifier (std::function< void(ValueType &&)> const &notifier)=0
 Set a functor that can be used to notify the value to be updated of a change. More...
 
virtual auto get () const -> ValueType=0
 Retrieve the current value. More...
 
virtual ~value_updater ()
 Destructor. More...
 
 value_updater ()=default
 Value updaters are default-constructible. More...
 
 value_updater (value_updater const &)=default
 Value updaters are copy-constructible. More...
 
 value_updater (value_updater &&)=default
 Value updaters are move-constructible. More...
 
value_updateroperator= (value_updater const &)=default
 Value updaters are copy-assignable. More...
 
value_updateroperator= (value_updater &&)=default
 Value updaters are move-assignable. More...
 

Constructor & Destructor Documentation

◆ ~value_updater()

template<typename ValueType >
virtual observable::value_updater< ValueType >::~value_updater ( )
inlinevirtual

Destructor.

◆ value_updater() [1/3]

template<typename ValueType >
observable::value_updater< ValueType >::value_updater ( )
default

Value updaters are default-constructible.

◆ value_updater() [2/3]

template<typename ValueType >
observable::value_updater< ValueType >::value_updater ( value_updater< ValueType > const &  )
default

Value updaters are copy-constructible.

◆ value_updater() [3/3]

template<typename ValueType >
observable::value_updater< ValueType >::value_updater ( value_updater< ValueType > &&  )
default

Value updaters are move-constructible.

Member Function Documentation

◆ set_value_notifier()

template<typename ValueType >
virtual void observable::value_updater< ValueType >::set_value_notifier ( std::function< void(ValueType &&)> const &  notifier)
pure virtual

Set a functor that can be used to notify the value to be updated of a change.

Parameters
[in]notifierFunctor that will notify the value of a change.

Implemented in observable::expr::expression< ValueType, EvaluatorType >, and observable::expr::expression< ValueType, expression_evaluator >.

◆ get()

template<typename ValueType >
virtual auto observable::value_updater< ValueType >::get ( ) const -> ValueType
pure virtual

◆ operator=() [1/2]

template<typename ValueType >
value_updater& observable::value_updater< ValueType >::operator= ( value_updater< ValueType > const &  )
default

Value updaters are copy-assignable.

◆ operator=() [2/2]

template<typename ValueType >
value_updater& observable::value_updater< ValueType >::operator= ( value_updater< ValueType > &&  )
default

Value updaters are move-assignable.