122 template <
typename Callback>
123 void call (Callback&& callback)
125 typename ArrayType::ScopedLockType lock (listeners.
getLock());
128 callback (*
iter.getListener());
134 template <
typename Callback>
137 typename ArrayType::ScopedLockType lock (listeners.
getLock());
141 auto*
l =
iter.getListener();
151 template <
typename Callback,
typename BailOutCheckerType>
154 typename ArrayType::ScopedLockType lock (listeners.
getLock());
157 callback (*
iter.getListener());
164 template <
typename Callback,
typename BailOutCheckerType>
169 typename ArrayType::ScopedLockType lock (listeners.
getLock());
173 auto*
l =
iter.getListener();
186 bool shouldBailOut()
const noexcept {
return false; }
194 template <
class BailOutCheckerType,
class ListType>
223 typename ListType::ListenerType* getListener()
const noexcept
233 JUCE_DECLARE_NON_COPYABLE (
Iterator)
245 void callExcluding (ListenerClass* listenerToExclude,
void (ListenerClass::*callbackFunction) ())
247 callExcluding (listenerToExclude, [=] (ListenerClass& l) { (l.*callbackFunction)(); });
250 template <
class BailOutCheckerType>
251 void callChecked (
const BailOutCheckerType& bailOutChecker,
void (ListenerClass::*callbackFunction) ())
253 callChecked (bailOutChecker, [=] (ListenerClass& l) { (l.*callbackFunction)(); });
256 template <
class BailOutCheckerType>
258 const BailOutCheckerType& bailOutChecker,
259 void (ListenerClass::*callbackFunction) ())
261 callCheckedExcluding (listenerToExclude, bailOutChecker, [=] (ListenerClass& l) { (l.*callbackFunction)(); });
264 template <
typename... MethodArgs,
typename... Args>
265 void call (
void (ListenerClass::*callbackFunction) (MethodArgs...), Args&&... args)
267 typename ArrayType::ScopedLockType lock (listeners.
getLock());
269 for (Iterator<DummyBailOutChecker, ThisType> iter (*
this); iter.next();)
270 (iter.getListener()->*callbackFunction) (
static_cast<typename TypeHelpers::ParameterType<Args>::type
> (args)...);
273 template <
typename... MethodArgs,
typename... Args>
275 void (ListenerClass::*callbackFunction) (MethodArgs...),
278 typename ArrayType::ScopedLockType lock (listeners.
getLock());
280 for (Iterator<DummyBailOutChecker, ThisType> iter (*
this); iter.next();)
281 if (iter.getListener() != listenerToExclude)
282 (iter.getListener()->*callbackFunction) (
static_cast<typename TypeHelpers::ParameterType<Args>::type
> (args)...);
285 template <
typename BailOutCheckerType,
typename... MethodArgs,
typename... Args>
286 void callChecked (
const BailOutCheckerType& bailOutChecker,
287 void (ListenerClass::*callbackFunction) (MethodArgs...),
290 typename ArrayType::ScopedLockType lock (listeners.
getLock());
292 for (Iterator<BailOutCheckerType, ThisType> iter (*
this); iter.next (bailOutChecker);)
293 (iter.getListener()->*callbackFunction) (
static_cast<typename TypeHelpers::ParameterType<Args>::type
> (args)...);
296 template <
typename BailOutCheckerType,
typename... MethodArgs,
typename... Args>
298 const BailOutCheckerType& bailOutChecker,
299 void (ListenerClass::*callbackFunction) (MethodArgs...),
302 typename ArrayType::ScopedLockType lock (listeners.
getLock());
304 for (Iterator<BailOutCheckerType, ThisType> iter (*
this); iter.next (bailOutChecker);)
305 if (iter.getListener() != listenerToExclude)
306 (iter.getListener()->*callbackFunction) (
static_cast<typename TypeHelpers::ParameterType<Args>::type
> (args)...);
void callCheckedExcluding(ListenerClass *listenerToExclude, const BailOutCheckerType &bailOutChecker, Callback &&callback)
Calls a member function, with 1 parameter, on all but the specified listener in the list with a bail-...