sigx++  2.0.1
signal_wrapper.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /* Do not edit! -- generated file */
3 
4 
5 #ifndef _SIGXMACROS_SIGNAL_WRAPPER_H_
6 #define _SIGXMACROS_SIGNAL_WRAPPER_H_
7 
8 
9 /*
10  * Copyright 2007 Klaus Triendl
11  *
12  * This library is free software; you can redistribute it and/or
13  * modify it under the terms of the GNU Library General Public
14  * License as published by the Free Software Foundation; either
15  * version 2 of the License, or (at your option) any later version.
16  *
17  * This library is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  * Library General Public License for more details.
21  *
22  * You should have received a copy of the GNU Library General Public
23  * License along with this library; if not, write to the Free
24  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 */
26 
27 #include <tr1/memory> // std::tr1::shared_ptr, std::auto_ptr
28 #include <sigc++/sigc++.h>
29 #include <glibmm/main.h> // glibmm signals
30 #include <sigx/types.h>
31 #include <sigx/internal_types.h>
32 #include <sigx/signal_traits.h>
35 #include <sigx/tunnel_functor.h>
38 
39 
46 namespace sigx
47 {
48 
49  namespace internal
50  {
51 
54 template<typename T_signal>
56 {
57  static const int value = -1;
58  static const int tspec = -1;
59 };
60 
61 
64 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4, typename T_arg5, typename T_arg6, typename T_arg7>
65 struct count_signal_arguments<sigc::signal<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7> >
66 {
67  // forward to count_arguments and not to count_signal_arguments, otherwise
68  // we would get a false count if there is a another signal as the first
69  // argument of a signal, like: sigc::signal<void, sigc::signal<void> >
71  static const int tspec = value;
72 };
73 
76 template<typename T_return, typename T_accumulator>
77 struct count_signal_arguments<sigc::signal0<T_return, T_accumulator> >
78 {
79  static const int value = 0;
80  // template specialization for argument count needed
81  static const int tspec = value;
82 };
83 
86 template<typename T_return, typename T_arg1, typename T_accumulator>
87 struct count_signal_arguments<sigc::signal1<T_return, T_arg1, T_accumulator> >
88 {
89  static const int value = 1;
90  // template specialization for argument count needed
91  static const int tspec = value;
92 };
93 
96 template<typename T_return, typename T_arg1, typename T_arg2, typename T_accumulator>
97 struct count_signal_arguments<sigc::signal2<T_return, T_arg1, T_arg2, T_accumulator> >
98 {
99  static const int value = 2;
100  // template specialization for argument count needed
101  static const int tspec = value;
102 };
103 
106 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_accumulator>
107 struct count_signal_arguments<sigc::signal3<T_return, T_arg1, T_arg2, T_arg3, T_accumulator> >
108 {
109  static const int value = 3;
110  // template specialization for argument count needed
111  static const int tspec = value;
112 };
113 
116 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4, typename T_accumulator>
117 struct count_signal_arguments<sigc::signal4<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_accumulator> >
118 {
119  static const int value = 4;
120  // template specialization for argument count needed
121  static const int tspec = value;
122 };
123 
126 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4, typename T_arg5, typename T_accumulator>
127 struct count_signal_arguments<sigc::signal5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_accumulator> >
128 {
129  static const int value = 5;
130  // template specialization for argument count needed
131  static const int tspec = value;
132 };
133 
136 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4, typename T_arg5, typename T_arg6, typename T_accumulator>
137 struct count_signal_arguments<sigc::signal6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_accumulator> >
138 {
139  static const int value = 6;
140  // template specialization for argument count needed
141  static const int tspec = value;
142 };
143 
146 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4, typename T_arg5, typename T_arg6, typename T_arg7, typename T_accumulator>
147 struct count_signal_arguments<sigc::signal7<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6, T_arg7, T_accumulator> >
148 {
149  static const int value = 7;
150  // template specialization for argument count needed
151  static const int tspec = value;
152 };
153 
154 
157 template<typename T_return>
158 struct count_signal_arguments<Glib::SignalProxy0<T_return> >
159 {
160  static const int value = 0;
161  // template specialization for argument count not needed;
162  // this allows us to group all SignProxyN signals together in one template
163  // class
164  static const int tspec = -1;
165 };
166 
169 template<typename T_return, typename T_arg1>
170 struct count_signal_arguments<Glib::SignalProxy1<T_return, T_arg1> >
171 {
172  static const int value = 1;
173  // template specialization for argument count not needed;
174  // this allows us to group all SignProxyN signals together in one template
175  // class
176  static const int tspec = -1;
177 };
178 
181 template<typename T_return, typename T_arg1, typename T_arg2>
182 struct count_signal_arguments<Glib::SignalProxy2<T_return, T_arg1, T_arg2> >
183 {
184  static const int value = 2;
185  // template specialization for argument count not needed;
186  // this allows us to group all SignProxyN signals together in one template
187  // class
188  static const int tspec = -1;
189 };
190 
193 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3>
194 struct count_signal_arguments<Glib::SignalProxy3<T_return, T_arg1, T_arg2, T_arg3> >
195 {
196  static const int value = 3;
197  // template specialization for argument count not needed;
198  // this allows us to group all SignProxyN signals together in one template
199  // class
200  static const int tspec = -1;
201 };
202 
205 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4>
206 struct count_signal_arguments<Glib::SignalProxy4<T_return, T_arg1, T_arg2, T_arg3, T_arg4> >
207 {
208  static const int value = 4;
209  // template specialization for argument count not needed;
210  // this allows us to group all SignProxyN signals together in one template
211  // class
212  static const int tspec = -1;
213 };
214 
217 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4, typename T_arg5>
218 struct count_signal_arguments<Glib::SignalProxy5<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5> >
219 {
220  static const int value = 5;
221  // template specialization for argument count not needed;
222  // this allows us to group all SignProxyN signals together in one template
223  // class
224  static const int tspec = -1;
225 };
226 
229 template<typename T_return, typename T_arg1, typename T_arg2, typename T_arg3, typename T_arg4, typename T_arg5, typename T_arg6>
230 struct count_signal_arguments<Glib::SignalProxy6<T_return, T_arg1, T_arg2, T_arg3, T_arg4, T_arg5, T_arg6> >
231 {
232  static const int value = 6;
233  // template specialization for argument count not needed;
234  // this allows us to group all SignProxyN signals together in one template
235  // class
236  static const int tspec = -1;
237 };
238 
239 
240 
243 template<>
244 struct count_signal_arguments<Glib::SignalIdle>
245 {
246  static const int value = 0;
247  static const int tspec = value;
248 };
249 
252 template<>
253 struct count_signal_arguments<Glib::SignalTimeout>
254 {
255  static const int value = 0;
256  static const int tspec = value;
257 };
258 
261 template<>
262 struct count_signal_arguments<Glib::SignalIO>
263 {
264  static const int value = 1;
265  static const int tspec = value;
266 };
267 
270 template<>
271 struct count_signal_arguments<Glib::SignalChildWatch>
272 {
273  static const int value = 2;
274  static const int tspec = value;
275 };
276 
277 
278  } // namespace internal
279 
280 
289 template<typename T_signal, internal::signal_group I_oneof = internal::signal_type_trait<T_signal>::type, int I_arg_count = internal::count_signal_arguments<T_signal>::tspec>
291 
296 template<typename T_signal>
297 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 0>: public signal_wrapper_base
298 {
299 public:
300  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 0));
301  static const int argument_count = 0;
303  typedef T_signal signal_type;
305  typedef typename signal_type::slot_type slot_type;
306  typedef typename signal_type::result_type result_type;
307 
308  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
309 
310 protected:
311  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
312  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
313  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
314  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
315  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
316  typedef sigc::const_mem_functor0<result_type, signal_type> make_slot_emit_functor_type;
317  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
318  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
319 
320 
321 public:
326  {}
327 
333  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
334  signal_wrapper_base(_A_disp, _A_sigsource)
335  {}
336 
363  template<typename T_functor>
364  connection_wrapper connect(const T_functor& _A_func) const
365  {
367  _A_func,
369  );
370  }
371 
374  template<sync_type I_sync>
376  {
377  return open_tunnel_with<I_sync>(
378  // calls T_signal::*emit
379  sigc::compose(
380  sigc::mem_fun(&signal_type::emit),
381  // getter for the T_signal
382  sigc::compose(
383  sigc::retype_return<fp_sig_getter_type>(
384  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
385  ),
386  // this makes a copy of the shared signal source and thus
387  // shares it within the tunnel functor ensuring the lifetime
388  // of the shared signal source
389  sigc::bind(
390  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
391  m_sigsource
392  )
393  )
394  ),
395  m_disp
396  )();
397  }
398 
402  {
403  return emit<ASYNC>();
404  }
405 
409  {
410  return emit<SYNC>();
411  }
412 
416  {
417  return emit<ASYNC>();
418  }
419 
420 
423  template<sync_type I_sync>
425  {
426  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
427  return tunnel_funtor_type(
429  // calls T_signal::*emit
430  sigc::compose(
431  &signal_type::emit,
432  // getter for the T_signal
433  sigc::compose(
434  sigc::retype_return<fp_sig_getter_type>(
435  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
436  ),
437  sigc::bind(
438  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
439  m_sigsource
440  )
441  )
442  ),
443  m_disp
444  ));
445  }
446 
451  {
452  return make_slot<ASYNC>();
453  }
454 
459  {
460  return make_slot<SYNC>();
461  }
462 };
463 
468 template<typename T_signal>
469 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 1>: public signal_wrapper_base
470 {
471 public:
472  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 1));
473  static const int argument_count = 1;
475  typedef T_signal signal_type;
477  typedef typename signal_type::slot_type slot_type;
478  typedef typename signal_type::result_type result_type;
479  typedef typename slot_type::arg1_type_ arg1_type_;
480 
481  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
482 
483 protected:
484  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
485  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
486  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
487  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
488  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
489  typedef sigc::const_mem_functor1<result_type, signal_type, arg1_type_> make_slot_emit_functor_type;
490  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
491  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
492 
493 
494 public:
499  {}
500 
506  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
507  signal_wrapper_base(_A_disp, _A_sigsource)
508  {}
509 
536  template<typename T_functor>
537  connection_wrapper connect(const T_functor& _A_func) const
538  {
540  _A_func,
542  );
543  }
544 
547  template<sync_type I_sync>
549  {
550  return open_tunnel_with<I_sync>(
551  // calls T_signal::*emit
552  sigc::compose(
553  sigc::mem_fun(&signal_type::emit),
554  // getter for the T_signal
555  sigc::compose(
556  sigc::retype_return<fp_sig_getter_type>(
557  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
558  ),
559  // this makes a copy of the shared signal source and thus
560  // shares it within the tunnel functor ensuring the lifetime
561  // of the shared signal source
562  sigc::bind(
563  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
564  m_sigsource
565  )
566  )
567  ),
568  m_disp
569  )(_A_a1);
570  }
571 
575  {
576  return emit<ASYNC>(_A_a1);
577  }
578 
582  {
583  return emit<SYNC>(_A_a1);
584  }
585 
589  {
590  return emit<ASYNC>(_A_a1);
591  }
592 
593 
596  template<sync_type I_sync>
598  {
599  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
600  return tunnel_funtor_type(
602  // calls T_signal::*emit
603  sigc::compose(
604  &signal_type::emit,
605  // getter for the T_signal
606  sigc::compose(
607  sigc::retype_return<fp_sig_getter_type>(
608  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
609  ),
610  sigc::bind(
611  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
612  m_sigsource
613  )
614  )
615  ),
616  m_disp
617  ));
618  }
619 
624  {
625  return make_slot<ASYNC>();
626  }
627 
632  {
633  return make_slot<SYNC>();
634  }
635 };
636 
641 template<typename T_signal>
642 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 2>: public signal_wrapper_base
643 {
644 public:
645  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 2));
646  static const int argument_count = 2;
648  typedef T_signal signal_type;
650  typedef typename signal_type::slot_type slot_type;
651  typedef typename signal_type::result_type result_type;
652  typedef typename slot_type::arg1_type_ arg1_type_;
653  typedef typename slot_type::arg2_type_ arg2_type_;
654 
655  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
656 
657 protected:
658  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
659  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
660  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
661  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
662  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
663  typedef sigc::const_mem_functor2<result_type, signal_type, arg1_type_, arg2_type_> make_slot_emit_functor_type;
664  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
665  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
666 
667 
668 public:
673  {}
674 
680  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
681  signal_wrapper_base(_A_disp, _A_sigsource)
682  {}
683 
710  template<typename T_functor>
711  connection_wrapper connect(const T_functor& _A_func) const
712  {
714  _A_func,
716  );
717  }
718 
721  template<sync_type I_sync>
722  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2) const
723  {
724  return open_tunnel_with<I_sync>(
725  // calls T_signal::*emit
726  sigc::compose(
727  sigc::mem_fun(&signal_type::emit),
728  // getter for the T_signal
729  sigc::compose(
730  sigc::retype_return<fp_sig_getter_type>(
731  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
732  ),
733  // this makes a copy of the shared signal source and thus
734  // shares it within the tunnel functor ensuring the lifetime
735  // of the shared signal source
736  sigc::bind(
737  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
738  m_sigsource
739  )
740  )
741  ),
742  m_disp
743  )(_A_a1, _A_a2);
744  }
745 
748  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2) const
749  {
750  return emit<ASYNC>(_A_a1, _A_a2);
751  }
752 
756  {
757  return emit<SYNC>(_A_a1, _A_a2);
758  }
759 
763  {
764  return emit<ASYNC>(_A_a1, _A_a2);
765  }
766 
767 
770  template<sync_type I_sync>
772  {
773  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
774  return tunnel_funtor_type(
776  // calls T_signal::*emit
777  sigc::compose(
778  &signal_type::emit,
779  // getter for the T_signal
780  sigc::compose(
781  sigc::retype_return<fp_sig_getter_type>(
782  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
783  ),
784  sigc::bind(
785  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
786  m_sigsource
787  )
788  )
789  ),
790  m_disp
791  ));
792  }
793 
798  {
799  return make_slot<ASYNC>();
800  }
801 
806  {
807  return make_slot<SYNC>();
808  }
809 };
810 
815 template<typename T_signal>
816 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 3>: public signal_wrapper_base
817 {
818 public:
819  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 3));
820  static const int argument_count = 3;
822  typedef T_signal signal_type;
824  typedef typename signal_type::slot_type slot_type;
825  typedef typename signal_type::result_type result_type;
826  typedef typename slot_type::arg1_type_ arg1_type_;
827  typedef typename slot_type::arg2_type_ arg2_type_;
828  typedef typename slot_type::arg3_type_ arg3_type_;
829 
830  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
831 
832 protected:
833  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
834  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
835  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
836  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
837  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
838  typedef sigc::const_mem_functor3<result_type, signal_type, arg1_type_, arg2_type_, arg3_type_> make_slot_emit_functor_type;
839  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
840  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
841 
842 
843 public:
848  {}
849 
855  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
856  signal_wrapper_base(_A_disp, _A_sigsource)
857  {}
858 
885  template<typename T_functor>
886  connection_wrapper connect(const T_functor& _A_func) const
887  {
889  _A_func,
891  );
892  }
893 
896  template<sync_type I_sync>
897  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3) const
898  {
899  return open_tunnel_with<I_sync>(
900  // calls T_signal::*emit
901  sigc::compose(
902  sigc::mem_fun(&signal_type::emit),
903  // getter for the T_signal
904  sigc::compose(
905  sigc::retype_return<fp_sig_getter_type>(
906  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
907  ),
908  // this makes a copy of the shared signal source and thus
909  // shares it within the tunnel functor ensuring the lifetime
910  // of the shared signal source
911  sigc::bind(
912  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
913  m_sigsource
914  )
915  )
916  ),
917  m_disp
918  )(_A_a1, _A_a2, _A_a3);
919  }
920 
923  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3) const
924  {
925  return emit<ASYNC>(_A_a1, _A_a2, _A_a3);
926  }
927 
931  {
932  return emit<SYNC>(_A_a1, _A_a2, _A_a3);
933  }
934 
938  {
939  return emit<ASYNC>(_A_a1, _A_a2, _A_a3);
940  }
941 
942 
945  template<sync_type I_sync>
947  {
948  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
949  return tunnel_funtor_type(
951  // calls T_signal::*emit
952  sigc::compose(
953  &signal_type::emit,
954  // getter for the T_signal
955  sigc::compose(
956  sigc::retype_return<fp_sig_getter_type>(
957  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
958  ),
959  sigc::bind(
960  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
961  m_sigsource
962  )
963  )
964  ),
965  m_disp
966  ));
967  }
968 
973  {
974  return make_slot<ASYNC>();
975  }
976 
981  {
982  return make_slot<SYNC>();
983  }
984 };
985 
990 template<typename T_signal>
991 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 4>: public signal_wrapper_base
992 {
993 public:
994  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 4));
995  static const int argument_count = 4;
997  typedef T_signal signal_type;
999  typedef typename signal_type::slot_type slot_type;
1000  typedef typename signal_type::result_type result_type;
1001  typedef typename slot_type::arg1_type_ arg1_type_;
1002  typedef typename slot_type::arg2_type_ arg2_type_;
1003  typedef typename slot_type::arg3_type_ arg3_type_;
1004  typedef typename slot_type::arg4_type_ arg4_type_;
1005 
1006  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1007 
1008 protected:
1009  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
1010  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
1011  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
1012  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
1013  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
1014  typedef sigc::const_mem_functor4<result_type, signal_type, arg1_type_, arg2_type_, arg3_type_, arg4_type_> make_slot_emit_functor_type;
1015  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
1016  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
1017 
1018 
1019 public:
1024  {}
1025 
1031  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
1032  signal_wrapper_base(_A_disp, _A_sigsource)
1033  {}
1034 
1061  template<typename T_functor>
1062  connection_wrapper connect(const T_functor& _A_func) const
1063  {
1065  _A_func,
1067  );
1068  }
1069 
1072  template<sync_type I_sync>
1073  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4) const
1074  {
1075  return open_tunnel_with<I_sync>(
1076  // calls T_signal::*emit
1077  sigc::compose(
1078  sigc::mem_fun(&signal_type::emit),
1079  // getter for the T_signal
1080  sigc::compose(
1081  sigc::retype_return<fp_sig_getter_type>(
1082  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1083  ),
1084  // this makes a copy of the shared signal source and thus
1085  // shares it within the tunnel functor ensuring the lifetime
1086  // of the shared signal source
1087  sigc::bind(
1088  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1089  m_sigsource
1090  )
1091  )
1092  ),
1093  m_disp
1094  )(_A_a1, _A_a2, _A_a3, _A_a4);
1095  }
1096 
1099  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4) const
1100  {
1101  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4);
1102  }
1103 
1107  {
1108  return emit<SYNC>(_A_a1, _A_a2, _A_a3, _A_a4);
1109  }
1110 
1114  {
1115  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4);
1116  }
1117 
1118 
1121  template<sync_type I_sync>
1123  {
1124  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
1125  return tunnel_funtor_type(
1126  dispatch_with(
1127  // calls T_signal::*emit
1128  sigc::compose(
1129  &signal_type::emit,
1130  // getter for the T_signal
1131  sigc::compose(
1132  sigc::retype_return<fp_sig_getter_type>(
1133  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1134  ),
1135  sigc::bind(
1136  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1137  m_sigsource
1138  )
1139  )
1140  ),
1141  m_disp
1142  ));
1143  }
1144 
1149  {
1150  return make_slot<ASYNC>();
1151  }
1152 
1157  {
1158  return make_slot<SYNC>();
1159  }
1160 };
1161 
1166 template<typename T_signal>
1167 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 5>: public signal_wrapper_base
1168 {
1169 public:
1170  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 5));
1171  static const int argument_count = 5;
1173  typedef T_signal signal_type;
1175  typedef typename signal_type::slot_type slot_type;
1176  typedef typename signal_type::result_type result_type;
1177  typedef typename slot_type::arg1_type_ arg1_type_;
1178  typedef typename slot_type::arg2_type_ arg2_type_;
1179  typedef typename slot_type::arg3_type_ arg3_type_;
1180  typedef typename slot_type::arg4_type_ arg4_type_;
1181  typedef typename slot_type::arg5_type_ arg5_type_;
1182 
1183  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1184 
1185 protected:
1186  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
1187  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
1188  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
1189  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
1190  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
1191  typedef sigc::const_mem_functor5<result_type, signal_type, arg1_type_, arg2_type_, arg3_type_, arg4_type_, arg5_type_> make_slot_emit_functor_type;
1192  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
1193  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
1194 
1195 
1196 public:
1201  {}
1202 
1208  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
1209  signal_wrapper_base(_A_disp, _A_sigsource)
1210  {}
1211 
1238  template<typename T_functor>
1239  connection_wrapper connect(const T_functor& _A_func) const
1240  {
1242  _A_func,
1244  );
1245  }
1246 
1249  template<sync_type I_sync>
1250  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5) const
1251  {
1252  return open_tunnel_with<I_sync>(
1253  // calls T_signal::*emit
1254  sigc::compose(
1255  sigc::mem_fun(&signal_type::emit),
1256  // getter for the T_signal
1257  sigc::compose(
1258  sigc::retype_return<fp_sig_getter_type>(
1259  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1260  ),
1261  // this makes a copy of the shared signal source and thus
1262  // shares it within the tunnel functor ensuring the lifetime
1263  // of the shared signal source
1264  sigc::bind(
1265  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1266  m_sigsource
1267  )
1268  )
1269  ),
1270  m_disp
1271  )(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
1272  }
1273 
1276  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5) const
1277  {
1278  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
1279  }
1280 
1283  result_type emit_sync(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5) const
1284  {
1285  return emit<SYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
1286  }
1287 
1291  {
1292  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5);
1293  }
1294 
1295 
1298  template<sync_type I_sync>
1300  {
1301  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
1302  return tunnel_funtor_type(
1303  dispatch_with(
1304  // calls T_signal::*emit
1305  sigc::compose(
1306  &signal_type::emit,
1307  // getter for the T_signal
1308  sigc::compose(
1309  sigc::retype_return<fp_sig_getter_type>(
1310  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1311  ),
1312  sigc::bind(
1313  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1314  m_sigsource
1315  )
1316  )
1317  ),
1318  m_disp
1319  ));
1320  }
1321 
1326  {
1327  return make_slot<ASYNC>();
1328  }
1329 
1334  {
1335  return make_slot<SYNC>();
1336  }
1337 };
1338 
1343 template<typename T_signal>
1344 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 6>: public signal_wrapper_base
1345 {
1346 public:
1347  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 6));
1348  static const int argument_count = 6;
1350  typedef T_signal signal_type;
1352  typedef typename signal_type::slot_type slot_type;
1353  typedef typename signal_type::result_type result_type;
1354  typedef typename slot_type::arg1_type_ arg1_type_;
1355  typedef typename slot_type::arg2_type_ arg2_type_;
1356  typedef typename slot_type::arg3_type_ arg3_type_;
1357  typedef typename slot_type::arg4_type_ arg4_type_;
1358  typedef typename slot_type::arg5_type_ arg5_type_;
1359  typedef typename slot_type::arg6_type_ arg6_type_;
1360 
1361  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1362 
1363 protected:
1364  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
1365  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
1366  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
1367  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
1368  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
1369  typedef sigc::const_mem_functor6<result_type, signal_type, arg1_type_, arg2_type_, arg3_type_, arg4_type_, arg5_type_, arg6_type_> make_slot_emit_functor_type;
1370  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
1371  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
1372 
1373 
1374 public:
1379  {}
1380 
1386  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
1387  signal_wrapper_base(_A_disp, _A_sigsource)
1388  {}
1389 
1416  template<typename T_functor>
1417  connection_wrapper connect(const T_functor& _A_func) const
1418  {
1420  _A_func,
1422  );
1423  }
1424 
1427  template<sync_type I_sync>
1428  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6) const
1429  {
1430  return open_tunnel_with<I_sync>(
1431  // calls T_signal::*emit
1432  sigc::compose(
1433  sigc::mem_fun(&signal_type::emit),
1434  // getter for the T_signal
1435  sigc::compose(
1436  sigc::retype_return<fp_sig_getter_type>(
1437  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1438  ),
1439  // this makes a copy of the shared signal source and thus
1440  // shares it within the tunnel functor ensuring the lifetime
1441  // of the shared signal source
1442  sigc::bind(
1443  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1444  m_sigsource
1445  )
1446  )
1447  ),
1448  m_disp
1449  )(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
1450  }
1451 
1454  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6) const
1455  {
1456  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
1457  }
1458 
1461  result_type emit_sync(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6) const
1462  {
1463  return emit<SYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
1464  }
1465 
1468  result_type operator()(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6) const
1469  {
1470  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6);
1471  }
1472 
1473 
1476  template<sync_type I_sync>
1478  {
1479  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
1480  return tunnel_funtor_type(
1481  dispatch_with(
1482  // calls T_signal::*emit
1483  sigc::compose(
1484  &signal_type::emit,
1485  // getter for the T_signal
1486  sigc::compose(
1487  sigc::retype_return<fp_sig_getter_type>(
1488  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1489  ),
1490  sigc::bind(
1491  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1492  m_sigsource
1493  )
1494  )
1495  ),
1496  m_disp
1497  ));
1498  }
1499 
1504  {
1505  return make_slot<ASYNC>();
1506  }
1507 
1512  {
1513  return make_slot<SYNC>();
1514  }
1515 };
1516 
1521 template<typename T_signal>
1522 class signal_wrapper<T_signal, internal::SIGGROUP_SIGC, 7>: public signal_wrapper_base
1523 {
1524 public:
1525  //BOOST_STATIC_ASSERT((internal::count_signal_arguments<T_signal>::value == 7));
1526  static const int argument_count = 7;
1528  typedef T_signal signal_type;
1530  typedef typename signal_type::slot_type slot_type;
1531  typedef typename signal_type::result_type result_type;
1532  typedef typename slot_type::arg1_type_ arg1_type_;
1533  typedef typename slot_type::arg2_type_ arg2_type_;
1534  typedef typename slot_type::arg3_type_ arg3_type_;
1535  typedef typename slot_type::arg4_type_ arg4_type_;
1536  typedef typename slot_type::arg5_type_ arg5_type_;
1537  typedef typename slot_type::arg6_type_ arg6_type_;
1538  typedef typename slot_type::arg7_type_ arg7_type_;
1539 
1540  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1541 
1542 protected:
1543  typedef sigc::bound_const_mem_functor0<signal_source_base::hook, signal_source_base> make_slot_f1;
1544  typedef sigc::retype_return_functor<fp_sig_getter_type, make_slot_f1> make_slot_f2;
1545  typedef sigc::const_mem_functor0<signal_source_ptr, std::tr1::shared_ptr<signal_source_base> > make_slot_f3;
1546  typedef sigc::bind_functor<-1, make_slot_f3, std::tr1::shared_ptr<signal_source_base> > make_slot_f4;
1547  typedef sigc::compose1_functor<make_slot_f2, make_slot_f4> make_slot_composed1_functor_type;
1548  typedef sigc::const_mem_functor7<result_type, signal_type, arg1_type_, arg2_type_, arg3_type_, arg4_type_, arg5_type_, arg6_type_, arg7_type_> make_slot_emit_functor_type;
1549  typedef sigc::compose1_functor<make_slot_emit_functor_type, make_slot_composed1_functor_type> make_slot_composed2_functor_type;
1550  typedef SIGX_DISPATCH_WITH_FUNCTOR(make_slot_composed2_functor_type) make_slot_functor_type;
1551 
1552 
1553 public:
1558  {}
1559 
1565  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource) throw():
1566  signal_wrapper_base(_A_disp, _A_sigsource)
1567  {}
1568 
1595  template<typename T_functor>
1596  connection_wrapper connect(const T_functor& _A_func) const
1597  {
1599  _A_func,
1601  );
1602  }
1603 
1606  template<sync_type I_sync>
1607  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6, arg7_type_ _A_a7) const
1608  {
1609  return open_tunnel_with<I_sync>(
1610  // calls T_signal::*emit
1611  sigc::compose(
1612  sigc::mem_fun(&signal_type::emit),
1613  // getter for the T_signal
1614  sigc::compose(
1615  sigc::retype_return<fp_sig_getter_type>(
1616  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1617  ),
1618  // this makes a copy of the shared signal source and thus
1619  // shares it within the tunnel functor ensuring the lifetime
1620  // of the shared signal source
1621  sigc::bind(
1622  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1623  m_sigsource
1624  )
1625  )
1626  ),
1627  m_disp
1628  )(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
1629  }
1630 
1633  result_type emit(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6, arg7_type_ _A_a7) const
1634  {
1635  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
1636  }
1637 
1640  result_type emit_sync(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6, arg7_type_ _A_a7) const
1641  {
1642  return emit<SYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
1643  }
1644 
1647  result_type operator()(arg1_type_ _A_a1, arg2_type_ _A_a2, arg3_type_ _A_a3, arg4_type_ _A_a4, arg5_type_ _A_a5, arg6_type_ _A_a6, arg7_type_ _A_a7) const
1648  {
1649  return emit<ASYNC>(_A_a1, _A_a2, _A_a3, _A_a4, _A_a5, _A_a6, _A_a7);
1650  }
1651 
1652 
1655  template<sync_type I_sync>
1657  {
1658  typedef tunnel_functor<I_sync, make_slot_functor_type> tunnel_funtor_type;
1659  return tunnel_funtor_type(
1660  dispatch_with(
1661  // calls T_signal::*emit
1662  sigc::compose(
1663  &signal_type::emit,
1664  // getter for the T_signal
1665  sigc::compose(
1666  sigc::retype_return<fp_sig_getter_type>(
1667  sigc::mem_fun(m_sigsource.get(), &signal_source_base::getter)
1668  ),
1669  sigc::bind(
1670  sigc::mem_fun(&std::tr1::shared_ptr<signal_source_base>::operator *),
1671  m_sigsource
1672  )
1673  )
1674  ),
1675  m_disp
1676  ));
1677  }
1678 
1683  {
1684  return make_slot<ASYNC>();
1685  }
1686 
1691  {
1692  return make_slot<SYNC>();
1693  }
1694 };
1695 
1696 
1697 
1698 
1702 template<typename T_signal>
1703 // have to specialize the argument count explicitly because template arguments
1704 // can't be involved as template parameters in further template arguments
1705 class signal_wrapper<T_signal, internal::SIGGROUP_GLIB_PROXY, -1>: public signal_wrapper_base
1706 {
1707 public:
1708  static const int argument_count = internal::count_signal_arguments<T_signal>::value;
1710  typedef T_signal signal_type;
1712  typedef typename signal_type::SlotType slot_type;
1713  typedef typename signal_type::VoidSlotType void_slot_type;
1714  typedef typename slot_type::result_type result_type;
1715  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1716 
1717 
1722  {}
1723 
1729  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource):
1730  signal_wrapper_base(_A_disp, _A_sigsource)
1731  {}
1732 
1759  template<typename T_functor>
1760  connection_wrapper connect(const T_functor& _A_func, bool after = true) const
1761  {
1763  _A_func,
1764  sigc::bind(
1766  after
1767  )
1768  );
1769  }
1770 
1775  template<typename T_functor>
1776  connection_wrapper connect_notify(const T_functor& _A_func, bool after = false) const
1777  {
1779  _A_func,
1780  sigc::bind(
1782  after
1783  )
1784  );
1785  }
1786 };
1787 
1788 
1792 template<>
1793 class signal_wrapper<Glib::SignalIdle>: public signal_wrapper_base
1794 {
1795 public:
1798  typedef Glib::SignalIdle signal_type;
1800  typedef bool result_type;
1801  typedef sigc::slot<bool> slot_type;
1802  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1803 
1804 
1809  {}
1810 
1816  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource):
1817  signal_wrapper_base(_A_disp, _A_sigsource)
1818  {}
1819 
1846  template<typename T_functor>
1847  connection_wrapper connect(const T_functor& _A_func, int priority = Glib::PRIORITY_DEFAULT_IDLE) const
1848  {
1850  _A_func,
1851  sigc::bind(
1853  priority
1854  )
1855  );
1856  }
1857 };
1858 
1859 
1863 template<>
1864 class signal_wrapper<Glib::SignalTimeout>: public signal_wrapper_base
1865 {
1866 public:
1869  typedef Glib::SignalTimeout signal_type;
1871  typedef bool result_type;
1872  typedef sigc::slot<bool> slot_type;
1873  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1874 
1875 
1880  {}
1881 
1887  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource):
1888  signal_wrapper_base(_A_disp, _A_sigsource)
1889  {}
1890 
1917  template<typename T_functor>
1918  connection_wrapper connect(const T_functor& _A_func, unsigned int interval,
1919  int priority = Glib::PRIORITY_DEFAULT) const
1920  {
1922  _A_func,
1923  sigc::bind(
1925  interval, priority
1926  )
1927  );
1928  }
1929 };
1930 
1931 
1935 template<>
1936 class signal_wrapper<Glib::SignalIO>: public signal_wrapper_base
1937 {
1938 public:
1941  typedef Glib::SignalIO signal_type;
1943  typedef bool result_type;
1944  typedef sigc::slot<bool, Glib::IOCondition> slot_type;
1945  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
1946 
1947 
1952  {}
1953 
1959  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource):
1960  signal_wrapper_base(_A_disp, _A_sigsource)
1961  {}
1962 
1989  template<typename T_functor>
1990  connection_wrapper connect(const T_functor& _A_func, Glib::IOCondition condition,
1991  int priority = Glib::PRIORITY_DEFAULT) const
1992  {
1994  _A_func,
1995  sigc::bind(
1997  condition, priority
1998  )
1999  );
2000  }
2001 };
2002 
2003 
2007 template<>
2008 class signal_wrapper<Glib::SignalChildWatch>: public signal_wrapper_base
2009 {
2010 public:
2013  typedef Glib::SignalChildWatch signal_type;
2015  typedef bool result_type;
2016  typedef sigc::slot<bool, GPid, int> slot_type;
2017  typedef signal_type (*fp_sig_getter_type)(signal_source_ptr);
2018 
2019 
2024  {}
2025 
2031  signal_wrapper(const shared_dispatchable& _A_disp, const std::tr1::shared_ptr<signal_source_base>& _A_sigsource):
2032  signal_wrapper_base(_A_disp, _A_sigsource)
2033  {}
2034 
2061  template<typename T_functor>
2062  connection_wrapper connect(const T_functor& _A_func, GPid pid,
2063  int priority = Glib::PRIORITY_DEFAULT) const
2064  {
2066  _A_func,
2067  sigc::bind(
2069  pid, priority
2070  )
2071  );
2072  }
2073 };
2074 
2075 
2080 
2081 
2082 } // namespace sigx
2083 
2084 
2085 #endif /* _SIGXMACROS_SIGNAL_WRAPPER_H_ */