template<typename T>
class ossia::callback_container< T >
The callback_container class.
Contains callbacks. Classes that have network callbacks may want to derive from this and implement on_first_callback_added, on_removing_last_callback.
This allows to cleanly stop listening when there are no callbacks.
|
|
| callback_container (const callback_container &other) |
|
| callback_container (callback_container &&other) noexcept |
|
callback_container & | operator= (const callback_container &other) |
|
callback_container & | operator= (callback_container &&other) noexcept |
| iterator | add_callback (T &&callback) |
| | add_callback Add a new callback.
|
| void | remove_callback (iterator it) |
| | remove_callback Removes a callback identified by an iterator.
|
|
void | replace_callback (iterator it, T &&cb) |
| | Replaces an existing callback with another function.
|
|
void | replace_callbacks (impl &&cbs) |
|
disabled_callback | disable_callback (iterator it) |
| std::size_t | callback_count () const |
| | callback_count
|
| bool | callbacks_empty () const |
| | callbacks_empty
|
| template<typename... Args> |
| void | send (Args &&... args) |
| | send Trigger all callbacks
|
|
void | callbacks_clear () |
| | clear Clears callbacks.
|
|
impl m_callbacks | TS_GUARDED_BY (m_mutx) |