HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions
v1::observable Class Referenceabstract

#include <hikogui/observable.hpp>

Inheritance diagram for v1::observable:
v1::enable_group_ptr< observable, void(observable_msg)> v1::observable_value< value_type > v1::observable_value< T >

Public Member Functions

 observable (observable const &)=delete
 
 observable (observable &&)=delete
 
observableoperator= (observable const &)=delete
 
observableoperator= (observable &&)=delete
 
virtual void constread () const noexcept=0
 Get a pointer to the current value.
 
virtual voidcopy (void const *ptr) const noexcept=0
 Allocate and make a copy of the value.
 
virtual void commit (void *ptr) noexcept=0
 Commit the modified copy.
 
virtual void abort (void *ptr) const noexcept=0
 Abort the modified copy.
 
virtual void read_lock () const noexcept=0
 Lock for reading.
 
virtual void read_unlock () const noexcept=0
 Unlock for reading.
 
virtual void write_lock () const noexcept=0
 Lock for writing.
 
virtual void write_unlock () const noexcept=0
 Unlock for writing.
 

Detailed Description

An abstract observable object.

This type is referenced by observers

Member Function Documentation

◆ abort()

virtual void v1::observable::abort ( void * ptr) const
pure virtualnoexcept

Abort the modified copy.

Note
abort() does not write_unlock().
Parameters
ptrA pointer to the modified new value returned by copy().

◆ commit()

virtual void v1::observable::commit ( void * ptr)
pure virtualnoexcept

Commit the modified copy.

Note
commit() does not write_unlock().
Parameters
ptrA pointer to the modified new value returned by copy().

◆ copy()

virtual void * v1::observable::copy ( void const * ptr) const
pure virtualnoexcept

Allocate and make a copy of the value.

Note
copy() does not write_lock() the observable and should be done before read().
Parameters
ptrA pointer to the value that was read().
Returns
A pointer to a newly allocated copy of the value.

◆ read()

virtual void const * v1::observable::read ( ) const
pure virtualnoexcept

Get a pointer to the current value.

Note
read() does not read_lock() the observable and should be done before read().
Returns
A const pointer to the value. The observer should cast this to a pointer to the value-type.

◆ read_lock()

virtual void v1::observable::read_lock ( ) const
pure virtualnoexcept

Lock for reading.

◆ read_unlock()

virtual void v1::observable::read_unlock ( ) const
pure virtualnoexcept

Unlock for reading.

◆ write_lock()

virtual void v1::observable::write_lock ( ) const
pure virtualnoexcept

Lock for writing.

◆ write_unlock()

virtual void v1::observable::write_unlock ( ) const
pure virtualnoexcept

Unlock for writing.


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