8 #ifndef _FCITX_UTILS_EVENTDISPATCHER_H_ 9 #define _FCITX_UTILS_EVENTDISPATCHER_H_ 14 #include <fcitx-utils/fcitxutils_export.h> 15 #include <fcitx-utils/macros.h> 21 class EventDispatcherPrivate;
58 void schedule(std::function<
void()> functor);
74 std::function<
void()> functor) {
80 [context = std::move(context), functor = std::move(functor)]() {
95 const std::unique_ptr<EventDispatcherPrivate> d_ptr;
100 #endif // _FCITX_UTILS_EVENTDISPATCHER_H_ Utility class provides a weak reference to the object.
Utitliy classes for statically tracking the life of a object.
bool isValid() const
Check if the reference is still valid.
A thread safe class to post event to a certain EventLoop.
void scheduleWithContext(TrackableObjectReference< T > context, std::function< void()> functor)
A helper function that allows to only invoke certain function if the reference is still valid...