Skip to content

Class Ase::CallbackList

template <class... A>

ClassList > Ase > CallbackList

Reentrant callback list with configurable arguments.

  • #include <callback.hh>

Inherits the following classes: std::enable_shared_from_this< CallbackList< A... > >

Public Types

Type Name
typedef std::function< void(const A &...)> Callback

Public Functions

Type Name
ASE_DEFINE_MAKE_SHARED (CallbackList)
size_t add (const Callback & f)
Add a callback, returns an id that can be used for deletion.
std::function< void()> add_delcb (const Callback & f)
Add a callback and return a deleter that removes the callback when invoked.
void call (const std::function< void(const Callback &, const A &...)> & wrapper, const A &... args)
Call all callbacks in the order they were added via wrapper function.
bool del (size_t id)
Delete a previously added callback via its id, returns if any was found.
bool empty () const
Check if the callback list is empty, i.e. invocation will not call any callbacks.
void operator() (const A &... args)
Call all callbacks in the order they were added.

Public Types Documentation

typedef Callback

using Ase::CallbackList< A >::Callback =  std::function<void(const A&...)>;

Public Functions Documentation

function ASE_DEFINE_MAKE_SHARED

Ase::CallbackList::ASE_DEFINE_MAKE_SHARED (
    CallbackList
) 

function add

inline size_t Ase::CallbackList::add (
    const Callback & f
) 

function add_delcb

inline std::function< void()> Ase::CallbackList::add_delcb (
    const Callback & f
) 

function call

inline void Ase::CallbackList::call (
    const std::function< void(const Callback &, const A &...)> & wrapper,
    const A &... args
) 

function del

inline bool Ase::CallbackList::del (
    size_t id
) 

function empty

inline bool Ase::CallbackList::empty () const

function operator()

inline void Ase::CallbackList::operator() (
    const A &... args
) 


The documentation for this class was generated from the following file /__w/anklang/anklang/ase/callback.hh