sigx++  2.0.1
Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions
sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 > Class Template Reference

A threadsafe wrapper for any sigc signal with 3 argument(s). More...

#include <signal_wrapper.h>

Inheritance diagram for sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >:
sigx::signal_wrapper_base sigx::nonheapallocatable

Public Types

typedef T_signal signal_type
 
typedef signal_wrapper
< signal_type, signal_group,
argument_count
this_type
 
typedef signal_type::slot_type slot_type
 
typedef signal_type::result_type result_type
 
typedef slot_type::arg1_type_ arg1_type_
 
typedef slot_type::arg2_type_ arg2_type_
 
typedef slot_type::arg3_type_ arg3_type_
 
typedef signal_type(* fp_sig_getter_type )(signal_source_ptr)
 

Public Member Functions

 signal_wrapper ()
 Constructs an empty signal_wrapper. More...
 
 signal_wrapper (const shared_dispatchable &_A_disp, const std::tr1::shared_ptr< signal_source_base > &_A_sigsource) throw ()
 Creates a signal_wrapper from a signal source. More...
 
template<typename T_functor >
connection_wrapper connect (const T_functor &_A_func) const
 Connects a functor, tunnels it automatically if not yet tunneled and activates validity tracking for sigc::trackableS. More...
 
template<sync_type I_sync>
result_type emit (arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3) const
 emits the signal on the other side of the tunnel. More...
 
result_type emit (arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3) const
 emits the signal asynchronously. More...
 
result_type emit_sync (arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3) const
 emits the signal synchronously. More...
 
result_type operator() (arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3) const
 
template<sync_type I_sync>
tunnel_functor< I_sync,
make_slot_functor_type > 
make_slot () const
 creates a tunnel_functor that emits the signal when invoked More...
 
tunnel_functor< ASYNC,
make_slot_functor_type > 
make_slot () const
 creates an asynchronous tunnel_functor that emits the signal when invoked More...
 
tunnel_functor< SYNC,
make_slot_functor_type > 
make_slot_sync () const
 creates a synchronous tunnel_functor that emits the signal when invoked More...
 

Static Public Attributes

static const int argument_count = 3
 
static const internal::signal_group signal_group = internal::SIGGROUP_SIGC
 

Protected Types

typedef
sigc::bound_const_mem_functor0
< signal_source_base::hook,
signal_source_base
make_slot_f1
 
typedef
sigc::retype_return_functor
< fp_sig_getter_type,
make_slot_f1
make_slot_f2
 
typedef
sigc::const_mem_functor0
< signal_source_ptr,
std::tr1::shared_ptr
< signal_source_base > > 
make_slot_f3
 
typedef sigc::bind_functor
<-1, make_slot_f3,
std::tr1::shared_ptr
< signal_source_base > > 
make_slot_f4
 
typedef sigc::compose1_functor
< make_slot_f2, make_slot_f4
make_slot_composed1_functor_type
 
typedef
sigc::const_mem_functor3
< result_type, signal_type,
arg1_type_, arg2_type_,
arg3_type_
make_slot_emit_functor_type
 
typedef sigc::compose1_functor
< make_slot_emit_functor_type,
make_slot_composed1_functor_type
make_slot_composed2_functor_type
 

Protected Member Functions

typedef SIGX_DISPATCH_WITH_FUNCTOR (make_slot_composed2_functor_type) make_slot_functor_type
 
- Protected Member Functions inherited from sigx::signal_wrapper_base
 signal_wrapper_base ()
 
 ~signal_wrapper_base () throw ()
 
 signal_wrapper_base (const shared_dispatchable &_A_disp, const std::tr1::shared_ptr< signal_source_base > &_A_sigsource) throw ()
 
std::pair< connection_wrapper,
std::tr1::shared_ptr
< sigc_connection_ptr > > 
prepare_connection (const tunnel_base &_A_tunnel) const
 Prepare a shared sigc::connection pointer and a connection_wrapper. More...
 
template<typename T_functor , typename T_functor_conn_handler >
connection_wrapper connect (const T_functor &_A_func, const T_functor_conn_handler &_A_func_conn_handler) const
 Call _A_func_conn_handler in the context of the server thread, _A_func_conn_handler resolves to typed_connection_handler<>::connect[_notify] connecting _A_func to the server thread's signal. More...
 

Additional Inherited Members

- Protected Attributes inherited from sigx::signal_wrapper_base
shared_dispatchable m_disp
 
std::tr1::shared_ptr
< signal_source_base
m_sigsource
 The source for the server thread's signal. More...
 

Detailed Description

template<typename T_signal>
class sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >

A threadsafe wrapper for any sigc signal with 3 argument(s).

Member Typedef Documentation

