JUCE  v5.1.1-3-g1a0b28c73
JUCE API
ListenerList< ListenerClass, ArrayType > Class Template Reference

Holds a set of objects and can invoke a member function callback on each object in the set with a single call. More...

#include <juce_ListenerList.h>

Inheritance diagram for ListenerList< ListenerClass, ArrayType >:
Collaboration diagram for ListenerList< ListenerClass, ArrayType >:

Classes

struct  DummyBailOutChecker
 A dummy bail-out checker that always returns false. More...
 
class  Iterator
 Iterates the listeners in a ListenerList. More...
 

Public Types

typedef ListenerClass ListenerType
 
typedef ListenerList< ListenerClass, ArrayType > ThisType
 

Public Member Functions

 ListenerList ()
 Creates an empty list. More...
 
 ~ListenerList ()
 Destructor. More...
 
void add (ListenerClass *const listenerToAdd)
 Adds a listener to the list. More...
 
void call (void(ListenerClass::*callbackFunction)())
 Calls a member function on each listener in the list, with no parameters. More...
 
template<LL_TEMPLATE(1) >
void call (void(ListenerClass::*callbackFunction)(P1), LL_PARAM(1))
 Calls a member function on each listener in the list, with 1 parameter. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void call (void(ListenerClass::*callbackFunction)(P1, P2), LL_PARAM(1), LL_PARAM(2))
 Calls a member function on each listener in the list, with 2 parameters. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void call (void(ListenerClass::*callbackFunction)(P1, P2, P3), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
 Calls a member function on each listener in the list, with 3 parameters. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void call (void(ListenerClass::*callbackFunction)(P1, P2, P3, P4), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
 Calls a member function on each listener in the list, with 4 parameters. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void call (void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
 Calls a member function on each listener in the list, with 5 parameters. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void call (void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5, P6), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5), LL_PARAM(6))
 Calls a member function on each listener in the list, with 6 parameters. More...
 
template<class BailOutCheckerType >
void callChecked (const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)())
 Calls a member function on each listener in the list, with no parameters and a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) >
void callChecked (const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1), LL_PARAM(1))
 Calls a member function on each listener in the list, with 1 parameter and a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void callChecked (const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2), LL_PARAM(1), LL_PARAM(2))
 Calls a member function on each listener in the list, with 2 parameters and a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void callChecked (const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
 Calls a member function on each listener in the list, with 3 parameters and a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void callChecked (const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
 Calls a member function on each listener in the list, with 4 parameters and a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void callChecked (const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
 Calls a member function on each listener in the list, with 5 parameters and a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void callChecked (const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5, P6), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5), LL_PARAM(6))
 Calls a member function on each listener in the list, with 6 parameters and a bail-out-checker. More...
 
template<class BailOutCheckerType >
void callCheckedExcluding (ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)())
 Calls a member function on all but the specified listener in the list with a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) >
void callCheckedExcluding (ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1), LL_PARAM(1))
 Calls a member function, with 1 parameter, on all but the specified listener in the list with a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void callCheckedExcluding (ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2), LL_PARAM(1), LL_PARAM(2))
 Calls a member function, with 2 parameters, on all but the specified listener in the list with a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void callCheckedExcluding (ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
 Calls a member function, with 3 parameters, on all but the specified listener in the list with a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void callCheckedExcluding (ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
 Calls a member function, with 4 parameters, on all but the specified listener in the list with a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void callCheckedExcluding (ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
 Calls a member function, with 5 parameters, on all but the specified listener in the list with a bail-out-checker. More...
 
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void callCheckedExcluding (ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5, P6), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5), LL_PARAM(6))
 Calls a member function, with 5 parameters, on all but the specified listener in the list with a bail-out-checker. More...
 
void callExcluding (ListenerClass *listenerToExclude, void(ListenerClass::*callbackFunction)())
 Calls a member function, with no parameters, on all but the specified listener in the list. More...
 
template<LL_TEMPLATE(1) >
void callExcluding (ListenerClass *listenerToExclude, void(ListenerClass::*callbackFunction)(P1), LL_PARAM(1))
 Calls a member function, with 1 parameter, on all but the specified listener in the list. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void callExcluding (ListenerClass *listenerToExclude, void(ListenerClass::*callbackFunction)(P1, P2), LL_PARAM(1), LL_PARAM(2))
 Calls a member function, with 2 parameters, on all but the specified listener in the list. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void callExcluding (ListenerClass *listenerToExclude, void(ListenerClass::*callbackFunction)(P1, P2, P3), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3))
 Calls a member function, with 3 parameters, on all but the specified listener in the list. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void callExcluding (ListenerClass *listenerToExclude, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4))
 Calls a member function, with 4 parameters, on all but the specified listener in the list. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void callExcluding (ListenerClass *listenerToExclude, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5))
 Calls a member function, with 5 parameters, on all but the specified listener in the list. More...
 
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void callExcluding (ListenerClass *listenerToExclude, void(ListenerClass::*callbackFunction)(P1, P2, P3, P4, P5, P6), LL_PARAM(1), LL_PARAM(2), LL_PARAM(3), LL_PARAM(4), LL_PARAM(5), LL_PARAM(6))
 Calls a member function, with 6 parameters, on all but the specified listener in the list. More...
 
