summaryrefslogtreecommitdiff
path: root/src/CommonAPI/MainLoopContext.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/MainLoopContext.h')
-rw-r--r--src/CommonAPI/MainLoopContext.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/CommonAPI/MainLoopContext.h b/src/CommonAPI/MainLoopContext.h
index 0d87442..c651532 100644
--- a/src/CommonAPI/MainLoopContext.h
+++ b/src/CommonAPI/MainLoopContext.h
@@ -314,6 +314,16 @@ class MainLoopContext {
}
}
+ /**
+ * \brief Will return true if at least one subscribe for DispatchSources or Watches has been called.
+ *
+ * This function will be used to prevent creation of a factory if a mainloop context is given, but
+ * no listeners have been registered. This is done in order to ensure correct use of the mainloop context.
+ */
+ inline bool isInitialized() {
+ return dispatchSourceListeners_.size() > 0 || watchListeners_.size() > 0;
+ }
+
private:
DispatchSourceListenerList dispatchSourceListeners_;
WatchListenerList watchListeners_;