31 #ifndef PTLIB_NOTIFIER_EXT_H
32 #define PTLIB_NOTIFIER_EXT_H
86 template <
typename ParamType>
95 ,
m_targetID(notifierTarget->m_validatedNotifierId)
111 #define PDECLARE_VALIDATED_NOTIFIER2(notifier, notifiee, func, ParamType) \
112 PDECLARE_NOTIFIER_COMMON(notifier, notifiee, func, ParamType, PValidatedNotifierFunction<ParamType>)
115 #define PDECLARE_VALIDATED_NOTIFIER(notifier, notifiee, func) \
116 PDECLARE_VALIDATED_NOTIFIER2(notifier, notifiee, func, P_INT_PTR)
124 virtual void Call() = 0;
188 template <
typename ParamType>
197 ,
m_targetID(notifierTarget->m_asyncNotifierId)
203 template <
class Target>
207 const Target & m_target;
214 , m_notifier(notifier)
220 m_target.AsyncCall(m_notifier, m_extra);
229 #define PDECLARE_ASYNC_NOTIFIER2(notifier, notifiee, func, ParamType) \
230 PDECLARE_NOTIFIER_COMMON1(notifier, notifiee, func, ParamType, PAsyncNotifierFunction<ParamType>) \
231 { PAsyncNotifierCallback::Queue(m_targetID, new TypedCallback<func##_PNotifier>(*this, note, extra)); } \
232 void AsyncCall(PObject & note, ParamType extra) const \
233 PDECLARE_NOTIFIER_COMMON2(notifier, notifiee, func, ParamType, PAsyncNotifierFunction<ParamType>) \
236 #define PDECLARE_ASYNC_NOTIFIER(notifier, notifiee, func) \
237 PDECLARE_ASYNC_NOTIFIER2(notifier, notifiee, func, P_INT_PTR)
244 template <
typename ParamType>
250 typedef std::list<Notifier> List;
255 PINDEX
GetSize()
const {
return this->m_list.size(); }
260 this->m_list.push_back(handler);
266 this->m_list.remove(handler);
269 class IsObj :
public std::unary_function<PObject, bool>
280 this->m_list.remove_if(IsObj(obj));
286 if (this->m_list.empty())
288 for (
typename List::iterator it = this->m_list.begin(); it != this->m_list.end() ; ++it)
297 #endif // PTLIB_NOTIFIER_EXT_H