14 #ifndef ZYPP_BASE_EVENTDISPATCHER_DEFINED 15 #define ZYPP_BASE_EVENTDISPATCHER_DEFINED 18 #include <zypp-core/zyppng/base/Signals> 19 #include <zypp-core/zyppng/base/Base> 20 #include <zypp-core/zyppng/base/AbstractEventSource> 31 class EventDispatcherPrivate;
60 virtual
bool run_once();
67 static
void invokeOnIdle ( T &&callback )
71 ev->invokeOnIdleImpl( std::forward<T>(callback) );
84 template<
typename T >
88 ev->unrefLaterImpl( std::static_pointer_cast<void>( std::forward<T>(ptr) ) );
98 void clearUnrefLaterList ();
103 ulong runningTimers()
const;
108 static std::shared_ptr<EventDispatcher> instance();
115 static void setThreadDispatcher (
const std::shared_ptr<EventDispatcher> &disp );
121 void *nativeDispatcherHandle ()
const;
129 static bool waitForFdEvent (
const int fd,
int events,
int &revents,
int &timeout );
137 void trackChildProcess (
int pid, std::function<
void(
int,
int)> callback );
144 bool untrackChildProcess (
int pid );
150 UnixSignalSourceRef unixSignalSource ();
163 void unrefLaterImpl ( std::shared_ptr<void> &&ptr );
189 virtual void registerTimer (
Timer &timer );
194 virtual void removeTimer (
Timer &timer );
static void unrefLater(T &&ptr)
std::weak_ptr< Base > WeakPtr
std::function< bool()> IdleFunction
std::function< void(int, int)> WaitPidCallback
ZYPP_FWD_DECL_TYPE_WITH_REFS(Context)
The Timer class provides repetitive and single-shot timers.
#define ZYPP_DECLARE_PRIVATE(Class)
#define LIBZYPP_NG_EXPORT
std::shared_ptr< Base > Ptr