32#ifndef ASYNC_THREAD_SIGC_SIGNAL_INCLUDED
33#define ASYNC_THREAD_SIGC_SIGNAL_INCLUDED
42#include <sigc++/sigc++.h>
139template <
typename T_ret,
typename... Args>
174 std::lock_guard<Async::Mutex> lk(m_mu);
190 return m_sig.connect(slt);
203 template <
typename... T>
206 return handleSignal(std::forward<T>(args)...);
221 template <
typename... T>
224 return handleReverseSignal(std::forward<T>(args)...);
237 template <
typename... T>
240 return handleSignal(std::forward<T>(args)...);
249 return sigc::mem_fun(*
this, &ThreadSigCSignal::handleSignal<Args...>);
258 return m_sig.slots();
267 return m_sig.slots();
271 sigc::signal<T_ret, Args...> m_sig;
276 template <
typename... T>
281 std::lock_guard<Async::Mutex> lk(m_mu);
282 return m_sig.emit(std::forward<T>(args)...);
286 m_runner(&signal_type::emit, &m_sig, std::forward<T>(args)...);
291 template <
typename... T>
296 std::lock_guard<Async::Mutex> lk(m_mu);
297 return m_sig.emit_reverse(std::forward<T>(args)...);
301 m_runner(&signal_type::emit_reverse, &m_sig, std::forward<T>(args)...);
The core class for writing asyncronous applications.
A mutex for synchronizing threads with the main Async thread.
Run tasks from the Async main thread.
Synchronize execution from a thread with the main Async thread.
Run tasks from the Async main thread with automatic cleanup.
void cancel(void)
Cancel all queued tasks for this object.
A threadsafe SigC signal.
result_type emit_reverse(T &&... args)
Queue the emission of this signal in reverse order.
ThreadSigCSignal(Mode mode=NON_SYNCHRONOUS)
Constructor.
sigc::signal< T_ret, Args... > signal_type
signal_type::iterator iterator
ThreadSigCSignal & operator=(const ThreadSigCSignal &)=delete
The assignment operator is deleted.
~ThreadSigCSignal(void)
Destructor.
ThreadSigCSignal(const ThreadSigCSignal &)=delete
The copy constructor is deleted.
result_type operator()(T &&... args)
Queue the emission of this signal.
sigc::slot< T_ret, Args... > slot_type
const slot_list_type slots(void) const
Return a list of the connected slots.
signal_type::const_iterator const_iterator
sigc::slot_list< slot_type > slot_list_type
result_type emit(T &&... args)
Queue the emission of this signal.
slot_type make_slot(void)
Return a slot that emits this signal.
slot_list_type slots(void)
Return a list of the connected slots.
iterator connect(const slot_type &slt)
Connect this signal to the given slot.
Namespace for the asynchronous programming classes.