Go to the documentation of this file.
25 #ifndef CGU_NOTIFIER_H
26 #define CGU_NOTIFIER_H
36 #include <unordered_set>
37 #include <type_traits>
216 static bool initialised;
217 static pthread_t thread_id;
222 static std::unordered_set<Notifier*>* object_set_p;
226 static void read_pipe_cb(
bool&);
250 bool in_main_thread() noexcept {
return pthread_equal(thread_id, pthread_self());}
336 class =
typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type,
339 return connect(Callback::lambda<>(std::forward<F>(f)));
367 class =
typename std::enable_if<!std::is_convertible<typename std::remove_reference<F>::type,
370 return connect(Callback::lambda<>(std::forward<F>(f)), r);
Notifier & operator=(const Notifier &)=delete
Definition: application.h:44
bool in_main_thread() noexcept
Definition: notifier.h:250
void block(const Callback::SafeFunctor &f)
Provides thread-safe signalling between a worker thread and the main program thread.
Definition: notifier.h:214
void disconnect(const Callback::SafeFunctor &f)
void unblock(const Callback::SafeFunctor &f)
A thread-safe class to execute callbacks connected to it, with provision for automatic disconnection.
Definition: emitter.h:922
Functor class holding a Callback::CallbackArg object, with thread-safe reference count.
Definition: callback.h:1080
void operator()()
Definition: notifier.h:292
A wrapper for unix anonymous pipes.
Definition: pipes.h:150
#define CGU_GLIB_MEMORY_SLICES_FUNCS
Definition: cgu_config.h:84
Callback::SafeFunctor connect(const Callback::SafeFunctor &f)
A class used for tracking EmitterArg and SafeEmitterArg connections.
Definition: emitter.h:352
Notifier(const Notifier &)=delete
Callback::SafeFunctor connect(const Callback::SafeFunctor &f, Releaser &r)
This file provides a thread-safe signal/slot mechanism, with automatic disconnection.
Callback::SafeFunctor connect(F &&f)
Definition: notifier.h:338
A wrapper class for pthread mutexes.
Definition: mutex.h:117
Callback::SafeFunctor connect(F &&f, Releaser &r)
Definition: notifier.h:369