template<typename T_signal >
typedef slot_type::arg1_type_ sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::arg1_type_
template<typename T_signal >
typedef slot_type::arg2_type_ sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::arg2_type_
template<typename T_signal >
typedef slot_type::arg3_type_ sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::arg3_type_
template<typename T_signal >
typedef signal_type(* sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::fp_sig_getter_type)(signal_source_ptr)
template<typename T_signal >
typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_composed1_functor_type
protected
template<typename T_signal >
typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_composed2_functor_type
protected
template<typename T_signal >
typedef sigc::const_mem_functor3<result_type, signal_type, arg1_type_, arg2_type_, arg3_type_> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_emit_functor_type
protected
template<typename T_signal >
typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_f1
protected
template<typename T_signal >
typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_f2
protected
template<typename T_signal >
typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_f3
protected
template<typename T_signal >
typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_f4
protected
template<typename T_signal >
typedef signal_type::result_type sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::result_type
template<typename T_signal >
typedef T_signal sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::signal_type
template<typename T_signal >
typedef signal_type::slot_type sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::slot_type

Constructor & Destructor Documentation

template<typename T_signal >
sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::signal_wrapper ( )
inline

Constructs an empty signal_wrapper.

Exceptions
Mightthrow a std::bad_alloc exception (from dispatchable's ctor)
template<typename T_signal >
sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::signal_wrapper ( const shared_dispatchable _A_disp,
const std::tr1::shared_ptr< signal_source_base > &  _A_sigsource 
)
throw (
)
inline

Creates a signal_wrapper from a signal source.

Parameters
_A_dispThe dispatchable to operate on
_A_sigsourceA shared pointer to the server thread's signal source.

Member Function Documentation

template<typename T_signal >
template<typename T_functor >
connection_wrapper sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::connect ( const T_functor &  _A_func) const
inline

Connects a functor, tunnels it automatically if not yet tunneled and activates validity tracking for sigc::trackableS.

auto tunneling is successful only if the passed in functor is a "dispatchable" functor, i.e. a functor on a dispatchable's method or one explicitly created with "dispatch_with". You will get compiler errors if the dispatchable can't be deduced from the passed in functor.

Note
At the moment it is only possible to pass in a non-tunneled functor or a toplevel tunneled functor due to the fact that the visit_each mechanism is turned off for the tunnel functor (otherwise there would be the problem of not threadsafe access to the sigc::trackable base of the of a dispatchable object..
passed in functor must not be a slot or adapt a slot; we have to apply this restriction because slots might have bound trackables that can cause non-threadsafe access to the passed in slot which will live in the context of the server thread.
Attention
All sigc::trackableS and the original dispatchable contained in the passed functor must belong to the context of the calling thread.
Returns
sigx::connection_wrapper A threadsafe connection wrapper
Note
asynchronous

References sigx::signal_wrapper_base::connect().

template<typename T_signal >
template<sync_type I_sync>
result_type sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::emit ( arg1_type_  _A_a1,
arg2_type_  _A_a2,
arg3_type_  _A_a3 
) const
inline

emits the signal on the other side of the tunnel.

References sigx::signal_source_base::getter().

template<typename T_signal >
result_type sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::emit ( arg1_type_  _A_a1,
arg2_type_  _A_a2,
arg3_type_  _A_a3 
) const
inline

emits the signal asynchronously.

template<typename T_signal >
result_type sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::emit_sync ( arg1_type_  _A_a1,
arg2_type_  _A_a2,
arg3_type_  _A_a3 
) const
inline

emits the signal synchronously.

template<typename T_signal >
template<sync_type I_sync>
tunnel_functor<I_sync, make_slot_functor_type> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot ( ) const
inline

creates a tunnel_functor that emits the signal when invoked

References sigx::dispatch_with(), and sigx::signal_source_base::getter().

template<typename T_signal >
tunnel_functor<ASYNC, make_slot_functor_type> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot ( ) const
inline

creates an asynchronous tunnel_functor that emits the signal when invoked

template<typename T_signal >
tunnel_functor<SYNC, make_slot_functor_type> sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::make_slot_sync ( ) const
inline

creates a synchronous tunnel_functor that emits the signal when invoked

template<typename T_signal >
result_type sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::operator() ( arg1_type_  _A_a1,
arg2_type_  _A_a2,
arg3_type_  _A_a3 
) const
inline

see emit(arg1_type_, arg2_type_, arg3_type_)

template<typename T_signal >
typedef sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::SIGX_DISPATCH_WITH_FUNCTOR ( make_slot_composed2_functor_type  )
protected

Field Documentation

template<typename T_signal >
const int sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::argument_count = 3
static
template<typename T_signal >
const internal::signal_group sigx::signal_wrapper< T_signal, internal::SIGGROUP_SIGC, 3 >::signal_group = internal::SIGGROUP_SIGC
static

The documentation for this class was generated from the following file: