|
template<typename T_threadpriv > |
| signal_f (const shared_dispatchable &_A_disp, Glib::Private< T_threadpriv > &_A_priv, signal_type T_threadpriv::*_A_sig) |
| Constructs a signal functor from a thread private object's member signal of type T_signal. More...
|
|
template<typename T_dispatchable > |
| signal_f (T_dispatchable &_A_obj, signal_type T_dispatchable::*_A_sig) |
| Constructs a signal functor from a dispatchable's member signal of type T_signal. More...
|
|
template<typename T_obj > |
| signal_f (const shared_dispatchable &_A_disp, T_obj &_A_obj, signal_type T_obj::*_A_sig) |
| Constructs a signal functor from an object's member signal of type T_signal. More...
|
|
template<typename T_obj > |
| signal_f (const shared_dispatchable &_A_disp, sigc::const_reference_wrapper< T_obj * > _A_obj, signal_type T_obj::*_A_sig) |
| Constructs a signal functor from an object's member signal of type T_signal. Object instance is late bound. More...
|
|
template<typename T_obj > |
| signal_f (const shared_dispatchable &_A_disp, sigc::reference_wrapper< T_obj * > _A_obj, signal_type T_obj::*_A_sig) |
|
template<typename T_obj , typename T_functor > |
| signal_f (const shared_dispatchable &_A_disp, sigc::const_reference_wrapper< T_obj * > _A_obj, const T_functor &_A_sig_func) |
| Constructs a signal functor from a member functor returning a signal of type T_signal and a member functor's bound object. Object instance is late bound. More...
|
|
template<typename T_obj , typename T_functor > |
| signal_f (const shared_dispatchable &_A_disp, sigc::reference_wrapper< T_obj * > _A_obj, const T_functor &_A_sig_func) |
|
template<typename T_functor > |
| signal_f (const shared_dispatchable &_A_disp, const T_functor &_A_sig_func) |
| Constructs a signal functor from any functor returning a signal of type T_signal. More...
|
|
template<typename T_functor > |
| signal_f (const T_functor &_A_sig_func) |
| Constructs a signal functor from a dispatchable functor (i.e. a functor on a dispatchable's method) returning a signal of type T_signal. More...
|
|
signal_wrapper< signal_type > | operator() () const |
|
template<typename T_signal>
class sigx::signal_f< T_signal >
Functor returning a sigx::signal_wrapper as a threadsafe signal wrapper.
A signal functor is used to expose a thread's signals and replaces a traditional access function. It acts as a middle tier between two threads, creating a sigx::signal_wrapper to a signal existing in the server thread's context, handing it over to the calling thread.
A signal functor can be created from different signal sources:
- a signal living in a thread private
- a signal from an object's member (also late bound object instances)
- a signal returned by an object's member function (also late bound object instances)
- a signal returned by a functor
Here are some examples for signal sources: From a thread private: Class MyThread has a signal "did something" in a thread private data. The class exposes this signal through a threadsafe signal wrapper.
{
protected:
typedef sigc::signal<void> signal_did_something_type;
public:
MyThread();
private:
struct ThreadData
{
signal_did_something_type m_sigDidSomething;
};
Glib::Private<ThreadData> m_threadpriv;
};
MyThread::MyThread():
sigx::glib_threadable(),
signal_did_something(this, m_threadpriv, &ThreadData::m_sigDidSomething)
{}
From an object's member function, object instance is late bound: There is a window object that exposes a button's "clicked" signal through a threadsafe signal wrapper.
{
public:
TheGUI();
public:
private:
Gtk::Button* m_btn;
};
TheGUI::TheGUI():
Gtk::Window(),
sigx::glib_auto_dispatchable(),
signal_button_clicked(this, sigc::
ref(m_btn), &Gtk::Button::signal_clicked),
m_btn()
{
m_btn = manage(new Gtk::Button("notify thread"));
add(*m_btn);
show_all_children();
}
- Examples:
- ipresolver/main.cpp.