void clear ()
 Clears the list. More...
 
bool contains (ListenerClass *const listener) const noexcept
 Returns true if the specified listener has been added to the list. More...
 
const ArrayType & getListeners () const noexcept
 
bool isEmpty () const noexcept
 Returns true if any listeners are registered. More...
 
void remove (ListenerClass *const listenerToRemove)
 Removes a listener from the list. More...
 
int size () const noexcept
 Returns the number of registered listeners. More...
 

Private Attributes

ArrayType listeners
 

Detailed Description

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
class ListenerList< ListenerClass, ArrayType >

Holds a set of objects and can invoke a member function callback on each object in the set with a single call.

Use a ListenerList to manage a set of objects which need a callback, and you can invoke a member function by simply calling call() or callChecked().

E.g.

class MyListenerType
{
public:
void myCallbackMethod (int foo, bool bar);
};
listeners.add (someCallbackObjects...);
// This will invoke myCallbackMethod (1234, true) on each of the objects
// in the list...
listeners.call (&MyListenerType::myCallbackMethod, 1234, true);

If you add or remove listeners from the list during one of the callbacks - i.e. while it's in the middle of iterating the listeners, then it's guaranteed that no listeners will be mistakenly called after they've been removed, but it may mean that some of the listeners could be called more than once, or not at all, depending on the list's order.

Sometimes, there's a chance that invoking one of the callbacks might result in the list itself being deleted while it's still iterating - to survive this situation, you can use callChecked() instead of call(), passing it a local object to act as a "BailOutChecker". The BailOutChecker must implement a method of the form "bool shouldBailOut()", and the list will check this after each callback to determine whether it should abort the operation. For an example of a bail-out checker, see the Component::BailOutChecker class, which can be used to check when a Component has been deleted. See also ListenerList::DummyBailOutChecker, which is a dummy checker that always returns false.

Member Typedef Documentation

◆ ListenerType

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
typedef ListenerClass ListenerList< ListenerClass, ArrayType >::ListenerType

◆ ThisType

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
typedef ListenerList<ListenerClass, ArrayType> ListenerList< ListenerClass, ArrayType >::ThisType

Constructor & Destructor Documentation

◆ ListenerList()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
ListenerList< ListenerClass, ArrayType >::ListenerList ( )
inline

Creates an empty list.

◆ ~ListenerList()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
ListenerList< ListenerClass, ArrayType >::~ListenerList ( )
inline

Destructor.

Member Function Documentation

◆ add()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
void ListenerList< ListenerClass, ArrayType >::add ( ListenerClass *const  listenerToAdd)
inline

Adds a listener to the list.

A listener can only be added once, so if the listener is already in the list, this method has no effect.

See also
remove

◆ call() [1/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
void ListenerList< ListenerClass, ArrayType >::call ( void(ListenerClass::*)()  callbackFunction)
inline

Calls a member function on each listener in the list, with no parameters.

Referenced by AnimatedPosition< Behaviour >::setPositionAndSendChange().

◆ call() [2/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) >
void ListenerList< ListenerClass, ArrayType >::call ( void(ListenerClass::*)(P1)  callbackFunction,
LL_PARAM(1)   
)
inline

Calls a member function on each listener in the list, with 1 parameter.

◆ call() [3/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void ListenerList< ListenerClass, ArrayType >::call ( void(ListenerClass::*)(P1, P2)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)   
)
inline

Calls a member function on each listener in the list, with 2 parameters.

◆ call() [4/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void ListenerList< ListenerClass, ArrayType >::call ( void(ListenerClass::*)(P1, P2, P3)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)   
)
inline

Calls a member function on each listener in the list, with 3 parameters.

◆ call() [5/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void ListenerList< ListenerClass, ArrayType >::call ( void(ListenerClass::*)(P1, P2, P3, P4)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)   
)
inline

Calls a member function on each listener in the list, with 4 parameters.

◆ call() [6/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void ListenerList< ListenerClass, ArrayType >::call ( void(ListenerClass::*)(P1, P2, P3, P4, P5)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)   
)
inline

Calls a member function on each listener in the list, with 5 parameters.

◆ call() [7/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void ListenerList< ListenerClass, ArrayType >::call ( void(ListenerClass::*)(P1, P2, P3, P4, P5, P6)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)  ,
LL_PARAM(6)   
)
inline

Calls a member function on each listener in the list, with 6 parameters.

◆ callChecked() [1/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType >
void ListenerList< ListenerClass, ArrayType >::callChecked ( const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)()  callbackFunction 
)
inline

Calls a member function on each listener in the list, with no parameters and a bail-out-checker.

See the class description for info about writing a bail-out checker.

Referenced by ListenerList< MenuBarModel::Listener >::call().

◆ callChecked() [2/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) >
void ListenerList< ListenerClass, ArrayType >::callChecked ( const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1)  callbackFunction,
LL_PARAM(1)   
)
inline

