xentara-workbench-plugin v1.0.1
The Xentara Workbench Plugin Framework
Loading...
Searching...
No Matches
xentara::workbench::bindings::PropertyChangedCallback Class Referencefinal

A callback for changes to a property. More...

#include <xentara/workbench/bindings/PropertyChangedCallback.hpp>

Classes

class  FullVisitor
 
class  NonNullVisitor
 
class  SimpleVisitor
 

Public Member Functions

 PropertyChangedCallback ()=default
 Default constructor.
 
 PropertyChangedCallback (std::nullptr_t)
 Default constructor.
 
template<std::invocable Callback>
requires (!std::invocable<Callback, Action, std::size_t>)
 PropertyChangedCallback (Callback &&callback)
 Constructor for a simple callback.
 
template<std::invocable< Action, std::size_t > Callback>
 PropertyChangedCallback (Callback &&callback)
 Constructor for a full callback.
 
 operator bool () const noexcept
 Check whether a callback has been set.
 
auto operator() () const -> void
 Calls the callback signalling a value change.
 
auto operator() (Action action, std::size_t index={}) const -> void
 Calls the callback signalling an arbitrary change.
 

Detailed Description

A callback for changes to a property.

Constructor & Destructor Documentation

◆ PropertyChangedCallback() [1/4]

xentara::workbench::bindings::PropertyChangedCallback::PropertyChangedCallback ( )
default

Default constructor.

◆ PropertyChangedCallback() [2/4]

xentara::workbench::bindings::PropertyChangedCallback::PropertyChangedCallback ( std::nullptr_t  )

Default constructor.

◆ PropertyChangedCallback() [3/4]

template<std::invocable Callback>
requires (!std::invocable<Callback, Action, std::size_t>)
xentara::workbench::bindings::PropertyChangedCallback::PropertyChangedCallback ( Callback &&  callback)

Constructor for a simple callback.

◆ PropertyChangedCallback() [4/4]

template<std::invocable< Action, std::size_t > Callback>
xentara::workbench::bindings::PropertyChangedCallback::PropertyChangedCallback ( Callback &&  callback)

Constructor for a full callback.

Member Function Documentation

◆ operator bool()

xentara::workbench::bindings::PropertyChangedCallback::operator bool ( ) const
explicitnoexcept

Check whether a callback has been set.

◆ operator()() [1/2]

auto xentara::workbench::bindings::PropertyChangedCallback::operator() ( ) const -> void

Calls the callback signalling a value change.

Exceptions
std::bad_function_callNo callback has been set
Rethrowsany exception thrown by the callback

◆ operator()() [2/2]

auto xentara::workbench::bindings::PropertyChangedCallback::operator() ( Action  action,
std::size_t  index = {} 
) const -> void

Calls the callback signalling an arbitrary change.

Exceptions
std::bad_function_callNo callback has been set
Rethrowsany exception thrown by the callback