1 #ifndef _SIGX_TUNNEL_CONTEXT_H_
2 #define _SIGX_TUNNEL_CONTEXT_H_
24 #include <sigc++/type_traits.h>
25 #include <sigc++/adaptors/bound_argument.h>
44 template<sync_type I_sync,
typename T_return,
typename T_unary_functor>
50 template<sync_type I_sync,
typename T_return,
typename T_adaptor>
66 template<
typename T_return,
typename T_unary_functor>
74 m_boundmessage(_A_func)
89 const std::auto_ptr<this_type> autodelete_this(
this);
96 T_unary_functor m_boundmessage;
111 template<
typename T_return,
typename T_unary_functor>
119 m_boundmessage(_A_func),
128 const std::auto_ptr<this_type> autodelete_this(
this);
130 Glib::Mutex::Lock lock(m_mutex);
136 m_cond.wait(m_mutex);
138 return m_bound_result.invoke();
143 Glib::Mutex::Lock lock(m_mutex);
145 m_bound_result = m_boundmessage();
152 T_unary_functor m_boundmessage;
153 sigc::bound_argument<typename sigc::type_trait<T_return>::type> m_bound_result;
168 template<
typename T_unary_functor>
176 m_boundmessage(_A_func)
184 const std::auto_ptr<this_type> autodelete_this(
this);
191 Glib::Mutex::Lock lock(m_mutex);
199 T_unary_functor m_boundmessage;
An asynchronous tunnel message.
Definition: tunnel_context.h:67
the base class for all tunnel_context classes.
Definition: tunnel_context_base.h:42
result_type tunnel()
dispatches the tunnel_context (itself) over the referenced dispatcher.
Definition: tunnel_context.h:80
tunnel_context< I_sync, T_return, T_adaptor > * make_new_tunnel_context(const shared_dispatchable &_A_disp, const tunnel_validity_tracker &_A_validity_tracker, const T_adaptor &_A_func)
Exists solely to make the compiler deduce the meta argument T_adaptor.
Definition: tunnel_context.h:51
Interface for tracking the validity of a tunnel.
Definition: tunnel_validity_tracker.h:34
T_return tunnel()
dispatches the tunnel_context (itself) over the referenced dispatcher.
Definition: tunnel_context.h:126
void invoke()
invokes the intended functor at the other end of the tunnel
Definition: tunnel_context.h:189
T_return result_type
Definition: tunnel_context.h:115
tunnel_context(const shared_dispatchable &_A_disp, const tunnel_validity_tracker &_A_validity_tracker, typename sigc::type_trait< T_unary_functor >::take _A_func)
Definition: tunnel_context.h:117
tunnel_context< SYNC, void, T_unary_functor > this_type
Definition: tunnel_context.h:171
tunnel_context(const shared_dispatchable &_A_disp, const tunnel_validity_tracker &_A_validity_tracker, typename sigc::type_trait< T_unary_functor >::take _A_func)
Definition: tunnel_context.h:174
void invoke()
invokes the intended functor at the other end of the tunnel
Definition: tunnel_context.h:86
Represents a tunnel message.
Definition: tunnel_context.h:45
Specialities for synchronous tunnel context.
Definition: tunnel_context_base.h:73
void tunnel()
dispatches the tunnel_context (itself) over the referenced dispatcher.
Definition: tunnel_context.h:182
void result_type
Definition: tunnel_context.h:172
void invoke()
invokes the intended functor at the other end of the tunnel
Definition: tunnel_context.h:141
tunnel_context< SYNC, T_return, T_unary_functor > this_type
Definition: tunnel_context.h:114
A synchronous tunnel message.
Definition: tunnel_context.h:112
void dispatch_me()
sends the tunnel context over the dispatcher.
Definition: tunnel_context_base.cpp:59
T_return result_type
Definition: tunnel_context.h:70
void dispatch_me()
sends the tunnel context over the dispatcher.
Definition: tunnel_context_base.cpp:43
a synchronous tunnel with return type `void".
Definition: tunnel_context.h:169
tunnel_context< ASYNC, T_return, T_unary_functor > this_type
Definition: tunnel_context.h:69
thread safe dispatcher reference that can be passed around.
Definition: shared_dispatchable.h:50
tunnel_context(const shared_dispatchable &_A_disp, const tunnel_validity_tracker &_A_validity_tracker, typename sigc::type_trait< T_unary_functor >::take _A_func)
Definition: tunnel_context.h:72