Honeycomb
0.1
Component-Model Framework
|
Collection of listeners. More...
#include <ListenerList.h>
Classes | |
struct | Callback |
Callback to handle events from this class. More... | |
Public Types | |
typedef list< SlotBase *, SmallAllocator< SlotBase * > > | SlotList |
typedef stdutil::unordered_multimap< const void *, Listener::ConstPtr, SmallAllocator > | ObjMap |
Public Member Functions | |
ListenerList () | |
virtual | ~ListenerList () |
void | add (const Listener &listener) |
Add a listener shared reference. More... | |
void | remove (const Listener &listener) |
Remove a listener. More... | |
void | remove (const void *obj) |
Remove all listeners with object instance. More... | |
void | remove (const void *obj, const Id &id) |
Remove all listeners with object instance and id. More... | |
void | clear () |
Remove all listeners. More... | |
const ObjMap & | list () const |
Get all listeners, ordered by object instance. More... | |
template<class Signal > | |
const SlotList * | slotList () const |
Get slots that receive signal. Returns null if none found. More... | |
template<class Signal , class... Args> | |
void | dispatch (Args &&...args) const |
Send a signal to all listeners. More... | |
void | setCallback (Callback *cb) |
Set callback to handle events from this class. More... | |
Collection of listeners.
Listeners receive signals in the same order as the listeners are added.
typedef stdutil::unordered_multimap<const void*, Listener::ConstPtr, SmallAllocator> honey::ListenerList::ObjMap |
typedef list<SlotBase*, SmallAllocator<SlotBase*> > honey::ListenerList::SlotList |
|
inline |
|
inlinevirtual |
void honey::ListenerList::add | ( | const Listener & | listener | ) |
Add a listener shared reference.
void honey::ListenerList::clear | ( | ) |
Remove all listeners.
|
inline |
Send a signal to all listeners.
|
inline |
Get all listeners, ordered by object instance.
void honey::ListenerList::remove | ( | const Listener & | listener | ) |
Remove a listener.
void honey::ListenerList::remove | ( | const void * | obj | ) |
Remove all listeners with object instance.
void honey::ListenerList::remove | ( | const void * | obj, |
const Id & | id | ||
) |
Remove all listeners with object instance and id.
|
inline |
Set callback to handle events from this class.
|
inline |
Get slots that receive signal. Returns null if none found.