Nui
Classes | Public Types | Public Member Functions | Protected Attributes | List of all members
Nui::ModifiableObserved< ContainedT > Class Template Reference

#include <observed_value.hpp>

Inheritance diagram for Nui::ModifiableObserved< ContainedT >:
Inheritance graph
[legend]
Collaboration diagram for Nui::ModifiableObserved< ContainedT >:
Collaboration graph
[legend]

Classes

class  ModificationProxy
 

Public Types

using value_type = ContainedT
 

Public Member Functions

 ModifiableObserved ()
 
 ModifiableObserved (const ModifiableObserved &)=delete
 
 ModifiableObserved (ModifiableObserved &&other)
 
ModifiableObservedoperator= (const ModifiableObserved &)=delete
 
ModifiableObservedoperator= (ModifiableObserved &&other)
 
ModifiableObservedoperator= (ContainedT const &contained)
 
ModifiableObservedoperator= (ContainedT &&contained)
 
 ~ModifiableObserved ()=default
 
template<typename T = ContainedT>
 ModifiableObserved (T &&t)
 
 ModifiableObserved (CustomEventContextFlag_t, EventContext *ctx)
 
template<typename T = ContainedT>
 ModifiableObserved (CustomEventContextFlag_t, EventContext *ctx, T &&t)
 
template<typename T = ContainedT>
ModifiableObservedoperator= (T &&t)
 Assign a completely new value. More...
 
template<typename T = ContainedT, typename U >
requires PlusAssignable< T, U > ModifiableObserved< T > & operator+= (U const &rhs)
 
template<typename T = ContainedT, typename U >
requires MinusAssignable< T, U > ModifiableObserved< T > & operator-= (U const &rhs)
 
template<typename T = ContainedT>
requires std::equality_comparable_with< ContainedT, T > &&Fundamental< T > &&Fundamental< ContainedT > ModifiableObservedoperator= (T &&t)
 
template<typename T = ContainedT>
requires std::equality_comparable_with< ContainedT, T > ModifiableObservedassignChecked (T &&other)
 
ModificationProxy modify ()
 Can be used to make mutations to the underlying class that get commited when the returned proxy is destroyed. More...
 
ModificationProxy modifyNow ()
 
 operator bool () const requires std
 
ContainedT const & value () const
 
ContainedT & operator* ()
 
ContainedT const & operator* () const
 
ContainedT * operator-> ()
 
ContainedT const * operator-> () const
 
void assignWithoutUpdate (ContainedT &&t)
 Sets the value without making an update. More...
 
- Public Member Functions inherited from Nui::ObservedBase
 ObservedBase (CustomEventContextFlag_t, EventContext *ctx)
 
virtual ~ObservedBase ()=default
 
 ObservedBase (ObservedBase const &)=delete
 
 ObservedBase (ObservedBase &&other)
 
ObservedBaseoperator= (ObservedBase const &)=delete
 
ObservedBaseoperator= (ObservedBase &&other)
 
void attachEvent (EventContext::EventIdType eventId) const
 
void attachOneshotEvent (EventContext::EventIdType eventId) const
 
void detachEvent (EventContext::EventIdType eventId) const
 
std::size_t attachedEventCount () const
 
std::size_t attachedOneshotEventCount () const
 
std::size_t totalAttachedEventCount () const
 
void detachAllEvents ()
 You should never need to do this. More...
 
virtual void update (bool=false) const
 
void updateNow (bool force=false) const
 

Protected Attributes

ContainedT contained_
 
- Protected Attributes inherited from Nui::ObservedBase
EventContexteventContext_
 
std::vector< EventContext::EventIdTypeattachedEvents_
 
std::vector< EventContext::EventIdTypeattachedOneshotEvents_
 

Member Typedef Documentation

◆ value_type

template<typename ContainedT >
using Nui::ModifiableObserved< ContainedT >::value_type = ContainedT

Constructor & Destructor Documentation

◆ ModifiableObserved() [1/6]

template<typename ContainedT >
Nui::ModifiableObserved< ContainedT >::ModifiableObserved ( )
inline

◆ ModifiableObserved() [2/6]

template<typename ContainedT >
Nui::ModifiableObserved< ContainedT >::ModifiableObserved ( const ModifiableObserved< ContainedT > &  )
delete

◆ ModifiableObserved() [3/6]

template<typename ContainedT >
Nui::ModifiableObserved< ContainedT >::ModifiableObserved ( ModifiableObserved< ContainedT > &&  other)
inline

◆ ~ModifiableObserved()

template<typename ContainedT >
Nui::ModifiableObserved< ContainedT >::~ModifiableObserved ( )
default

