14 #ifndef ZYPP_BASE_EVENTDISPATCHER_DEFINED
15 #define ZYPP_BASE_EVENTDISPATCHER_DEFINED
18 #include <zypp/zyppng/base/Signals>
19 #include <zypp/zyppng/base/Base>
20 #include <zypp/zyppng/base/AbstractEventSource>
28 class EventDispatcher;
31 class EventDispatcherPrivate;
86 virtual
bool run_once();
103 static
void invokeOnIdle ( T &&callback )
105 auto ev = instance();
107 ev->invokeOnIdleImpl( std::forward<T>(callback) );
117 template<
typename T >
119 auto ev = instance();
121 ev->unrefLaterImpl( std::static_pointer_cast<void>( std::forward<T>(ptr) ) );
127 ulong runningTimers()
const;
132 static std::shared_ptr<EventDispatcher> instance();
145 void unrefLaterImpl ( std::shared_ptr<void> &&ptr );
150 void invokeOnIdleImpl ( IdleFunction &&callback );
171 virtual void registerTimer (
Timer *timer );
176 virtual void removeTimer (
Timer *timer );