Calls a member function on each listener in the list, with 1 parameter and a bail-out-checker.

See the class description for info about writing a bail-out checker.

◆ callChecked() [3/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void ListenerList< ListenerClass, ArrayType >::callChecked ( const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)   
)
inline

Calls a member function on each listener in the list, with 2 parameters and a bail-out-checker.

See the class description for info about writing a bail-out checker.

◆ callChecked() [4/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void ListenerList< ListenerClass, ArrayType >::callChecked ( const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)   
)
inline

Calls a member function on each listener in the list, with 3 parameters and a bail-out-checker.

See the class description for info about writing a bail-out checker.

◆ callChecked() [5/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void ListenerList< ListenerClass, ArrayType >::callChecked ( const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3, P4)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)   
)
inline

Calls a member function on each listener in the list, with 4 parameters and a bail-out-checker.

See the class description for info about writing a bail-out checker.

◆ callChecked() [6/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void ListenerList< ListenerClass, ArrayType >::callChecked ( const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3, P4, P5)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)   
)
inline

Calls a member function on each listener in the list, with 5 parameters and a bail-out-checker.

See the class description for info about writing a bail-out checker.

◆ callChecked() [7/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void ListenerList< ListenerClass, ArrayType >::callChecked ( const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3, P4, P5, P6)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)  ,
LL_PARAM(6)   
)
inline

Calls a member function on each listener in the list, with 6 parameters and a bail-out-checker.

See the class description for info about writing a bail-out checker.

◆ callCheckedExcluding() [1/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType >
void ListenerList< ListenerClass, ArrayType >::callCheckedExcluding ( ListenerClass *  listenerToExclude,
const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)()  callbackFunction 
)
inline

Calls a member function on all but the specified listener in the list with a bail-out-checker.

This can be useful if the caller is also a listener and needs to exclude itself. See the class description for info about writing a bail-out checker.

Referenced by ListenerList< MenuBarModel::Listener >::callExcluding().

◆ callCheckedExcluding() [2/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) >
void ListenerList< ListenerClass, ArrayType >::callCheckedExcluding ( ListenerClass *  listenerToExclude,
const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1)  callbackFunction,
LL_PARAM(1)   
)
inline

Calls a member function, with 1 parameter, on all but the specified listener in the list with a bail-out-checker.

This can be useful if the caller is also a listener and needs to exclude itself. See the class description for info about writing a bail-out checker.

◆ callCheckedExcluding() [3/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void ListenerList< ListenerClass, ArrayType >::callCheckedExcluding ( ListenerClass *  listenerToExclude,
const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)   
)
inline

Calls a member function, with 2 parameters, on all but the specified listener in the list with a bail-out-checker.

This can be useful if the caller is also a listener and needs to exclude itself. See the class description for info about writing a bail-out checker.

◆ callCheckedExcluding() [4/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void ListenerList< ListenerClass, ArrayType >::callCheckedExcluding ( ListenerClass *  listenerToExclude,
const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)   
)
inline

Calls a member function, with 3 parameters, on all but the specified listener in the list with a bail-out-checker.

This can be useful if the caller is also a listener and needs to exclude itself. See the class description for info about writing a bail-out checker.

◆ callCheckedExcluding() [5/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void ListenerList< ListenerClass, ArrayType >::callCheckedExcluding ( ListenerClass *  listenerToExclude,
const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3, P4)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)   
)
inline

Calls a member function, with 4 parameters, on all but the specified listener in the list with a bail-out-checker.

This can be useful if the caller is also a listener and needs to exclude itself. See the class description for info about writing a bail-out checker.

◆ callCheckedExcluding() [6/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void ListenerList< ListenerClass, ArrayType >::callCheckedExcluding ( ListenerClass *  listenerToExclude,
const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3, P4, P5)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)   
)
inline

Calls a member function, with 5 parameters, on all but the specified listener in the list with a bail-out-checker.

This can be useful if the caller is also a listener and needs to exclude itself. See the class description for info about writing a bail-out checker.

