|
HikoGUI
A low latency retained GUI
|
#include <hikogui/observer.hpp>
Public Types | |
| using | void_pointer = std::conditional_t<is_writing, void *, void const *> |
| using | const_void_pointer = void const * |
| using | reference = std::conditional_t<is_writing, value_type&, value_type const&> |
| using | const_reference = value_type const& |
| using | pointer = std::conditional_t<is_writing, value_type *, value_type const *> |
| using | const_pointer = value_type const * |
Public Member Functions | |
| ~_proxy () noexcept | |
| Commits and destruct the proxy object. | |
| _proxy (_proxy const &)=delete | |
| _proxy & | operator= (_proxy const &)=delete |
| _proxy (_proxy const &other) noexcept | |
| _proxy & | operator= (_proxy const &other) noexcept |
| _proxy (_proxy &&other) noexcept | |
| _proxy & | operator= (_proxy &&other) noexcept |
| constexpr | _proxy () noexcept=default |
| Construct an empty proxy object. | |
| reference | operator* () noexcept |
| Dereference the value. | |
| const_reference | operator* () const noexcept |
| Dereference the value. | |
| pointer | operator-> () noexcept |
| Pointer dereference the value. | |
| pointer | operator& () noexcept |
| Pointer dereference the value. | |
| const_pointer | operator-> () const noexcept |
| Pointer dereference the value. | |
| void | commit () noexcept |
| Commit the changes to the value early. | |
| void | abort () noexcept |
| Revert any changes to the value. | |
| X (++) X(--) X(++) X(--) X(+ | |
| _proxy (observer const *observer, void_pointer base, pointer value) noexcept | |
| Create a proxy object. | |
| void | _commit () noexcept |
| void | _abort () noexcept |
Data Fields | |
| void_pointer | _base = nullptr |
| pointer | _value = nullptr |
Static Public Attributes | |
| static constexpr bool | is_writing = IsWriting |
Friends | |
| class | observer |
A proxy object of the observer.
The proxy is a RAII object that manages a transaction with the shared-state as a whole, while giving access to only a sub-object of the shared-state.
| IsWriting | The proxy is being used to write |
|
inlinenoexcept |
|
constexprdefaultnoexcept |
Construct an empty proxy object.
|
inlinenoexcept |
Create a proxy object.
| observer | a pointer to the observer. |
| base | a pointer to the dereference rcu-object from the shared_state. This is needed to commit or abort the shared_state as a whole. |
| value | a pointer to the sub-object of the shared_state that the observer is pointing to. |
|
inlinenoexcept |
Revert any changes to the value.
Calling this function allows to abort any changes in the value.
|
inlinenoexcept |
Commit the changes to the value early.
Calling this function allows to commit earlier than the destructor.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |