Skip to main content

ModificationHandle

ModificationHandle

A RAII handle for modifying an object and notifying on completion. More…

#include <Observer_Data.hpp>

Public Functions

Name
ModificationHandle(T & data_ref, std::function< void()> on_destroy_callback)
~ModificationHandle()
T * operator->()
T const * operator->() const
T & operator*()
T const & operator*() const
T & get()
T const & get() const
ModificationHandle(ModificationHandle && other)
ModificationHandle & operator=(ModificationHandle && other)
ModificationHandle(ModificationHandle const & ) =delete
ModificationHandle & operator=(ModificationHandle const & ) =delete

Detailed Description

template <typename T >
class ModificationHandle;

A RAII handle for modifying an object and notifying on completion.

This proxy object holds a reference to data (T&) and a callback. When this handle is destroyed (goes out of scope), the callback is automatically invoked, typically to notify observers of the change.

It is not copyable, but it is movable.

Public Functions Documentation

function ModificationHandle

inline ModificationHandle(
    T & data_ref,
    std::function< void()> on_destroy_callback
)

function ~ModificationHandle

inline ~ModificationHandle()

function operator->

inline T * operator->()

function operator->

inline T const * operator->() const

function operator*

inline T & operator*()

function operator*

inline T const & operator*() const

function get

inline T & get()

function get

inline T const & get() const

function ModificationHandle

inline ModificationHandle(
    ModificationHandle && other
)

function operator=

inline ModificationHandle & operator=(
    ModificationHandle && other
)

function ModificationHandle

ModificationHandle(
    ModificationHandle const & 
) =delete

function operator=

ModificationHandle & operator=(
    ModificationHandle const & 
) =delete

Updated on 2026-11-13 at 20:25:40 +0000