◆ ModifiableObserved() [4/6]

template<typename ContainedT >
template<typename T = ContainedT>
Nui::ModifiableObserved< ContainedT >::ModifiableObserved ( T &&  t)
inlineexplicit

◆ ModifiableObserved() [5/6]

template<typename ContainedT >
Nui::ModifiableObserved< ContainedT >::ModifiableObserved ( CustomEventContextFlag_t  ,
EventContext ctx 
)
inlineexplicit

◆ ModifiableObserved() [6/6]

template<typename ContainedT >
template<typename T = ContainedT>
Nui::ModifiableObserved< ContainedT >::ModifiableObserved ( CustomEventContextFlag_t  ,
EventContext ctx,
T &&  t 
)
inlineexplicit

Member Function Documentation

◆ assignChecked()

template<typename ContainedT >
template<typename T = ContainedT>
requires std::equality_comparable_with<ContainedT, T> ModifiableObserved& Nui::ModifiableObserved< ContainedT >::assignChecked ( T &&  other)
inline

◆ assignWithoutUpdate()

template<typename ContainedT >
void Nui::ModifiableObserved< ContainedT >::assignWithoutUpdate ( ContainedT &&  t)
inline

Sets the value without making an update.

◆ modify()

template<typename ContainedT >
ModificationProxy Nui::ModifiableObserved< ContainedT >::modify ( )
inline

Can be used to make mutations to the underlying class that get commited when the returned proxy is destroyed.

Returns
ModificationProxy

◆ modifyNow()

template<typename ContainedT >
ModificationProxy Nui::ModifiableObserved< ContainedT >::modifyNow ( )
inline

◆ operator bool()

template<typename ContainedT >
Nui::ModifiableObserved< ContainedT >::operator bool ( ) const
inlineexplicit

◆ operator*() [1/2]

template<typename ContainedT >
ContainedT& Nui::ModifiableObserved< ContainedT >::operator* ( )
inline

◆ operator*() [2/2]

template<typename ContainedT >
ContainedT const& Nui::ModifiableObserved< ContainedT >::operator* ( ) const
inline

◆ operator+=()

template<typename ContainedT >
template<typename T = ContainedT, typename U >
requires PlusAssignable<T, U> ModifiableObserved<T>& Nui::ModifiableObserved< ContainedT >::operator+= ( U const &  rhs)
inline

◆ operator-=()

template<typename ContainedT >
template<typename T = ContainedT, typename U >
requires MinusAssignable<T, U> ModifiableObserved<T>& Nui::ModifiableObserved< ContainedT >::operator-= ( U const &  rhs)
inline

◆ operator->() [1/2]

template<typename ContainedT >
ContainedT* Nui::ModifiableObserved< ContainedT >::operator-> ( )
inline

◆ operator->() [2/2]

template<typename ContainedT >
ContainedT const* Nui::ModifiableObserved< ContainedT >::operator-> ( ) const
inline

◆ operator=() [1/6]

template<typename ContainedT >
ModifiableObserved& Nui::ModifiableObserved< ContainedT >::operator= ( const ModifiableObserved< ContainedT > &  )
delete

◆ operator=() [2/6]

template<typename ContainedT >
ModifiableObserved& Nui::ModifiableObserved< ContainedT >::operator= ( ContainedT &&  contained)
inline

◆ operator=() [3/6]

template<typename ContainedT >
ModifiableObserved& Nui::ModifiableObserved< ContainedT >::operator= ( ContainedT const &  contained)
inline

◆ operator=() [4/6]

template<typename ContainedT >
ModifiableObserved& Nui::ModifiableObserved< ContainedT >::operator= ( ModifiableObserved< ContainedT > &&  other)
inline

◆ operator=() [5/6]

template<typename ContainedT >
template<typename T = ContainedT>
ModifiableObserved& Nui::ModifiableObserved< ContainedT >::operator= ( T &&  t)
inline

Assign a completely new value.

Parameters
t
Returns
ModifiableObserved&

◆ operator=() [6/6]

template<typename ContainedT >
template<typename T = ContainedT>
requires std::equality_comparable_with<ContainedT, T>&& Fundamental<T>&& Fundamental<ContainedT> ModifiableObserved& Nui::ModifiableObserved< ContainedT >::operator= ( T &&  t)
inline

◆ value()

template<typename ContainedT >
ContainedT const& Nui::ModifiableObserved< ContainedT >::value ( ) const
inline

Member Data Documentation

◆ contained_

template<typename ContainedT >
ContainedT Nui::ModifiableObserved< ContainedT >::contained_
protected

The documentation for this class was generated from the following file: