|
| template<callable_c< return_t, args_t... > callable_t> |
| delegate_token_type | add_token (callable_t callable, priority ePriority=priority::normal) noexcept |
| | Add a callable using a token with manual unsubscribing. More...
|
| |
| template<class object_t > |
| delegate_token_type | add_token (object_t &object, return_t(object_t::*pMethod)(args_t...), priority ePriority=priority::normal) noexcept |
| | Add a callable using a token with manual unsubscribing. More...
|
| |
| template<callable_c< return_t, args_t... > callable_t> |
| destruction_callback | add_destruction_callback (callable_t callable, priority ePriority=priority::normal) noexcept |
| | Add a callable that will be removed from the delegate when its destruction callback is destroyed. More...
|
| |
| template<class object_t > |
| destruction_callback | add_destruction_callback (object_t &object, return_t(object_t::*pMethod)(args_t...), priority ePriority=priority::normal) noexcept |
| | Add a callable that will be removed from the delegate when its destruction callback is destroyed. More...
|
| |
| template<class object_t , callable_c< return_t, args_t... > callable_t> |
| delegate_token_type | add_weak (std::weak_ptr< object_t > pWeakObject, callable_t callable, priority ePriority=priority::normal) noexcept |
| | Add a callable that will be executed only if the appropriate weak object is valid. More...
|
| |
| template<class object_t > |
| delegate_token_type | add_weak (std::weak_ptr< object_t > pWeakObject, return_t(object_t::*pMethod)(args_t...), priority ePriority=priority::normal) noexcept |
| | Add a callable that will be executed only if the appropriate weak object is valid. More...
|
| |
| bool | remove (delegate_token_type token) noexcept |
| | Remove a callable using its token. More...
|
| |
|
void | clear () noexcept |
| | Clear all the callables in this delegate.
|
| |
|
void | clear_dead () noexcept |
| | Remove weak subscriptions whose tracked objects have expired, without invoking callbacks.
|
| |
| size_t | size () const noexcept |
| | Get the number of functions bound to this delegate. More...
|
| |
| bool | is_singlecast () const noexcept |
| | Check whether exactly one callable is bound to this delegate. More...
|
| |
| bool | empty () const noexcept |
| | Check if this delegate is empty. More...
|
| |
template<class derived_t, class return_t, class... args_t>
class qx::details::base_delegate< derived_t, return_t, args_t >
Base delegate type.
- Template Parameters
-
| derived_t | - CRTP derived class type |
| return_t | - the exact type that all the passed callables and execute() should return |
| args_t | - the exact type that all the passed callables and execute() should take |
- Author
- Khrapov
- Date
- 17.02.2026
Definition at line 83 of file delegate.h.
template<class derived_t , class return_t , class... args_t>
template<callable_c< return_t, args_t... > callable_t>
Add a callable that will be removed from the delegate when its destruction callback is destroyed.
- Template Parameters
-
| callable_t | - any callable type: lambda, function, static method pointer, ect |
- Parameters
-
| callable | - callable object |
| ePriority | - callable priority. Callables will be called in order of priority, from highest to lowest, and in the order they were added. |
- Returns
- - an object that removes this callable from the delegate on its destruction
Definition at line 113 of file delegate.inl.
template<class derived_t , class return_t , class... args_t>
template<class object_t >
Add a callable that will be removed from the delegate when its destruction callback is destroyed.
- Template Parameters
-
- Parameters
-
| object | - object reference |
| pMethod | - object's method pointer |
| ePriority | - callable priority. Callables will be called in order of priority, from highest to lowest, and in the order they were added. |
- Returns
- - an object that removes this callable from the delegate on its destruction
Definition at line 123 of file delegate.inl.
template<class derived_t , class return_t , class... args_t>
template<callable_c< return_t, args_t... > callable_t>
Add a callable using a token with manual unsubscribing.
- Warning
- If you capture
this in the lambda passed and the object becomes invalid, it'll crash. You must unsubscribe manually using remove() Consider using add_destruction_callback or add_weak.
- Template Parameters
-
| callable_t | - any callable type: lambda, function, static method pointer, ect |
- Parameters
-
| callable | - callable object |
| ePriority | - callable priority. Callables will be called in order of priority, from highest to lowest, and in the order they were added. |
- Returns
- - a token that can be used to remove this callable from the delegate
Definition at line 85 of file delegate.inl.
template<class derived_t , class return_t , class... args_t>
template<class object_t >
Add a callable using a token with manual unsubscribing.
- Warning
- If you capture
this in the lambda passed and the object becomes invalid, it'll crash. You must unsubscribe manually using remove() Consider using add_destruction_callback or add_weak.
- Template Parameters
-
- Parameters
-
| object | - object reference |
| pMethod | - object's method pointer |
| ePriority | - callable priority. Callables will be called in order of priority, from highest to lowest, and in the order they were added. |
- Returns
- - a token that can be used to remove this callable from the delegate
Definition at line 97 of file delegate.inl.
template<class derived_t , class return_t , class... args_t>
template<class object_t , callable_c< return_t, args_t... > callable_t>
Add a callable that will be executed only if the appropriate weak object is valid.
- Template Parameters
-
| object_t | - object type |
| callable_t | - any callable type: lambda, function, static method pointer, ect |
- Parameters
-
| pWeakObject | - an object to track |
| callable | - callable object |
| ePriority | - callable priority. Callables will be called in order of priority, from highest to lowest, and in the order they were added. |
- Returns
- - a token that can be used to remove this callable from the delegate
Definition at line 139 of file delegate.inl.
template<class derived_t , class return_t , class... args_t>
template<class object_t >
Add a callable that will be executed only if the appropriate weak object is valid.
- Template Parameters
-
- Parameters
-
| pWeakObject | - an object to track and to apply the method to |
| pMethod | - object's method pointer |
| ePriority | - callable priority. Callables will be called in order of priority, from highest to lowest, and in the order they were added. |
- Returns
- - a token that can be used to remove this callable from the delegate
Definition at line 158 of file delegate.inl.