74 #ifndef __UT_Notifier_h__
75 #define __UT_Notifier_h__
101 template <typename EVENT_TYPE>
124 virtual void addObserver( UT_NotifierList &list, Callback &callback);
135 void removeObserver( UT_NotifierList &list )
override;
147 virtual bool hasObserver(
const UT_NotifierList &list )
const;
159 virtual void notifyObservers( EVENT_TYPE
event );
164 int64 mem = inclusive ?
sizeof(*this) : 0;
165 mem += myObservers.getMemoryUsage(
false);
166 for (
exint i = 0; i < myObservers.entries(); ++i)
167 mem += myObservers(i).second.getMemoryUsage(
false);
176 bool hasObservers()
const;
188 int getObserverIndex(
const UT_NotifierList &list )
const;
193 void removeAllObservers();
200 void pruneObservers();
204 typedef std::pair< UT_NotifierList*, Callback> ObserverPair;
213 bool myNotifyingFlag;
214 bool myPendingRemovalFlag;
220 #endif // __UT_Notifier_h__
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
UT_Functor1< void, EVENT_TYPE > Callback
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
int64 getMemoryUsage(bool inclusive) const
Returns the amount of memory owned by this UT_NotifierImpl.