SILICON
Loading...
Searching...
No Matches
CallbackRegistry< Args > Class Template Reference

#include <callbackRegistry.hpp>

Public Types

using Callback = std::function<void(Args...)>

Public Member Functions

std::uint64_t add (Callback callback)
void remove (const std::uint64_t id)
void notify (Args... args) const noexcept

Static Private Member Functions

static void reportFailure (const std::string_view message) noexcept

Private Attributes

std::unordered_map< std::uint64_t, Callback > callbacks
std::uint64_t nextId = 0

Detailed Description

template<typename... Args>
class SILICON::core::CallbackRegistry< Args >

Definition at line 31 of file callbackRegistry.hpp.

Member Typedef Documentation

◆ Callback

template<typename... Args>
using Callback = std::function<void(Args...)>

Definition at line 33 of file callbackRegistry.hpp.

Member Function Documentation

◆ add()

template<typename... Args>
std::uint64_t add ( Callback callback)
inlinenodiscard

Definition at line 35 of file callbackRegistry.hpp.

◆ notify()

template<typename... Args>
void notify ( Args... args) const
inlinenoexcept

Definition at line 44 of file callbackRegistry.hpp.

◆ remove()

template<typename... Args>
void remove ( const std::uint64_t id)
inline

Definition at line 42 of file callbackRegistry.hpp.

◆ reportFailure()

template<typename... Args>
void reportFailure ( const std::string_view message)
inlinestaticprivatenoexcept

Definition at line 70 of file callbackRegistry.hpp.

Member Data Documentation

◆ callbacks

template<typename... Args>
std::unordered_map<std::uint64_t, Callback> callbacks
private

Definition at line 79 of file callbackRegistry.hpp.

◆ nextId

template<typename... Args>
std::uint64_t nextId = 0
private

Definition at line 80 of file callbackRegistry.hpp.


The documentation for this class was generated from the following file: