Honeycomb  0.1
Component-Model Framework
Classes | Public Types | Public Member Functions | List of all members
honey::ListenerList Class Reference

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, SmallAllocatorObjMap
 

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 ObjMaplist () const
 Get all listeners, ordered by object instance. More...
 
template<class Signal >
const SlotListslotList () 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...
 

Detailed Description

Collection of listeners.

Listeners receive signals in the same order as the listeners are added.

Member Typedef Documentation

Constructor & Destructor Documentation

honey::ListenerList::ListenerList ( )
inline
virtual honey::ListenerList::~ListenerList ( )
inlinevirtual

Member Function Documentation

void honey::ListenerList::add ( const Listener listener)

Add a listener shared reference.

void honey::ListenerList::clear ( )

Remove all listeners.

template<class Signal , class... Args>
void honey::ListenerList::dispatch ( Args &&...  args) const
inline

Send a signal to all listeners.

const ObjMap& honey::ListenerList::list ( ) const
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.

void honey::ListenerList::setCallback ( Callback cb)
inline

Set callback to handle events from this class.

template<class Signal >
const SlotList* honey::ListenerList::slotList ( ) const
inline

Get slots that receive signal. Returns null if none found.


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