◆ callCheckedExcluding() [7/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<class BailOutCheckerType , LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void ListenerList< ListenerClass, ArrayType >::callCheckedExcluding ( ListenerClass *  listenerToExclude,
const BailOutCheckerType &  bailOutChecker,
void(ListenerClass::*)(P1, P2, P3, P4, P5, P6)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)  ,
LL_PARAM(6)   
)
inline

Calls a member function, with 5 parameters, on all but the specified listener in the list with a bail-out-checker.

This can be useful if the caller is also a listener and needs to exclude itself. See the class description for info about writing a bail-out checker.

◆ callExcluding() [1/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
void ListenerList< ListenerClass, ArrayType >::callExcluding ( ListenerClass *  listenerToExclude,
void(ListenerClass::*)()  callbackFunction 
)
inline

Calls a member function, with no parameters, on all but the specified listener in the list.

This can be useful if the caller is also a listener and needs to exclude itself.

◆ callExcluding() [2/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) >
void ListenerList< ListenerClass, ArrayType >::callExcluding ( ListenerClass *  listenerToExclude,
void(ListenerClass::*)(P1)  callbackFunction,
LL_PARAM(1)   
)
inline

Calls a member function, with 1 parameter, on all but the specified listener in the list.

This can be useful if the caller is also a listener and needs to exclude itself.

◆ callExcluding() [3/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) >
void ListenerList< ListenerClass, ArrayType >::callExcluding ( ListenerClass *  listenerToExclude,
void(ListenerClass::*)(P1, P2)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)   
)
inline

Calls a member function, with 2 parameters, on all but the specified listener in the list.

This can be useful if the caller is also a listener and needs to exclude itself.

◆ callExcluding() [4/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) >
void ListenerList< ListenerClass, ArrayType >::callExcluding ( ListenerClass *  listenerToExclude,
void(ListenerClass::*)(P1, P2, P3)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)   
)
inline

Calls a member function, with 3 parameters, on all but the specified listener in the list.

This can be useful if the caller is also a listener and needs to exclude itself.

◆ callExcluding() [5/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) >
void ListenerList< ListenerClass, ArrayType >::callExcluding ( ListenerClass *  listenerToExclude,
void(ListenerClass::*)(P1, P2, P3, P4)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)   
)
inline

Calls a member function, with 4 parameters, on all but the specified listener in the list.

This can be useful if the caller is also a listener and needs to exclude itself.

◆ callExcluding() [6/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) >
void ListenerList< ListenerClass, ArrayType >::callExcluding ( ListenerClass *  listenerToExclude,
void(ListenerClass::*)(P1, P2, P3, P4, P5)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)   
)
inline

Calls a member function, with 5 parameters, on all but the specified listener in the list.

This can be useful if the caller is also a listener and needs to exclude itself.

◆ callExcluding() [7/7]

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
template<LL_TEMPLATE(1) , LL_TEMPLATE(2) , LL_TEMPLATE(3) , LL_TEMPLATE(4) , LL_TEMPLATE(5) , LL_TEMPLATE(6) >
void ListenerList< ListenerClass, ArrayType >::callExcluding ( ListenerClass *  listenerToExclude,
void(ListenerClass::*)(P1, P2, P3, P4, P5, P6)  callbackFunction,
LL_PARAM(1)  ,
LL_PARAM(2)  ,
LL_PARAM(3)  ,
LL_PARAM(4)  ,
LL_PARAM(5)  ,
LL_PARAM(6)   
)
inline

Calls a member function, with 6 parameters, on all but the specified listener in the list.

This can be useful if the caller is also a listener and needs to exclude itself.

◆ clear()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
void ListenerList< ListenerClass, ArrayType >::clear ( )
inline

Clears the list.

◆ contains()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
bool ListenerList< ListenerClass, ArrayType >::contains ( ListenerClass *const  listener) const
inlinenoexcept

Returns true if the specified listener has been added to the list.

◆ getListeners()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
const ArrayType& ListenerList< ListenerClass, ArrayType >::getListeners ( ) const
inlinenoexcept

◆ isEmpty()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
bool ListenerList< ListenerClass, ArrayType >::isEmpty ( ) const
inlinenoexcept

Returns true if any listeners are registered.

◆ remove()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
void ListenerList< ListenerClass, ArrayType >::remove ( ListenerClass *const  listenerToRemove)
inline

Removes a listener from the list.

If the listener wasn't in the list, this has no effect.

◆ size()

template<class ListenerClass, class ArrayType = Array<ListenerClass*>>
int ListenerList< ListenerClass, ArrayType >::size ( ) const
inlinenoexcept

Returns the number of registered listeners.

Member Data Documentation

◆ listeners


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