282a5b15038a7f7c594c84085a7d65d642112af7
[ardour.git] / libs / sigc++2 / sigc++ / signal.h
1 // -*- c++ -*-
2 /* Do not edit! -- generated file */
3
4 #ifndef _SIGC_SIGNAL_H_
5 #define _SIGC_SIGNAL_H_
6
7 #include <list>
8 #include <sigc++/signal_base.h>
9 #include <sigc++/type_traits.h>
10 #include <sigc++/trackable.h>
11 #include <sigc++/functors/slot.h>
12 #include <sigc++/functors/mem_fun.h>
13
14 //SIGC_TYPEDEF_REDEFINE_ALLOWED:
15 // TODO: This should have its own test, but I can not create one that gives the error instead of just a warning. murrayc.
16 // I have just used this because there is a correlation between these two problems.
17 #ifdef SIGC_TEMPLATE_SPECIALIZATION_OPERATOR_OVERLOAD
18   //Compilers, such as older versions of SUN Forte C++, that do not allow this also often
19   //do not allow a typedef to have the same name as a class in the typedef's definition.
20   //For Sun Forte CC 5.7 (SUN Workshop 10), comment this out to fix the build.
21   #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1
22 #endif
23
24 namespace sigc {
25
26 /** STL-style iterator for slot_list.
27  *
28  * @ingroup signal
29  */
30 template <typename T_slot>
31 struct slot_iterator
32 {
33   typedef size_t                          size_type;
34   typedef ptrdiff_t                       difference_type;
35   typedef std::bidirectional_iterator_tag iterator_category;
36
37   typedef T_slot  slot_type;
38
39   typedef T_slot  value_type;
40   typedef T_slot* pointer;
41   typedef T_slot& reference;
42
43   typedef typename internal::signal_impl::iterator_type iterator_type;
44
45   slot_iterator()
46     {}
47
48   explicit slot_iterator(const iterator_type& i)
49     : i_(i) {}
50
51   reference operator*() const
52     { return static_cast<reference>(*i_); }
53
54   pointer operator->() const
55     { return &(operator*()); }
56
57   slot_iterator& operator++()
58     {
59       ++i_;
60       return *this;
61     }
62
63   slot_iterator operator++(int)
64     { 
65       slot_iterator __tmp(*this);
66       ++i_;
67       return __tmp;
68     }
69
70   slot_iterator& operator--()
71     {
72       --i_;
73       return *this;
74     }
75
76   slot_iterator operator--(int)
77     {
78       slot_iterator __tmp(*this);
79       --i_;
80       return __tmp;
81     }
82
83   bool operator == (const slot_iterator& other) const
84     { return i_ == other.i_; }
85
86   bool operator != (const slot_iterator& other) const
87     { return i_ != other.i_; }
88
89   iterator_type i_;
90 };
91
92 /** STL-style const iterator for slot_list.
93  *
94  * @ingroup signal
95  */
96 template <typename T_slot>
97 struct slot_const_iterator
98 {
99   typedef size_t                          size_type;
100   typedef ptrdiff_t                       difference_type;
101   typedef std::bidirectional_iterator_tag iterator_category;
102
103   typedef T_slot        slot_type;
104
105   typedef T_slot        value_type;
106   typedef const T_slot* pointer;
107   typedef const T_slot& reference;
108
109   typedef typename internal::signal_impl::const_iterator_type iterator_type;
110
111   slot_const_iterator()
112     {}
113
114   explicit slot_const_iterator(const iterator_type& i)
115     : i_(i) {}
116
117   reference operator*() const
118     { return static_cast<reference>(*i_); }
119
120   pointer operator->() const
121     { return &(operator*()); }
122
123   slot_const_iterator& operator++()
124     {
125       ++i_;
126       return *this;
127     }
128
129   slot_const_iterator operator++(int)
130     { 
131       slot_const_iterator __tmp(*this);
132       ++i_;
133       return __tmp;
134     }
135
136   slot_const_iterator& operator--()
137     {
138       --i_;
139       return *this;
140     }
141
142   slot_const_iterator operator--(int)
143     {
144       slot_const_iterator __tmp(*this);
145       --i_;
146       return __tmp;
147     }
148
149   bool operator == (const slot_const_iterator& other) const
150     { return i_ == other.i_; }
151
152   bool operator != (const slot_const_iterator& other) const
153     { return i_ != other.i_; }
154
155   iterator_type i_;
156 };
157
158 /** STL-style list interface for sigc::signal#.
159  * slot_list can be used to iterate over the list of slots that
160  * is managed by a signal. Slots can be added or removed from
161  * the list while existing iterators stay valid. A slot_list
162  * object can be retrieved from the signal's slots() function.
163  *
164  * @ingroup signal
165  */
166 template <class T_slot>
167 struct slot_list
168 {
169   typedef T_slot slot_type;
170
171   typedef slot_type&       reference;
172   typedef const slot_type& const_reference;
173
174   typedef slot_iterator<slot_type>              iterator;
175   typedef slot_const_iterator<slot_type>        const_iterator;
176   
177   #ifndef SIGC_HAVE_SUN_REVERSE_ITERATOR
178   typedef std::reverse_iterator<iterator>       reverse_iterator;
179   typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
180   #else
181   typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
182                                 int, int&, int*, ptrdiff_t> reverse_iterator;
183
184   typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
185                                 int, const int&, const int*, ptrdiff_t> const_reverse_iterator;
186   #endif /* SIGC_HAVE_SUN_REVERSE_ITERATOR */
187
188
189
190
191   slot_list()
192     : list_(0) {}
193
194   explicit slot_list(internal::signal_impl* __list)
195     : list_(__list) {}
196
197   iterator begin()
198     { return iterator(list_->slots_.begin()); }
199
200   const_iterator begin() const
201     { return const_iterator(list_->slots_.begin()); }
202
203   iterator end()
204     { return iterator(list_->slots_.end()); }
205
206   const_iterator end() const
207     { return const_iterator(list_->slots_.end()); }
208
209   reverse_iterator rbegin() 
210     { return reverse_iterator(end()); }
211
212   const_reverse_iterator rbegin() const 
213     { return const_reverse_iterator(end()); }
214
215   reverse_iterator rend()
216     { return reverse_iterator(begin()); }
217
218   const_reverse_iterator rend() const
219     { return const_reverse_iterator(begin()); }
220
221   reference front()
222     { return *begin(); }
223
224   const_reference front() const
225     { return *begin(); }
226
227   reference back()
228     { return *(--end()); }
229
230   const_reference back() const
231     { return *(--end()); }
232
233   iterator insert(iterator i, const slot_type& slot_)
234     { return iterator(list_->insert(i.i_, static_cast<const slot_base&>(slot_))); }
235
236   void push_front(const slot_type& c)
237     { insert(begin(), c); }
238
239   void push_back(const slot_type& c)
240     { insert(end(), c); }
241
242   iterator erase(iterator i)
243     { return iterator(list_->erase(i.i_)); }
244
245   iterator erase(iterator first_, iterator last_)
246     {
247       while (first_ != last_)
248         first_ = erase(first_);
249       return last_;
250     }
251
252   void pop_front()
253     { erase(begin()); }
254
255   void pop_back()
256     { 
257       iterator tmp_ = end();
258       erase(--tmp_);
259     }
260
261 protected:
262   internal::signal_impl* list_;
263 };
264
265
266 namespace internal {
267
268 /** Special iterator over sigc::internal::signal_impl's slot list that holds extra data.
269  * This iterators is for use in accumulators. operator*() executes
270  * the slot. The return value is buffered, so that in an expression
271  * like @code a = (*i) * (*i); @endcode the slot is executed only once.
272  */
273 template <class T_emitter, class T_result = typename T_emitter::result_type>
274 struct slot_iterator_buf
275 {
276   typedef size_t                           size_type;
277   typedef ptrdiff_t                        difference_type;
278   typedef std::bidirectional_iterator_tag  iterator_category;
279
280   typedef T_emitter                        emitter_type;
281   typedef T_result                         result_type;
282   typedef typename T_emitter::slot_type    slot_type;
283
284   typedef signal_impl::const_iterator_type iterator_type;
285
286   slot_iterator_buf()
287     : c_(0), invoked_(false) {}
288
289   slot_iterator_buf(const iterator_type& i, const emitter_type* c)
290     : i_(i), c_(c), invoked_(false) {}
291
292   result_type operator*() const
293     {
294       if (!i_->empty() && !i_->blocked() && !invoked_)
295         {
296           r_ = (*c_)(static_cast<const slot_type&>(*i_));
297           invoked_ = true;
298         }
299       return r_;
300     }
301
302   slot_iterator_buf& operator++()
303     {
304       ++i_;
305       invoked_ = false;
306       return *this;
307     }
308
309   slot_iterator_buf operator++(int)
310     { 
311       slot_iterator_buf __tmp(*this);
312       ++i_;
313       invoked_ = false;
314       return __tmp;
315     }
316
317   slot_iterator_buf& operator--()
318     {
319       --i_;
320       invoked_ = false;
321       return *this;
322     }
323
324   slot_iterator_buf operator--(int)
325     {
326       slot_iterator_buf __tmp(*this);
327       --i_;
328       invoked_ = false;
329       return __tmp;
330     }
331
332   bool operator == (const slot_iterator_buf& other) const
333     { return (!c_ || (i_ == other.i_)); } /* If '!c_' the iterators are empty.
334                                            * Unfortunately, empty stl iterators are not equal.
335                                            * We are forcing equality so that 'first==last'
336                                            * in the accumulator's emit function yields true. */
337
338   bool operator != (const slot_iterator_buf& other) const
339     { return (c_ && (i_ != other.i_)); }
340
341 private:
342   iterator_type i_;
343   const emitter_type* c_;
344   mutable result_type r_;
345   mutable bool invoked_;
346 };
347
348 /** Template specialization of slot_iterator_buf for void return signals.
349  */
350 template <class T_emitter>
351 struct slot_iterator_buf<T_emitter, void>
352 {
353   typedef size_t                           size_type;
354   typedef ptrdiff_t                        difference_type;
355   typedef std::bidirectional_iterator_tag  iterator_category;
356
357   typedef T_emitter                        emitter_type;
358   typedef void                             result_type;
359   typedef typename T_emitter::slot_type    slot_type;
360
361   typedef signal_impl::const_iterator_type iterator_type;
362
363   slot_iterator_buf()
364     : c_(0), invoked_(false) {}
365
366   slot_iterator_buf(const iterator_type& i, const emitter_type* c)
367     : i_(i), c_(c), invoked_(false) {}
368
369   void operator*() const
370     {
371       if (!i_->empty() && !i_->blocked() && !invoked_)
372         {
373           (*c_)(static_cast<const slot_type&>(*i_));
374           invoked_ = true;
375         }
376     }
377
378   slot_iterator_buf& operator++()
379     {
380       ++i_;
381       invoked_ = false;
382       return *this;
383     }
384
385   slot_iterator_buf operator++(int)
386     { 
387       slot_iterator_buf __tmp(*this);
388       ++i_;
389       invoked_ = false;
390       return __tmp;
391     }
392
393   slot_iterator_buf& operator--()
394     {
395       --i_;
396       invoked_ = false;
397       return *this;
398     }
399
400   slot_iterator_buf operator--(int)
401     {
402       slot_iterator_buf __tmp(*this);
403       --i_;
404       invoked_ = false;
405       return __tmp;
406     }
407
408   bool operator == (const slot_iterator_buf& other) const
409     { return i_ == other.i_; }
410
411   bool operator != (const slot_iterator_buf& other) const
412     { return i_ != other.i_; }
413
414 private:
415   iterator_type i_;
416   const emitter_type* c_;
417   mutable bool invoked_;
418 };
419
420 /** Abstracts signal emission.
421  * This template implements the emit() function of signal0.
422  * Template specializations are available to optimize signal
423  * emission when no accumulator is used, i.e. the template
424  * argument @e T_accumulator is @p nil.
425  */
426 template <class T_return, class T_accumulator>
427 struct signal_emit0
428 {
429   typedef signal_emit0<T_return, T_accumulator> self_type;
430   typedef typename T_accumulator::result_type result_type;
431   typedef slot<T_return> slot_type;
432   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
433   typedef signal_impl::const_iterator_type iterator_type;
434
435   signal_emit0()  {}
436
437   /** Invokes a slot.
438    * @param _A_slot Some slot to invoke.
439    * @return The slot's return value.
440    */
441   T_return operator()(const slot_type& _A_slot) const
442     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_); }
443
444   /** Executes a list of slots using an accumulator of type @e T_accumulator.
445
446    * @return The accumulated return values of the slot invocations as processed by the accumulator.
447    */
448   static result_type emit(signal_impl* impl)
449     {
450       T_accumulator accumulator;
451
452       if (!impl)
453         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
454
455       signal_exec exec(impl);
456       temp_slot_list slots(impl->slots_);
457
458       self_type self ;
459       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
460                          slot_iterator_buf_type(slots.end(), &self));
461     }
462   
463 };
464
465 /** Abstracts signal emission.
466  * This template specialization implements an optimized emit()
467  * function for the case that no accumulator is used.
468  */
469 template <class T_return>
470 struct signal_emit0<T_return, nil>
471 {
472   typedef signal_emit0<T_return, nil > self_type;
473   typedef T_return result_type;
474   typedef slot<T_return> slot_type;
475   typedef signal_impl::const_iterator_type iterator_type;
476   typedef typename slot_type::call_type call_type;
477
478   /** Executes a list of slots using an accumulator of type @e T_accumulator.
479    * The return value of the last slot invoked is returned.
480    * @param first An iterator pointing to the first slot in the list.
481    * @param last An iterator pointing to the last slot in the list.
482    * @return The return value of the last slot invoked.
483    */
484   static result_type emit(signal_impl* impl)
485     {
486       if (!impl || impl->slots_.empty())
487         return T_return();
488         
489       signal_exec exec(impl);
490       T_return r_ = T_return(); 
491       
492       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
493       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
494       { 
495         temp_slot_list slots(impl->slots_);
496         iterator_type it = slots.begin();
497         for (; it != slots.end(); ++it)
498           if (!it->empty() && !it->blocked()) break;
499           
500         if (it == slots.end())
501           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
502   
503         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_);
504         for (++it; it != slots.end(); ++it)
505           {
506             if (it->empty() || it->blocked())
507               continue;
508             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_);
509           }
510       }
511       
512       return r_;
513     }
514 };
515
516 /** Abstracts signal emission.
517  * This template specialization implements an optimized emit()
518  * function for the case that no accumulator is used and the
519  * return type is @p void.
520  */
521 template <>
522 struct signal_emit0<void, nil>
523 {
524   typedef signal_emit0<void, nil> self_type;
525   typedef void result_type;
526   typedef slot<void> slot_type;
527   typedef signal_impl::const_iterator_type iterator_type;
528   typedef void (*call_type)(slot_rep*);
529
530   /** Executes a list of slots using an accumulator of type @e T_accumulator.
531    * @param first An iterator pointing to the first slot in the list.
532    * @param last An iterator pointing to the last slot in the list.
533    */
534   static result_type emit(signal_impl* impl)
535     {
536       if (!impl || impl->slots_.empty()) return;
537       signal_exec exec(impl);
538       temp_slot_list slots(impl->slots_);
539
540       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
541         {
542           if (it->empty() || it->blocked())
543             continue;
544           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_);
545         }
546     }
547 };
548
549 /** Abstracts signal emission.
550  * This template implements the emit() function of signal1.
551  * Template specializations are available to optimize signal
552  * emission when no accumulator is used, i.e. the template
553  * argument @e T_accumulator is @p nil.
554  */
555 template <class T_return, class T_arg1, class T_accumulator>
556 struct signal_emit1
557 {
558   typedef signal_emit1<T_return, T_arg1, T_accumulator> self_type;
559   typedef typename T_accumulator::result_type result_type;
560   typedef slot<T_return, T_arg1> slot_type;
561   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
562   typedef signal_impl::const_iterator_type iterator_type;
563
564   /** Instantiates the class.
565    * The parameters are stored in member variables. operator()() passes
566    * the values on to some slot.
567    */
568   signal_emit1(typename type_trait<T_arg1>::take _A_a1) 
569     : _A_a1_(_A_a1) {}
570
571
572   /** Invokes a slot using the buffered parameter values.
573    * @param _A_slot Some slot to invoke.
574    * @return The slot's return value.
575    */
576   T_return operator()(const slot_type& _A_slot) const
577     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_); }
578
579   /** Executes a list of slots using an accumulator of type @e T_accumulator.
580    * The arguments are buffered in a temporary instance of signal_emit1.
581
582    * @param _A_a1 Argument to be passed on to the slots.
583    * @return The accumulated return values of the slot invocations as processed by the accumulator.
584    */
585   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1)
586     {
587       T_accumulator accumulator;
588
589       if (!impl)
590         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
591
592       signal_exec exec(impl);
593       temp_slot_list slots(impl->slots_);
594
595       self_type self (_A_a1);
596       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
597                          slot_iterator_buf_type(slots.end(), &self));
598     }
599   
600   typename type_trait<T_arg1>::take _A_a1_;
601 };
602
603 /** Abstracts signal emission.
604  * This template specialization implements an optimized emit()
605  * function for the case that no accumulator is used.
606  */
607 template <class T_return, class T_arg1>
608 struct signal_emit1<T_return, T_arg1, nil>
609 {
610   typedef signal_emit1<T_return, T_arg1, nil > self_type;
611   typedef T_return result_type;
612   typedef slot<T_return, T_arg1> slot_type;
613   typedef signal_impl::const_iterator_type iterator_type;
614   typedef typename slot_type::call_type call_type;
615
616   /** Executes a list of slots using an accumulator of type @e T_accumulator.
617    * The arguments are passed directly on to the slots.
618    * The return value of the last slot invoked is returned.
619    * @param first An iterator pointing to the first slot in the list.
620    * @param last An iterator pointing to the last slot in the list.
621    * @param _A_a1 Argument to be passed on to the slots.
622    * @return The return value of the last slot invoked.
623    */
624   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1)
625     {
626       if (!impl || impl->slots_.empty())
627         return T_return();
628         
629       signal_exec exec(impl);
630       T_return r_ = T_return(); 
631       
632       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
633       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
634       { 
635         temp_slot_list slots(impl->slots_);
636         iterator_type it = slots.begin();
637         for (; it != slots.end(); ++it)
638           if (!it->empty() && !it->blocked()) break;
639           
640         if (it == slots.end())
641           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
642   
643         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
644         for (++it; it != slots.end(); ++it)
645           {
646             if (it->empty() || it->blocked())
647               continue;
648             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
649           }
650       }
651       
652       return r_;
653     }
654 };
655
656 /** Abstracts signal emission.
657  * This template specialization implements an optimized emit()
658  * function for the case that no accumulator is used and the
659  * return type is @p void.
660  */
661 template <class T_arg1>
662 struct signal_emit1<void, T_arg1, nil>
663 {
664   typedef signal_emit1<void, T_arg1, nil> self_type;
665   typedef void result_type;
666   typedef slot<void, T_arg1> slot_type;
667   typedef signal_impl::const_iterator_type iterator_type;
668   typedef typename slot_type::call_type call_type;
669
670   /** Executes a list of slots using an accumulator of type @e T_accumulator.
671    * The arguments are passed directly on to the slots.
672    * @param first An iterator pointing to the first slot in the list.
673    * @param last An iterator pointing to the last slot in the list.
674    * @param _A_a1 Argument to be passed on to the slots.
675    */
676   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1)
677     {
678       if (!impl || impl->slots_.empty()) return;
679       signal_exec exec(impl);
680       temp_slot_list slots(impl->slots_);
681
682       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
683         {
684           if (it->empty() || it->blocked())
685             continue;
686           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
687         }
688     }
689 };
690
691 /** Abstracts signal emission.
692  * This template implements the emit() function of signal2.
693  * Template specializations are available to optimize signal
694  * emission when no accumulator is used, i.e. the template
695  * argument @e T_accumulator is @p nil.
696  */
697 template <class T_return, class T_arg1,class T_arg2, class T_accumulator>
698 struct signal_emit2
699 {
700   typedef signal_emit2<T_return, T_arg1,T_arg2, T_accumulator> self_type;
701   typedef typename T_accumulator::result_type result_type;
702   typedef slot<T_return, T_arg1,T_arg2> slot_type;
703   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
704   typedef signal_impl::const_iterator_type iterator_type;
705
706   /** Instantiates the class.
707    * The parameters are stored in member variables. operator()() passes
708    * the values on to some slot.
709    */
710   signal_emit2(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) 
711     : _A_a1_(_A_a1),_A_a2_(_A_a2) {}
712
713
714   /** Invokes a slot using the buffered parameter values.
715    * @param _A_slot Some slot to invoke.
716    * @return The slot's return value.
717    */
718   T_return operator()(const slot_type& _A_slot) const
719     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_,_A_a2_); }
720
721   /** Executes a list of slots using an accumulator of type @e T_accumulator.
722    * The arguments are buffered in a temporary instance of signal_emit2.
723
724    * @param _A_a1 Argument to be passed on to the slots.
725    * @param _A_a2 Argument to be passed on to the slots.
726    * @return The accumulated return values of the slot invocations as processed by the accumulator.
727    */
728   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2)
729     {
730       T_accumulator accumulator;
731
732       if (!impl)
733         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
734
735       signal_exec exec(impl);
736       temp_slot_list slots(impl->slots_);
737
738       self_type self (_A_a1,_A_a2);
739       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
740                          slot_iterator_buf_type(slots.end(), &self));
741     }
742   
743   typename type_trait<T_arg1>::take _A_a1_;
744   typename type_trait<T_arg2>::take _A_a2_;
745 };
746
747 /** Abstracts signal emission.
748  * This template specialization implements an optimized emit()
749  * function for the case that no accumulator is used.
750  */
751 template <class T_return, class T_arg1,class T_arg2>
752 struct signal_emit2<T_return, T_arg1,T_arg2, nil>
753 {
754   typedef signal_emit2<T_return, T_arg1,T_arg2, nil > self_type;
755   typedef T_return result_type;
756   typedef slot<T_return, T_arg1,T_arg2> slot_type;
757   typedef signal_impl::const_iterator_type iterator_type;
758   typedef typename slot_type::call_type call_type;
759
760   /** Executes a list of slots using an accumulator of type @e T_accumulator.
761    * The arguments are passed directly on to the slots.
762    * The return value of the last slot invoked is returned.
763    * @param first An iterator pointing to the first slot in the list.
764    * @param last An iterator pointing to the last slot in the list.
765    * @param _A_a1 Argument to be passed on to the slots.
766    * @param _A_a2 Argument to be passed on to the slots.
767    * @return The return value of the last slot invoked.
768    */
769   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2)
770     {
771       if (!impl || impl->slots_.empty())
772         return T_return();
773         
774       signal_exec exec(impl);
775       T_return r_ = T_return(); 
776       
777       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
778       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
779       { 
780         temp_slot_list slots(impl->slots_);
781         iterator_type it = slots.begin();
782         for (; it != slots.end(); ++it)
783           if (!it->empty() && !it->blocked()) break;
784           
785         if (it == slots.end())
786           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
787   
788         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2);
789         for (++it; it != slots.end(); ++it)
790           {
791             if (it->empty() || it->blocked())
792               continue;
793             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2);
794           }
795       }
796       
797       return r_;
798     }
799 };
800
801 /** Abstracts signal emission.
802  * This template specialization implements an optimized emit()
803  * function for the case that no accumulator is used and the
804  * return type is @p void.
805  */
806 template <class T_arg1,class T_arg2>
807 struct signal_emit2<void, T_arg1,T_arg2, nil>
808 {
809   typedef signal_emit2<void, T_arg1,T_arg2, nil> self_type;
810   typedef void result_type;
811   typedef slot<void, T_arg1,T_arg2> slot_type;
812   typedef signal_impl::const_iterator_type iterator_type;
813   typedef typename slot_type::call_type call_type;
814
815   /** Executes a list of slots using an accumulator of type @e T_accumulator.
816    * The arguments are passed directly on to the slots.
817    * @param first An iterator pointing to the first slot in the list.
818    * @param last An iterator pointing to the last slot in the list.
819    * @param _A_a1 Argument to be passed on to the slots.
820    * @param _A_a2 Argument to be passed on to the slots.
821    */
822   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2)
823     {
824       if (!impl || impl->slots_.empty()) return;
825       signal_exec exec(impl);
826       temp_slot_list slots(impl->slots_);
827
828       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
829         {
830           if (it->empty() || it->blocked())
831             continue;
832           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2);
833         }
834     }
835 };
836
837 /** Abstracts signal emission.
838  * This template implements the emit() function of signal3.
839  * Template specializations are available to optimize signal
840  * emission when no accumulator is used, i.e. the template
841  * argument @e T_accumulator is @p nil.
842  */
843 template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_accumulator>
844 struct signal_emit3
845 {
846   typedef signal_emit3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator> self_type;
847   typedef typename T_accumulator::result_type result_type;
848   typedef slot<T_return, T_arg1,T_arg2,T_arg3> slot_type;
849   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
850   typedef signal_impl::const_iterator_type iterator_type;
851
852   /** Instantiates the class.
853    * The parameters are stored in member variables. operator()() passes
854    * the values on to some slot.
855    */
856   signal_emit3(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) 
857     : _A_a1_(_A_a1),_A_a2_(_A_a2),_A_a3_(_A_a3) {}
858
859
860   /** Invokes a slot using the buffered parameter values.
861    * @param _A_slot Some slot to invoke.
862    * @return The slot's return value.
863    */
864   T_return operator()(const slot_type& _A_slot) const
865     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_,_A_a2_,_A_a3_); }
866
867   /** Executes a list of slots using an accumulator of type @e T_accumulator.
868    * The arguments are buffered in a temporary instance of signal_emit3.
869
870    * @param _A_a1 Argument to be passed on to the slots.
871    * @param _A_a2 Argument to be passed on to the slots.
872    * @param _A_a3 Argument to be passed on to the slots.
873    * @return The accumulated return values of the slot invocations as processed by the accumulator.
874    */
875   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3)
876     {
877       T_accumulator accumulator;
878
879       if (!impl)
880         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
881
882       signal_exec exec(impl);
883       temp_slot_list slots(impl->slots_);
884
885       self_type self (_A_a1,_A_a2,_A_a3);
886       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
887                          slot_iterator_buf_type(slots.end(), &self));
888     }
889   
890   typename type_trait<T_arg1>::take _A_a1_;
891   typename type_trait<T_arg2>::take _A_a2_;
892   typename type_trait<T_arg3>::take _A_a3_;
893 };
894
895 /** Abstracts signal emission.
896  * This template specialization implements an optimized emit()
897  * function for the case that no accumulator is used.
898  */
899 template <class T_return, class T_arg1,class T_arg2,class T_arg3>
900 struct signal_emit3<T_return, T_arg1,T_arg2,T_arg3, nil>
901 {
902   typedef signal_emit3<T_return, T_arg1,T_arg2,T_arg3, nil > self_type;
903   typedef T_return result_type;
904   typedef slot<T_return, T_arg1,T_arg2,T_arg3> slot_type;
905   typedef signal_impl::const_iterator_type iterator_type;
906   typedef typename slot_type::call_type call_type;
907
908   /** Executes a list of slots using an accumulator of type @e T_accumulator.
909    * The arguments are passed directly on to the slots.
910    * The return value of the last slot invoked is returned.
911    * @param first An iterator pointing to the first slot in the list.
912    * @param last An iterator pointing to the last slot in the list.
913    * @param _A_a1 Argument to be passed on to the slots.
914    * @param _A_a2 Argument to be passed on to the slots.
915    * @param _A_a3 Argument to be passed on to the slots.
916    * @return The return value of the last slot invoked.
917    */
918   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3)
919     {
920       if (!impl || impl->slots_.empty())
921         return T_return();
922         
923       signal_exec exec(impl);
924       T_return r_ = T_return(); 
925       
926       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
927       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
928       { 
929         temp_slot_list slots(impl->slots_);
930         iterator_type it = slots.begin();
931         for (; it != slots.end(); ++it)
932           if (!it->empty() && !it->blocked()) break;
933           
934         if (it == slots.end())
935           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
936   
937         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3);
938         for (++it; it != slots.end(); ++it)
939           {
940             if (it->empty() || it->blocked())
941               continue;
942             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3);
943           }
944       }
945       
946       return r_;
947     }
948 };
949
950 /** Abstracts signal emission.
951  * This template specialization implements an optimized emit()
952  * function for the case that no accumulator is used and the
953  * return type is @p void.
954  */
955 template <class T_arg1,class T_arg2,class T_arg3>
956 struct signal_emit3<void, T_arg1,T_arg2,T_arg3, nil>
957 {
958   typedef signal_emit3<void, T_arg1,T_arg2,T_arg3, nil> self_type;
959   typedef void result_type;
960   typedef slot<void, T_arg1,T_arg2,T_arg3> slot_type;
961   typedef signal_impl::const_iterator_type iterator_type;
962   typedef typename slot_type::call_type call_type;
963
964   /** Executes a list of slots using an accumulator of type @e T_accumulator.
965    * The arguments are passed directly on to the slots.
966    * @param first An iterator pointing to the first slot in the list.
967    * @param last An iterator pointing to the last slot in the list.
968    * @param _A_a1 Argument to be passed on to the slots.
969    * @param _A_a2 Argument to be passed on to the slots.
970    * @param _A_a3 Argument to be passed on to the slots.
971    */
972   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3)
973     {
974       if (!impl || impl->slots_.empty()) return;
975       signal_exec exec(impl);
976       temp_slot_list slots(impl->slots_);
977
978       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
979         {
980           if (it->empty() || it->blocked())
981             continue;
982           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3);
983         }
984     }
985 };
986
987 /** Abstracts signal emission.
988  * This template implements the emit() function of signal4.
989  * Template specializations are available to optimize signal
990  * emission when no accumulator is used, i.e. the template
991  * argument @e T_accumulator is @p nil.
992  */
993 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_accumulator>
994 struct signal_emit4
995 {
996   typedef signal_emit4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator> self_type;
997   typedef typename T_accumulator::result_type result_type;
998   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4> slot_type;
999   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
1000   typedef signal_impl::const_iterator_type iterator_type;
1001
1002   /** Instantiates the class.
1003    * The parameters are stored in member variables. operator()() passes
1004    * the values on to some slot.
1005    */
1006   signal_emit4(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) 
1007     : _A_a1_(_A_a1),_A_a2_(_A_a2),_A_a3_(_A_a3),_A_a4_(_A_a4) {}
1008
1009
1010   /** Invokes a slot using the buffered parameter values.
1011    * @param _A_slot Some slot to invoke.
1012    * @return The slot's return value.
1013    */
1014   T_return operator()(const slot_type& _A_slot) const
1015     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_,_A_a2_,_A_a3_,_A_a4_); }
1016
1017   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1018    * The arguments are buffered in a temporary instance of signal_emit4.
1019
1020    * @param _A_a1 Argument to be passed on to the slots.
1021    * @param _A_a2 Argument to be passed on to the slots.
1022    * @param _A_a3 Argument to be passed on to the slots.
1023    * @param _A_a4 Argument to be passed on to the slots.
1024    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1025    */
1026   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4)
1027     {
1028       T_accumulator accumulator;
1029
1030       if (!impl)
1031         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1032
1033       signal_exec exec(impl);
1034       temp_slot_list slots(impl->slots_);
1035
1036       self_type self (_A_a1,_A_a2,_A_a3,_A_a4);
1037       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1038                          slot_iterator_buf_type(slots.end(), &self));
1039     }
1040   
1041   typename type_trait<T_arg1>::take _A_a1_;
1042   typename type_trait<T_arg2>::take _A_a2_;
1043   typename type_trait<T_arg3>::take _A_a3_;
1044   typename type_trait<T_arg4>::take _A_a4_;
1045 };
1046
1047 /** Abstracts signal emission.
1048  * This template specialization implements an optimized emit()
1049  * function for the case that no accumulator is used.
1050  */
1051 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
1052 struct signal_emit4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, nil>
1053 {
1054   typedef signal_emit4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, nil > self_type;
1055   typedef T_return result_type;
1056   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4> slot_type;
1057   typedef signal_impl::const_iterator_type iterator_type;
1058   typedef typename slot_type::call_type call_type;
1059
1060   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1061    * The arguments are passed directly on to the slots.
1062    * The return value of the last slot invoked is returned.
1063    * @param first An iterator pointing to the first slot in the list.
1064    * @param last An iterator pointing to the last slot in the list.
1065    * @param _A_a1 Argument to be passed on to the slots.
1066    * @param _A_a2 Argument to be passed on to the slots.
1067    * @param _A_a3 Argument to be passed on to the slots.
1068    * @param _A_a4 Argument to be passed on to the slots.
1069    * @return The return value of the last slot invoked.
1070    */
1071   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4)
1072     {
1073       if (!impl || impl->slots_.empty())
1074         return T_return();
1075         
1076       signal_exec exec(impl);
1077       T_return r_ = T_return(); 
1078       
1079       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1080       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1081       { 
1082         temp_slot_list slots(impl->slots_);
1083         iterator_type it = slots.begin();
1084         for (; it != slots.end(); ++it)
1085           if (!it->empty() && !it->blocked()) break;
1086           
1087         if (it == slots.end())
1088           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1089   
1090         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4);
1091         for (++it; it != slots.end(); ++it)
1092           {
1093             if (it->empty() || it->blocked())
1094               continue;
1095             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4);
1096           }
1097       }
1098       
1099       return r_;
1100     }
1101 };
1102
1103 /** Abstracts signal emission.
1104  * This template specialization implements an optimized emit()
1105  * function for the case that no accumulator is used and the
1106  * return type is @p void.
1107  */
1108 template <class T_arg1,class T_arg2,class T_arg3,class T_arg4>
1109 struct signal_emit4<void, T_arg1,T_arg2,T_arg3,T_arg4, nil>
1110 {
1111   typedef signal_emit4<void, T_arg1,T_arg2,T_arg3,T_arg4, nil> self_type;
1112   typedef void result_type;
1113   typedef slot<void, T_arg1,T_arg2,T_arg3,T_arg4> slot_type;
1114   typedef signal_impl::const_iterator_type iterator_type;
1115   typedef typename slot_type::call_type call_type;
1116
1117   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1118    * The arguments are passed directly on to the slots.
1119    * @param first An iterator pointing to the first slot in the list.
1120    * @param last An iterator pointing to the last slot in the list.
1121    * @param _A_a1 Argument to be passed on to the slots.
1122    * @param _A_a2 Argument to be passed on to the slots.
1123    * @param _A_a3 Argument to be passed on to the slots.
1124    * @param _A_a4 Argument to be passed on to the slots.
1125    */
1126   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4)
1127     {
1128       if (!impl || impl->slots_.empty()) return;
1129       signal_exec exec(impl);
1130       temp_slot_list slots(impl->slots_);
1131
1132       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1133         {
1134           if (it->empty() || it->blocked())
1135             continue;
1136           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4);
1137         }
1138     }
1139 };
1140
1141 /** Abstracts signal emission.
1142  * This template implements the emit() function of signal5.
1143  * Template specializations are available to optimize signal
1144  * emission when no accumulator is used, i.e. the template
1145  * argument @e T_accumulator is @p nil.
1146  */
1147 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_accumulator>
1148 struct signal_emit5
1149 {
1150   typedef signal_emit5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator> self_type;
1151   typedef typename T_accumulator::result_type result_type;
1152   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> slot_type;
1153   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
1154   typedef signal_impl::const_iterator_type iterator_type;
1155
1156   /** Instantiates the class.
1157    * The parameters are stored in member variables. operator()() passes
1158    * the values on to some slot.
1159    */
1160   signal_emit5(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) 
1161     : _A_a1_(_A_a1),_A_a2_(_A_a2),_A_a3_(_A_a3),_A_a4_(_A_a4),_A_a5_(_A_a5) {}
1162
1163
1164   /** Invokes a slot using the buffered parameter values.
1165    * @param _A_slot Some slot to invoke.
1166    * @return The slot's return value.
1167    */
1168   T_return operator()(const slot_type& _A_slot) const
1169     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_,_A_a2_,_A_a3_,_A_a4_,_A_a5_); }
1170
1171   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1172    * The arguments are buffered in a temporary instance of signal_emit5.
1173
1174    * @param _A_a1 Argument to be passed on to the slots.
1175    * @param _A_a2 Argument to be passed on to the slots.
1176    * @param _A_a3 Argument to be passed on to the slots.
1177    * @param _A_a4 Argument to be passed on to the slots.
1178    * @param _A_a5 Argument to be passed on to the slots.
1179    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1180    */
1181   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5)
1182     {
1183       T_accumulator accumulator;
1184
1185       if (!impl)
1186         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1187
1188       signal_exec exec(impl);
1189       temp_slot_list slots(impl->slots_);
1190
1191       self_type self (_A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
1192       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1193                          slot_iterator_buf_type(slots.end(), &self));
1194     }
1195   
1196   typename type_trait<T_arg1>::take _A_a1_;
1197   typename type_trait<T_arg2>::take _A_a2_;
1198   typename type_trait<T_arg3>::take _A_a3_;
1199   typename type_trait<T_arg4>::take _A_a4_;
1200   typename type_trait<T_arg5>::take _A_a5_;
1201 };
1202
1203 /** Abstracts signal emission.
1204  * This template specialization implements an optimized emit()
1205  * function for the case that no accumulator is used.
1206  */
1207 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
1208 struct signal_emit5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil>
1209 {
1210   typedef signal_emit5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil > self_type;
1211   typedef T_return result_type;
1212   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> slot_type;
1213   typedef signal_impl::const_iterator_type iterator_type;
1214   typedef typename slot_type::call_type call_type;
1215
1216   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1217    * The arguments are passed directly on to the slots.
1218    * The return value of the last slot invoked is returned.
1219    * @param first An iterator pointing to the first slot in the list.
1220    * @param last An iterator pointing to the last slot in the list.
1221    * @param _A_a1 Argument to be passed on to the slots.
1222    * @param _A_a2 Argument to be passed on to the slots.
1223    * @param _A_a3 Argument to be passed on to the slots.
1224    * @param _A_a4 Argument to be passed on to the slots.
1225    * @param _A_a5 Argument to be passed on to the slots.
1226    * @return The return value of the last slot invoked.
1227    */
1228   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5)
1229     {
1230       if (!impl || impl->slots_.empty())
1231         return T_return();
1232         
1233       signal_exec exec(impl);
1234       T_return r_ = T_return(); 
1235       
1236       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1237       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1238       { 
1239         temp_slot_list slots(impl->slots_);
1240         iterator_type it = slots.begin();
1241         for (; it != slots.end(); ++it)
1242           if (!it->empty() && !it->blocked()) break;
1243           
1244         if (it == slots.end())
1245           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1246   
1247         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
1248         for (++it; it != slots.end(); ++it)
1249           {
1250             if (it->empty() || it->blocked())
1251               continue;
1252             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
1253           }
1254       }
1255       
1256       return r_;
1257     }
1258 };
1259
1260 /** Abstracts signal emission.
1261  * This template specialization implements an optimized emit()
1262  * function for the case that no accumulator is used and the
1263  * return type is @p void.
1264  */
1265 template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
1266 struct signal_emit5<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil>
1267 {
1268   typedef signal_emit5<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil> self_type;
1269   typedef void result_type;
1270   typedef slot<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> slot_type;
1271   typedef signal_impl::const_iterator_type iterator_type;
1272   typedef typename slot_type::call_type call_type;
1273
1274   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1275    * The arguments are passed directly on to the slots.
1276    * @param first An iterator pointing to the first slot in the list.
1277    * @param last An iterator pointing to the last slot in the list.
1278    * @param _A_a1 Argument to be passed on to the slots.
1279    * @param _A_a2 Argument to be passed on to the slots.
1280    * @param _A_a3 Argument to be passed on to the slots.
1281    * @param _A_a4 Argument to be passed on to the slots.
1282    * @param _A_a5 Argument to be passed on to the slots.
1283    */
1284   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5)
1285     {
1286       if (!impl || impl->slots_.empty()) return;
1287       signal_exec exec(impl);
1288       temp_slot_list slots(impl->slots_);
1289
1290       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1291         {
1292           if (it->empty() || it->blocked())
1293             continue;
1294           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
1295         }
1296     }
1297 };
1298
1299 /** Abstracts signal emission.
1300  * This template implements the emit() function of signal6.
1301  * Template specializations are available to optimize signal
1302  * emission when no accumulator is used, i.e. the template
1303  * argument @e T_accumulator is @p nil.
1304  */
1305 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_accumulator>
1306 struct signal_emit6
1307 {
1308   typedef signal_emit6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator> self_type;
1309   typedef typename T_accumulator::result_type result_type;
1310   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> slot_type;
1311   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
1312   typedef signal_impl::const_iterator_type iterator_type;
1313
1314   /** Instantiates the class.
1315    * The parameters are stored in member variables. operator()() passes
1316    * the values on to some slot.
1317    */
1318   signal_emit6(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) 
1319     : _A_a1_(_A_a1),_A_a2_(_A_a2),_A_a3_(_A_a3),_A_a4_(_A_a4),_A_a5_(_A_a5),_A_a6_(_A_a6) {}
1320
1321
1322   /** Invokes a slot using the buffered parameter values.
1323    * @param _A_slot Some slot to invoke.
1324    * @return The slot's return value.
1325    */
1326   T_return operator()(const slot_type& _A_slot) const
1327     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_,_A_a2_,_A_a3_,_A_a4_,_A_a5_,_A_a6_); }
1328
1329   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1330    * The arguments are buffered in a temporary instance of signal_emit6.
1331
1332    * @param _A_a1 Argument to be passed on to the slots.
1333    * @param _A_a2 Argument to be passed on to the slots.
1334    * @param _A_a3 Argument to be passed on to the slots.
1335    * @param _A_a4 Argument to be passed on to the slots.
1336    * @param _A_a5 Argument to be passed on to the slots.
1337    * @param _A_a6 Argument to be passed on to the slots.
1338    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1339    */
1340   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6)
1341     {
1342       T_accumulator accumulator;
1343
1344       if (!impl)
1345         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1346
1347       signal_exec exec(impl);
1348       temp_slot_list slots(impl->slots_);
1349
1350       self_type self (_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
1351       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1352                          slot_iterator_buf_type(slots.end(), &self));
1353     }
1354   
1355   typename type_trait<T_arg1>::take _A_a1_;
1356   typename type_trait<T_arg2>::take _A_a2_;
1357   typename type_trait<T_arg3>::take _A_a3_;
1358   typename type_trait<T_arg4>::take _A_a4_;
1359   typename type_trait<T_arg5>::take _A_a5_;
1360   typename type_trait<T_arg6>::take _A_a6_;
1361 };
1362
1363 /** Abstracts signal emission.
1364  * This template specialization implements an optimized emit()
1365  * function for the case that no accumulator is used.
1366  */
1367 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
1368 struct signal_emit6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>
1369 {
1370   typedef signal_emit6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil > self_type;
1371   typedef T_return result_type;
1372   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> slot_type;
1373   typedef signal_impl::const_iterator_type iterator_type;
1374   typedef typename slot_type::call_type call_type;
1375
1376   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1377    * The arguments are passed directly on to the slots.
1378    * The return value of the last slot invoked is returned.
1379    * @param first An iterator pointing to the first slot in the list.
1380    * @param last An iterator pointing to the last slot in the list.
1381    * @param _A_a1 Argument to be passed on to the slots.
1382    * @param _A_a2 Argument to be passed on to the slots.
1383    * @param _A_a3 Argument to be passed on to the slots.
1384    * @param _A_a4 Argument to be passed on to the slots.
1385    * @param _A_a5 Argument to be passed on to the slots.
1386    * @param _A_a6 Argument to be passed on to the slots.
1387    * @return The return value of the last slot invoked.
1388    */
1389   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6)
1390     {
1391       if (!impl || impl->slots_.empty())
1392         return T_return();
1393         
1394       signal_exec exec(impl);
1395       T_return r_ = T_return(); 
1396       
1397       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1398       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1399       { 
1400         temp_slot_list slots(impl->slots_);
1401         iterator_type it = slots.begin();
1402         for (; it != slots.end(); ++it)
1403           if (!it->empty() && !it->blocked()) break;
1404           
1405         if (it == slots.end())
1406           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1407   
1408         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
1409         for (++it; it != slots.end(); ++it)
1410           {
1411             if (it->empty() || it->blocked())
1412               continue;
1413             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
1414           }
1415       }
1416       
1417       return r_;
1418     }
1419 };
1420
1421 /** Abstracts signal emission.
1422  * This template specialization implements an optimized emit()
1423  * function for the case that no accumulator is used and the
1424  * return type is @p void.
1425  */
1426 template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
1427 struct signal_emit6<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>
1428 {
1429   typedef signal_emit6<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil> self_type;
1430   typedef void result_type;
1431   typedef slot<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> slot_type;
1432   typedef signal_impl::const_iterator_type iterator_type;
1433   typedef typename slot_type::call_type call_type;
1434
1435   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1436    * The arguments are passed directly on to the slots.
1437    * @param first An iterator pointing to the first slot in the list.
1438    * @param last An iterator pointing to the last slot in the list.
1439    * @param _A_a1 Argument to be passed on to the slots.
1440    * @param _A_a2 Argument to be passed on to the slots.
1441    * @param _A_a3 Argument to be passed on to the slots.
1442    * @param _A_a4 Argument to be passed on to the slots.
1443    * @param _A_a5 Argument to be passed on to the slots.
1444    * @param _A_a6 Argument to be passed on to the slots.
1445    */
1446   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6)
1447     {
1448       if (!impl || impl->slots_.empty()) return;
1449       signal_exec exec(impl);
1450       temp_slot_list slots(impl->slots_);
1451
1452       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1453         {
1454           if (it->empty() || it->blocked())
1455             continue;
1456           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
1457         }
1458     }
1459 };
1460
1461 /** Abstracts signal emission.
1462  * This template implements the emit() function of signal7.
1463  * Template specializations are available to optimize signal
1464  * emission when no accumulator is used, i.e. the template
1465  * argument @e T_accumulator is @p nil.
1466  */
1467 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_accumulator>
1468 struct signal_emit7
1469 {
1470   typedef signal_emit7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator> self_type;
1471   typedef typename T_accumulator::result_type result_type;
1472   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> slot_type;
1473   typedef internal::slot_iterator_buf<self_type> slot_iterator_buf_type;
1474   typedef signal_impl::const_iterator_type iterator_type;
1475
1476   /** Instantiates the class.
1477    * The parameters are stored in member variables. operator()() passes
1478    * the values on to some slot.
1479    */
1480   signal_emit7(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) 
1481     : _A_a1_(_A_a1),_A_a2_(_A_a2),_A_a3_(_A_a3),_A_a4_(_A_a4),_A_a5_(_A_a5),_A_a6_(_A_a6),_A_a7_(_A_a7) {}
1482
1483
1484   /** Invokes a slot using the buffered parameter values.
1485    * @param _A_slot Some slot to invoke.
1486    * @return The slot's return value.
1487    */
1488   T_return operator()(const slot_type& _A_slot) const
1489     { return (reinterpret_cast<typename slot_type::call_type>(_A_slot.rep_->call_))(_A_slot.rep_, _A_a1_,_A_a2_,_A_a3_,_A_a4_,_A_a5_,_A_a6_,_A_a7_); }
1490
1491   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1492    * The arguments are buffered in a temporary instance of signal_emit7.
1493
1494    * @param _A_a1 Argument to be passed on to the slots.
1495    * @param _A_a2 Argument to be passed on to the slots.
1496    * @param _A_a3 Argument to be passed on to the slots.
1497    * @param _A_a4 Argument to be passed on to the slots.
1498    * @param _A_a5 Argument to be passed on to the slots.
1499    * @param _A_a6 Argument to be passed on to the slots.
1500    * @param _A_a7 Argument to be passed on to the slots.
1501    * @return The accumulated return values of the slot invocations as processed by the accumulator.
1502    */
1503   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7)
1504     {
1505       T_accumulator accumulator;
1506
1507       if (!impl)
1508         return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1509
1510       signal_exec exec(impl);
1511       temp_slot_list slots(impl->slots_);
1512
1513       self_type self (_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
1514       return accumulator(slot_iterator_buf_type(slots.begin(), &self),
1515                          slot_iterator_buf_type(slots.end(), &self));
1516     }
1517   
1518   typename type_trait<T_arg1>::take _A_a1_;
1519   typename type_trait<T_arg2>::take _A_a2_;
1520   typename type_trait<T_arg3>::take _A_a3_;
1521   typename type_trait<T_arg4>::take _A_a4_;
1522   typename type_trait<T_arg5>::take _A_a5_;
1523   typename type_trait<T_arg6>::take _A_a6_;
1524   typename type_trait<T_arg7>::take _A_a7_;
1525 };
1526
1527 /** Abstracts signal emission.
1528  * This template specialization implements an optimized emit()
1529  * function for the case that no accumulator is used.
1530  */
1531 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
1532 struct signal_emit7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, nil>
1533 {
1534   typedef signal_emit7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, nil > self_type;
1535   typedef T_return result_type;
1536   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> slot_type;
1537   typedef signal_impl::const_iterator_type iterator_type;
1538   typedef typename slot_type::call_type call_type;
1539
1540   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1541    * The arguments are passed directly on to the slots.
1542    * The return value of the last slot invoked is returned.
1543    * @param first An iterator pointing to the first slot in the list.
1544    * @param last An iterator pointing to the last slot in the list.
1545    * @param _A_a1 Argument to be passed on to the slots.
1546    * @param _A_a2 Argument to be passed on to the slots.
1547    * @param _A_a3 Argument to be passed on to the slots.
1548    * @param _A_a4 Argument to be passed on to the slots.
1549    * @param _A_a5 Argument to be passed on to the slots.
1550    * @param _A_a6 Argument to be passed on to the slots.
1551    * @param _A_a7 Argument to be passed on to the slots.
1552    * @return The return value of the last slot invoked.
1553    */
1554   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7)
1555     {
1556       if (!impl || impl->slots_.empty())
1557         return T_return();
1558         
1559       signal_exec exec(impl);
1560       T_return r_ = T_return(); 
1561       
1562       //Use this scope to make sure that "slots" is destroyed before "exec" is destroyed.
1563       //This avoids a leak on MSVC++ - see http://bugzilla.gnome.org/show_bug.cgi?id=306249
1564       { 
1565         temp_slot_list slots(impl->slots_);
1566         iterator_type it = slots.begin();
1567         for (; it != slots.end(); ++it)
1568           if (!it->empty() && !it->blocked()) break;
1569           
1570         if (it == slots.end())
1571           return T_return(); // note that 'T_return r_();' doesn't work => define 'r_' after this line and initialize as follows:
1572   
1573         r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
1574         for (++it; it != slots.end(); ++it)
1575           {
1576             if (it->empty() || it->blocked())
1577               continue;
1578             r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
1579           }
1580       }
1581       
1582       return r_;
1583     }
1584 };
1585
1586 /** Abstracts signal emission.
1587  * This template specialization implements an optimized emit()
1588  * function for the case that no accumulator is used and the
1589  * return type is @p void.
1590  */
1591 template <class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
1592 struct signal_emit7<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, nil>
1593 {
1594   typedef signal_emit7<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, nil> self_type;
1595   typedef void result_type;
1596   typedef slot<void, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> slot_type;
1597   typedef signal_impl::const_iterator_type iterator_type;
1598   typedef typename slot_type::call_type call_type;
1599
1600   /** Executes a list of slots using an accumulator of type @e T_accumulator.
1601    * The arguments are passed directly on to the slots.
1602    * @param first An iterator pointing to the first slot in the list.
1603    * @param last An iterator pointing to the last slot in the list.
1604    * @param _A_a1 Argument to be passed on to the slots.
1605    * @param _A_a2 Argument to be passed on to the slots.
1606    * @param _A_a3 Argument to be passed on to the slots.
1607    * @param _A_a4 Argument to be passed on to the slots.
1608    * @param _A_a5 Argument to be passed on to the slots.
1609    * @param _A_a6 Argument to be passed on to the slots.
1610    * @param _A_a7 Argument to be passed on to the slots.
1611    */
1612   static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7)
1613     {
1614       if (!impl || impl->slots_.empty()) return;
1615       signal_exec exec(impl);
1616       temp_slot_list slots(impl->slots_);
1617
1618       for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1619         {
1620           if (it->empty() || it->blocked())
1621             continue;
1622           (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
1623         }
1624     }
1625 };
1626
1627
1628 } /* namespace internal */
1629
1630 /** Signal declaration.
1631  * signal0 can be used to connect() slots that are invoked
1632  * during subsequent calls to emit(). Any functor or slot
1633  * can be passed into connect(). It is converted into a slot
1634  * implicitely.
1635  *
1636  * If you want to connect one signal to another, use make_slot()
1637  * to retrieve a functor that emits the signal when invoked.
1638  *
1639  * Be careful if you directly pass one signal into the connect()
1640  * method of another: a shallow copy of the signal is made and
1641  * the signal's slots are not disconnected until both the signal
1642  * and its clone are destroyed which is probably not what you want!
1643  *
1644  * An STL-style list interface for the signal's list of slots
1645  * can be retrieved with slots(). This interface supports
1646  * iteration, insertion and removal of slots.
1647  *
1648  * The following template arguments are used:
1649  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
1650  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
1651  *
1652  * You should use the more convenient unnumbered sigc::signal template.
1653  *
1654  * @ingroup signal
1655  */
1656 template <class T_return, class T_accumulator=nil>
1657 class signal0
1658   : public signal_base
1659 {
1660 public:
1661   typedef internal::signal_emit0<T_return, T_accumulator> emitter_type;
1662   typedef typename emitter_type::result_type         result_type;
1663   typedef slot<T_return>    slot_type;
1664   typedef slot_list<slot_type>                       slot_list_type;
1665   typedef typename slot_list_type::iterator               iterator;
1666   typedef typename slot_list_type::const_iterator         const_iterator;
1667   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
1668   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
1669
1670 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
1671   /** This typedef is only for backwards-compatibility.
1672    * It is not available when using the SUN Forte compiler.
1673    * @deprecated slot_list_type;
1674    */
1675   typedef slot_list_type slot_list;
1676 #endif
1677
1678   /** Add a slot to the list of slots.
1679    * Any functor or slot may be passed into connect().
1680    * It will be converted into a slot implicitely.
1681    * The returned iterator may be stored for disconnection
1682    * of the slot at some later point. It stays valid until
1683    * the slot is removed from the list of slots. The iterator
1684    * can also be implicitely converted into a sigc::connection object
1685    * that may be used safely beyond the life time of the slot.
1686    * @param slot_ The slot to add to the list of slots.
1687    * @return An iterator pointing to the new slot in the list.
1688    */
1689   iterator connect(const slot_type& slot_)
1690     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
1691
1692   /** Triggers the emission of the signal.
1693    * During signal emission all slots that have been connected
1694    * to the signal are invoked unless they are manually set into
1695    * a blocking state. The parameters are passed on to the slots.
1696    * If @e T_accumulated is not @p nil, an accumulator of this type
1697    * is used to process the return values of the slot invocations.
1698    * Otherwise, the return value of the last slot invoked is returned.
1699    * @return The accumulated return values of the slot invocations.
1700    */
1701   result_type emit() const
1702     { return emitter_type::emit(impl_); }
1703
1704   /** Triggers the emission of the signal (see emit()). */
1705   result_type operator()() const
1706     { return emit(); }
1707
1708   /** Creates a functor that calls emit() on this signal.
1709    * @code
1710    * sigc::mem_fun(mysignal, &sigc::signal0::emit)
1711    * @endcode
1712    * yields the same result.
1713    * @return A functor that calls emit() on this signal.
1714    */
1715   bound_const_mem_functor0<result_type, signal0> make_slot() const
1716     { return bound_const_mem_functor0<result_type, signal0>(this, &signal0::emit); }
1717
1718   /** Creates an STL-style interface for the signal's list of slots.
1719    * This interface supports iteration, insertion and removal of slots.
1720    * @return An STL-style interface for the signal's list of slots.
1721    */
1722   slot_list_type slots()
1723     { return slot_list_type(impl()); }
1724
1725   /** Creates an STL-style interface for the signal's list of slots.
1726    * This interface supports iteration, insertion and removal of slots.
1727    * @return An STL-style interface for the signal's list of slots.
1728    */
1729   const slot_list_type slots() const
1730     { return slot_list_type(const_cast<signal0*>(this)->impl()); }
1731
1732   signal0() {}
1733
1734   signal0(const signal0& src)
1735     : signal_base(src) {}
1736 };
1737
1738 /** Signal declaration.
1739  * signal1 can be used to connect() slots that are invoked
1740  * during subsequent calls to emit(). Any functor or slot
1741  * can be passed into connect(). It is converted into a slot
1742  * implicitely.
1743  *
1744  * If you want to connect one signal to another, use make_slot()
1745  * to retrieve a functor that emits the signal when invoked.
1746  *
1747  * Be careful if you directly pass one signal into the connect()
1748  * method of another: a shallow copy of the signal is made and
1749  * the signal's slots are not disconnected until both the signal
1750  * and its clone are destroyed which is probably not what you want!
1751  *
1752  * An STL-style list interface for the signal's list of slots
1753  * can be retrieved with slots(). This interface supports
1754  * iteration, insertion and removal of slots.
1755  *
1756  * The following template arguments are used:
1757  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
1758  * - @e T_arg1 Argument type used in the definition of emit().
1759  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
1760  *
1761  * You should use the more convenient unnumbered sigc::signal template.
1762  *
1763  * @ingroup signal
1764  */
1765 template <class T_return, class T_arg1, class T_accumulator=nil>
1766 class signal1
1767   : public signal_base
1768 {
1769 public:
1770   typedef internal::signal_emit1<T_return, T_arg1, T_accumulator> emitter_type;
1771   typedef typename emitter_type::result_type         result_type;
1772   typedef slot<T_return, T_arg1>    slot_type;
1773   typedef slot_list<slot_type>                       slot_list_type;
1774   typedef typename slot_list_type::iterator               iterator;
1775   typedef typename slot_list_type::const_iterator         const_iterator;
1776   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
1777   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
1778
1779 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
1780   /** This typedef is only for backwards-compatibility.
1781    * It is not available when using the SUN Forte compiler.
1782    * @deprecated slot_list_type;
1783    */
1784   typedef slot_list_type slot_list;
1785 #endif
1786
1787   /** Add a slot to the list of slots.
1788    * Any functor or slot may be passed into connect().
1789    * It will be converted into a slot implicitely.
1790    * The returned iterator may be stored for disconnection
1791    * of the slot at some later point. It stays valid until
1792    * the slot is removed from the list of slots. The iterator
1793    * can also be implicitely converted into a sigc::connection object
1794    * that may be used safely beyond the life time of the slot.
1795    * @param slot_ The slot to add to the list of slots.
1796    * @return An iterator pointing to the new slot in the list.
1797    */
1798   iterator connect(const slot_type& slot_)
1799     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
1800
1801   /** Triggers the emission of the signal.
1802    * During signal emission all slots that have been connected
1803    * to the signal are invoked unless they are manually set into
1804    * a blocking state. The parameters are passed on to the slots.
1805    * If @e T_accumulated is not @p nil, an accumulator of this type
1806    * is used to process the return values of the slot invocations.
1807    * Otherwise, the return value of the last slot invoked is returned.
1808    * @param _A_a1 Argument to be passed on to the slots.
1809    * @return The accumulated return values of the slot invocations.
1810    */
1811   result_type emit(typename type_trait<T_arg1>::take _A_a1) const
1812     { return emitter_type::emit(impl_, _A_a1); }
1813
1814   /** Triggers the emission of the signal (see emit()). */
1815   result_type operator()(typename type_trait<T_arg1>::take _A_a1) const
1816     { return emit(_A_a1); }
1817
1818   /** Creates a functor that calls emit() on this signal.
1819    * @code
1820    * sigc::mem_fun(mysignal, &sigc::signal1::emit)
1821    * @endcode
1822    * yields the same result.
1823    * @return A functor that calls emit() on this signal.
1824    */
1825   bound_const_mem_functor1<result_type, signal1, typename type_trait<T_arg1>::take> make_slot() const
1826     { return bound_const_mem_functor1<result_type, signal1, typename type_trait<T_arg1>::take>(this, &signal1::emit); }
1827
1828   /** Creates an STL-style interface for the signal's list of slots.
1829    * This interface supports iteration, insertion and removal of slots.
1830    * @return An STL-style interface for the signal's list of slots.
1831    */
1832   slot_list_type slots()
1833     { return slot_list_type(impl()); }
1834
1835   /** Creates an STL-style interface for the signal's list of slots.
1836    * This interface supports iteration, insertion and removal of slots.
1837    * @return An STL-style interface for the signal's list of slots.
1838    */
1839   const slot_list_type slots() const
1840     { return slot_list_type(const_cast<signal1*>(this)->impl()); }
1841
1842   signal1() {}
1843
1844   signal1(const signal1& src)
1845     : signal_base(src) {}
1846 };
1847
1848 /** Signal declaration.
1849  * signal2 can be used to connect() slots that are invoked
1850  * during subsequent calls to emit(). Any functor or slot
1851  * can be passed into connect(). It is converted into a slot
1852  * implicitely.
1853  *
1854  * If you want to connect one signal to another, use make_slot()
1855  * to retrieve a functor that emits the signal when invoked.
1856  *
1857  * Be careful if you directly pass one signal into the connect()
1858  * method of another: a shallow copy of the signal is made and
1859  * the signal's slots are not disconnected until both the signal
1860  * and its clone are destroyed which is probably not what you want!
1861  *
1862  * An STL-style list interface for the signal's list of slots
1863  * can be retrieved with slots(). This interface supports
1864  * iteration, insertion and removal of slots.
1865  *
1866  * The following template arguments are used:
1867  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
1868  * - @e T_arg1 Argument type used in the definition of emit().
1869  * - @e T_arg2 Argument type used in the definition of emit().
1870  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
1871  *
1872  * You should use the more convenient unnumbered sigc::signal template.
1873  *
1874  * @ingroup signal
1875  */
1876 template <class T_return, class T_arg1,class T_arg2, class T_accumulator=nil>
1877 class signal2
1878   : public signal_base
1879 {
1880 public:
1881   typedef internal::signal_emit2<T_return, T_arg1,T_arg2, T_accumulator> emitter_type;
1882   typedef typename emitter_type::result_type         result_type;
1883   typedef slot<T_return, T_arg1,T_arg2>    slot_type;
1884   typedef slot_list<slot_type>                       slot_list_type;
1885   typedef typename slot_list_type::iterator               iterator;
1886   typedef typename slot_list_type::const_iterator         const_iterator;
1887   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
1888   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
1889
1890 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
1891   /** This typedef is only for backwards-compatibility.
1892    * It is not available when using the SUN Forte compiler.
1893    * @deprecated slot_list_type;
1894    */
1895   typedef slot_list_type slot_list;
1896 #endif
1897
1898   /** Add a slot to the list of slots.
1899    * Any functor or slot may be passed into connect().
1900    * It will be converted into a slot implicitely.
1901    * The returned iterator may be stored for disconnection
1902    * of the slot at some later point. It stays valid until
1903    * the slot is removed from the list of slots. The iterator
1904    * can also be implicitely converted into a sigc::connection object
1905    * that may be used safely beyond the life time of the slot.
1906    * @param slot_ The slot to add to the list of slots.
1907    * @return An iterator pointing to the new slot in the list.
1908    */
1909   iterator connect(const slot_type& slot_)
1910     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
1911
1912   /** Triggers the emission of the signal.
1913    * During signal emission all slots that have been connected
1914    * to the signal are invoked unless they are manually set into
1915    * a blocking state. The parameters are passed on to the slots.
1916    * If @e T_accumulated is not @p nil, an accumulator of this type
1917    * is used to process the return values of the slot invocations.
1918    * Otherwise, the return value of the last slot invoked is returned.
1919    * @param _A_a1 Argument to be passed on to the slots.
1920    * @param _A_a2 Argument to be passed on to the slots.
1921    * @return The accumulated return values of the slot invocations.
1922    */
1923   result_type emit(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) const
1924     { return emitter_type::emit(impl_, _A_a1,_A_a2); }
1925
1926   /** Triggers the emission of the signal (see emit()). */
1927   result_type operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2) const
1928     { return emit(_A_a1,_A_a2); }
1929
1930   /** Creates a functor that calls emit() on this signal.
1931    * @code
1932    * sigc::mem_fun(mysignal, &sigc::signal2::emit)
1933    * @endcode
1934    * yields the same result.
1935    * @return A functor that calls emit() on this signal.
1936    */
1937   bound_const_mem_functor2<result_type, signal2, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take> make_slot() const
1938     { return bound_const_mem_functor2<result_type, signal2, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take>(this, &signal2::emit); }
1939
1940   /** Creates an STL-style interface for the signal's list of slots.
1941    * This interface supports iteration, insertion and removal of slots.
1942    * @return An STL-style interface for the signal's list of slots.
1943    */
1944   slot_list_type slots()
1945     { return slot_list_type(impl()); }
1946
1947   /** Creates an STL-style interface for the signal's list of slots.
1948    * This interface supports iteration, insertion and removal of slots.
1949    * @return An STL-style interface for the signal's list of slots.
1950    */
1951   const slot_list_type slots() const
1952     { return slot_list_type(const_cast<signal2*>(this)->impl()); }
1953
1954   signal2() {}
1955
1956   signal2(const signal2& src)
1957     : signal_base(src) {}
1958 };
1959
1960 /** Signal declaration.
1961  * signal3 can be used to connect() slots that are invoked
1962  * during subsequent calls to emit(). Any functor or slot
1963  * can be passed into connect(). It is converted into a slot
1964  * implicitely.
1965  *
1966  * If you want to connect one signal to another, use make_slot()
1967  * to retrieve a functor that emits the signal when invoked.
1968  *
1969  * Be careful if you directly pass one signal into the connect()
1970  * method of another: a shallow copy of the signal is made and
1971  * the signal's slots are not disconnected until both the signal
1972  * and its clone are destroyed which is probably not what you want!
1973  *
1974  * An STL-style list interface for the signal's list of slots
1975  * can be retrieved with slots(). This interface supports
1976  * iteration, insertion and removal of slots.
1977  *
1978  * The following template arguments are used:
1979  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
1980  * - @e T_arg1 Argument type used in the definition of emit().
1981  * - @e T_arg2 Argument type used in the definition of emit().
1982  * - @e T_arg3 Argument type used in the definition of emit().
1983  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
1984  *
1985  * You should use the more convenient unnumbered sigc::signal template.
1986  *
1987  * @ingroup signal
1988  */
1989 template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_accumulator=nil>
1990 class signal3
1991   : public signal_base
1992 {
1993 public:
1994   typedef internal::signal_emit3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator> emitter_type;
1995   typedef typename emitter_type::result_type         result_type;
1996   typedef slot<T_return, T_arg1,T_arg2,T_arg3>    slot_type;
1997   typedef slot_list<slot_type>                       slot_list_type;
1998   typedef typename slot_list_type::iterator               iterator;
1999   typedef typename slot_list_type::const_iterator         const_iterator;
2000   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
2001   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
2002
2003 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
2004   /** This typedef is only for backwards-compatibility.
2005    * It is not available when using the SUN Forte compiler.
2006    * @deprecated slot_list_type;
2007    */
2008   typedef slot_list_type slot_list;
2009 #endif
2010
2011   /** Add a slot to the list of slots.
2012    * Any functor or slot may be passed into connect().
2013    * It will be converted into a slot implicitely.
2014    * The returned iterator may be stored for disconnection
2015    * of the slot at some later point. It stays valid until
2016    * the slot is removed from the list of slots. The iterator
2017    * can also be implicitely converted into a sigc::connection object
2018    * that may be used safely beyond the life time of the slot.
2019    * @param slot_ The slot to add to the list of slots.
2020    * @return An iterator pointing to the new slot in the list.
2021    */
2022   iterator connect(const slot_type& slot_)
2023     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
2024
2025   /** Triggers the emission of the signal.
2026    * During signal emission all slots that have been connected
2027    * to the signal are invoked unless they are manually set into
2028    * a blocking state. The parameters are passed on to the slots.
2029    * If @e T_accumulated is not @p nil, an accumulator of this type
2030    * is used to process the return values of the slot invocations.
2031    * Otherwise, the return value of the last slot invoked is returned.
2032    * @param _A_a1 Argument to be passed on to the slots.
2033    * @param _A_a2 Argument to be passed on to the slots.
2034    * @param _A_a3 Argument to be passed on to the slots.
2035    * @return The accumulated return values of the slot invocations.
2036    */
2037   result_type emit(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) const
2038     { return emitter_type::emit(impl_, _A_a1,_A_a2,_A_a3); }
2039
2040   /** Triggers the emission of the signal (see emit()). */
2041   result_type operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3) const
2042     { return emit(_A_a1,_A_a2,_A_a3); }
2043
2044   /** Creates a functor that calls emit() on this signal.
2045    * @code
2046    * sigc::mem_fun(mysignal, &sigc::signal3::emit)
2047    * @endcode
2048    * yields the same result.
2049    * @return A functor that calls emit() on this signal.
2050    */
2051   bound_const_mem_functor3<result_type, signal3, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take> make_slot() const
2052     { return bound_const_mem_functor3<result_type, signal3, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take>(this, &signal3::emit); }
2053
2054   /** Creates an STL-style interface for the signal's list of slots.
2055    * This interface supports iteration, insertion and removal of slots.
2056    * @return An STL-style interface for the signal's list of slots.
2057    */
2058   slot_list_type slots()
2059     { return slot_list_type(impl()); }
2060
2061   /** Creates an STL-style interface for the signal's list of slots.
2062    * This interface supports iteration, insertion and removal of slots.
2063    * @return An STL-style interface for the signal's list of slots.
2064    */
2065   const slot_list_type slots() const
2066     { return slot_list_type(const_cast<signal3*>(this)->impl()); }
2067
2068   signal3() {}
2069
2070   signal3(const signal3& src)
2071     : signal_base(src) {}
2072 };
2073
2074 /** Signal declaration.
2075  * signal4 can be used to connect() slots that are invoked
2076  * during subsequent calls to emit(). Any functor or slot
2077  * can be passed into connect(). It is converted into a slot
2078  * implicitely.
2079  *
2080  * If you want to connect one signal to another, use make_slot()
2081  * to retrieve a functor that emits the signal when invoked.
2082  *
2083  * Be careful if you directly pass one signal into the connect()
2084  * method of another: a shallow copy of the signal is made and
2085  * the signal's slots are not disconnected until both the signal
2086  * and its clone are destroyed which is probably not what you want!
2087  *
2088  * An STL-style list interface for the signal's list of slots
2089  * can be retrieved with slots(). This interface supports
2090  * iteration, insertion and removal of slots.
2091  *
2092  * The following template arguments are used:
2093  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2094  * - @e T_arg1 Argument type used in the definition of emit().
2095  * - @e T_arg2 Argument type used in the definition of emit().
2096  * - @e T_arg3 Argument type used in the definition of emit().
2097  * - @e T_arg4 Argument type used in the definition of emit().
2098  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
2099  *
2100  * You should use the more convenient unnumbered sigc::signal template.
2101  *
2102  * @ingroup signal
2103  */
2104 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_accumulator=nil>
2105 class signal4
2106   : public signal_base
2107 {
2108 public:
2109   typedef internal::signal_emit4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator> emitter_type;
2110   typedef typename emitter_type::result_type         result_type;
2111   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4>    slot_type;
2112   typedef slot_list<slot_type>                       slot_list_type;
2113   typedef typename slot_list_type::iterator               iterator;
2114   typedef typename slot_list_type::const_iterator         const_iterator;
2115   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
2116   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
2117
2118 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
2119   /** This typedef is only for backwards-compatibility.
2120    * It is not available when using the SUN Forte compiler.
2121    * @deprecated slot_list_type;
2122    */
2123   typedef slot_list_type slot_list;
2124 #endif
2125
2126   /** Add a slot to the list of slots.
2127    * Any functor or slot may be passed into connect().
2128    * It will be converted into a slot implicitely.
2129    * The returned iterator may be stored for disconnection
2130    * of the slot at some later point. It stays valid until
2131    * the slot is removed from the list of slots. The iterator
2132    * can also be implicitely converted into a sigc::connection object
2133    * that may be used safely beyond the life time of the slot.
2134    * @param slot_ The slot to add to the list of slots.
2135    * @return An iterator pointing to the new slot in the list.
2136    */
2137   iterator connect(const slot_type& slot_)
2138     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
2139
2140   /** Triggers the emission of the signal.
2141    * During signal emission all slots that have been connected
2142    * to the signal are invoked unless they are manually set into
2143    * a blocking state. The parameters are passed on to the slots.
2144    * If @e T_accumulated is not @p nil, an accumulator of this type
2145    * is used to process the return values of the slot invocations.
2146    * Otherwise, the return value of the last slot invoked is returned.
2147    * @param _A_a1 Argument to be passed on to the slots.
2148    * @param _A_a2 Argument to be passed on to the slots.
2149    * @param _A_a3 Argument to be passed on to the slots.
2150    * @param _A_a4 Argument to be passed on to the slots.
2151    * @return The accumulated return values of the slot invocations.
2152    */
2153   result_type emit(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) const
2154     { return emitter_type::emit(impl_, _A_a1,_A_a2,_A_a3,_A_a4); }
2155
2156   /** Triggers the emission of the signal (see emit()). */
2157   result_type operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4) const
2158     { return emit(_A_a1,_A_a2,_A_a3,_A_a4); }
2159
2160   /** Creates a functor that calls emit() on this signal.
2161    * @code
2162    * sigc::mem_fun(mysignal, &sigc::signal4::emit)
2163    * @endcode
2164    * yields the same result.
2165    * @return A functor that calls emit() on this signal.
2166    */
2167   bound_const_mem_functor4<result_type, signal4, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take> make_slot() const
2168     { return bound_const_mem_functor4<result_type, signal4, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take>(this, &signal4::emit); }
2169
2170   /** Creates an STL-style interface for the signal's list of slots.
2171    * This interface supports iteration, insertion and removal of slots.
2172    * @return An STL-style interface for the signal's list of slots.
2173    */
2174   slot_list_type slots()
2175     { return slot_list_type(impl()); }
2176
2177   /** Creates an STL-style interface for the signal's list of slots.
2178    * This interface supports iteration, insertion and removal of slots.
2179    * @return An STL-style interface for the signal's list of slots.
2180    */
2181   const slot_list_type slots() const
2182     { return slot_list_type(const_cast<signal4*>(this)->impl()); }
2183
2184   signal4() {}
2185
2186   signal4(const signal4& src)
2187     : signal_base(src) {}
2188 };
2189
2190 /** Signal declaration.
2191  * signal5 can be used to connect() slots that are invoked
2192  * during subsequent calls to emit(). Any functor or slot
2193  * can be passed into connect(). It is converted into a slot
2194  * implicitely.
2195  *
2196  * If you want to connect one signal to another, use make_slot()
2197  * to retrieve a functor that emits the signal when invoked.
2198  *
2199  * Be careful if you directly pass one signal into the connect()
2200  * method of another: a shallow copy of the signal is made and
2201  * the signal's slots are not disconnected until both the signal
2202  * and its clone are destroyed which is probably not what you want!
2203  *
2204  * An STL-style list interface for the signal's list of slots
2205  * can be retrieved with slots(). This interface supports
2206  * iteration, insertion and removal of slots.
2207  *
2208  * The following template arguments are used:
2209  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2210  * - @e T_arg1 Argument type used in the definition of emit().
2211  * - @e T_arg2 Argument type used in the definition of emit().
2212  * - @e T_arg3 Argument type used in the definition of emit().
2213  * - @e T_arg4 Argument type used in the definition of emit().
2214  * - @e T_arg5 Argument type used in the definition of emit().
2215  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
2216  *
2217  * You should use the more convenient unnumbered sigc::signal template.
2218  *
2219  * @ingroup signal
2220  */
2221 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_accumulator=nil>
2222 class signal5
2223   : public signal_base
2224 {
2225 public:
2226   typedef internal::signal_emit5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator> emitter_type;
2227   typedef typename emitter_type::result_type         result_type;
2228   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>    slot_type;
2229   typedef slot_list<slot_type>                       slot_list_type;
2230   typedef typename slot_list_type::iterator               iterator;
2231   typedef typename slot_list_type::const_iterator         const_iterator;
2232   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
2233   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
2234
2235 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
2236   /** This typedef is only for backwards-compatibility.
2237    * It is not available when using the SUN Forte compiler.
2238    * @deprecated slot_list_type;
2239    */
2240   typedef slot_list_type slot_list;
2241 #endif
2242
2243   /** Add a slot to the list of slots.
2244    * Any functor or slot may be passed into connect().
2245    * It will be converted into a slot implicitely.
2246    * The returned iterator may be stored for disconnection
2247    * of the slot at some later point. It stays valid until
2248    * the slot is removed from the list of slots. The iterator
2249    * can also be implicitely converted into a sigc::connection object
2250    * that may be used safely beyond the life time of the slot.
2251    * @param slot_ The slot to add to the list of slots.
2252    * @return An iterator pointing to the new slot in the list.
2253    */
2254   iterator connect(const slot_type& slot_)
2255     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
2256
2257   /** Triggers the emission of the signal.
2258    * During signal emission all slots that have been connected
2259    * to the signal are invoked unless they are manually set into
2260    * a blocking state. The parameters are passed on to the slots.
2261    * If @e T_accumulated is not @p nil, an accumulator of this type
2262    * is used to process the return values of the slot invocations.
2263    * Otherwise, the return value of the last slot invoked is returned.
2264    * @param _A_a1 Argument to be passed on to the slots.
2265    * @param _A_a2 Argument to be passed on to the slots.
2266    * @param _A_a3 Argument to be passed on to the slots.
2267    * @param _A_a4 Argument to be passed on to the slots.
2268    * @param _A_a5 Argument to be passed on to the slots.
2269    * @return The accumulated return values of the slot invocations.
2270    */
2271   result_type emit(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) const
2272     { return emitter_type::emit(impl_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
2273
2274   /** Triggers the emission of the signal (see emit()). */
2275   result_type operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5) const
2276     { return emit(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5); }
2277
2278   /** Creates a functor that calls emit() on this signal.
2279    * @code
2280    * sigc::mem_fun(mysignal, &sigc::signal5::emit)
2281    * @endcode
2282    * yields the same result.
2283    * @return A functor that calls emit() on this signal.
2284    */
2285   bound_const_mem_functor5<result_type, signal5, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take,typename type_trait<T_arg5>::take> make_slot() const
2286     { return bound_const_mem_functor5<result_type, signal5, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take,typename type_trait<T_arg5>::take>(this, &signal5::emit); }
2287
2288   /** Creates an STL-style interface for the signal's list of slots.
2289    * This interface supports iteration, insertion and removal of slots.
2290    * @return An STL-style interface for the signal's list of slots.
2291    */
2292   slot_list_type slots()
2293     { return slot_list_type(impl()); }
2294
2295   /** Creates an STL-style interface for the signal's list of slots.
2296    * This interface supports iteration, insertion and removal of slots.
2297    * @return An STL-style interface for the signal's list of slots.
2298    */
2299   const slot_list_type slots() const
2300     { return slot_list_type(const_cast<signal5*>(this)->impl()); }
2301
2302   signal5() {}
2303
2304   signal5(const signal5& src)
2305     : signal_base(src) {}
2306 };
2307
2308 /** Signal declaration.
2309  * signal6 can be used to connect() slots that are invoked
2310  * during subsequent calls to emit(). Any functor or slot
2311  * can be passed into connect(). It is converted into a slot
2312  * implicitely.
2313  *
2314  * If you want to connect one signal to another, use make_slot()
2315  * to retrieve a functor that emits the signal when invoked.
2316  *
2317  * Be careful if you directly pass one signal into the connect()
2318  * method of another: a shallow copy of the signal is made and
2319  * the signal's slots are not disconnected until both the signal
2320  * and its clone are destroyed which is probably not what you want!
2321  *
2322  * An STL-style list interface for the signal's list of slots
2323  * can be retrieved with slots(). This interface supports
2324  * iteration, insertion and removal of slots.
2325  *
2326  * The following template arguments are used:
2327  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2328  * - @e T_arg1 Argument type used in the definition of emit().
2329  * - @e T_arg2 Argument type used in the definition of emit().
2330  * - @e T_arg3 Argument type used in the definition of emit().
2331  * - @e T_arg4 Argument type used in the definition of emit().
2332  * - @e T_arg5 Argument type used in the definition of emit().
2333  * - @e T_arg6 Argument type used in the definition of emit().
2334  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
2335  *
2336  * You should use the more convenient unnumbered sigc::signal template.
2337  *
2338  * @ingroup signal
2339  */
2340 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_accumulator=nil>
2341 class signal6
2342   : public signal_base
2343 {
2344 public:
2345   typedef internal::signal_emit6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator> emitter_type;
2346   typedef typename emitter_type::result_type         result_type;
2347   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>    slot_type;
2348   typedef slot_list<slot_type>                       slot_list_type;
2349   typedef typename slot_list_type::iterator               iterator;
2350   typedef typename slot_list_type::const_iterator         const_iterator;
2351   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
2352   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
2353
2354 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
2355   /** This typedef is only for backwards-compatibility.
2356    * It is not available when using the SUN Forte compiler.
2357    * @deprecated slot_list_type;
2358    */
2359   typedef slot_list_type slot_list;
2360 #endif
2361
2362   /** Add a slot to the list of slots.
2363    * Any functor or slot may be passed into connect().
2364    * It will be converted into a slot implicitely.
2365    * The returned iterator may be stored for disconnection
2366    * of the slot at some later point. It stays valid until
2367    * the slot is removed from the list of slots. The iterator
2368    * can also be implicitely converted into a sigc::connection object
2369    * that may be used safely beyond the life time of the slot.
2370    * @param slot_ The slot to add to the list of slots.
2371    * @return An iterator pointing to the new slot in the list.
2372    */
2373   iterator connect(const slot_type& slot_)
2374     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
2375
2376   /** Triggers the emission of the signal.
2377    * During signal emission all slots that have been connected
2378    * to the signal are invoked unless they are manually set into
2379    * a blocking state. The parameters are passed on to the slots.
2380    * If @e T_accumulated is not @p nil, an accumulator of this type
2381    * is used to process the return values of the slot invocations.
2382    * Otherwise, the return value of the last slot invoked is returned.
2383    * @param _A_a1 Argument to be passed on to the slots.
2384    * @param _A_a2 Argument to be passed on to the slots.
2385    * @param _A_a3 Argument to be passed on to the slots.
2386    * @param _A_a4 Argument to be passed on to the slots.
2387    * @param _A_a5 Argument to be passed on to the slots.
2388    * @param _A_a6 Argument to be passed on to the slots.
2389    * @return The accumulated return values of the slot invocations.
2390    */
2391   result_type emit(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) const
2392     { return emitter_type::emit(impl_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
2393
2394   /** Triggers the emission of the signal (see emit()). */
2395   result_type operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6) const
2396     { return emit(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6); }
2397
2398   /** Creates a functor that calls emit() on this signal.
2399    * @code
2400    * sigc::mem_fun(mysignal, &sigc::signal6::emit)
2401    * @endcode
2402    * yields the same result.
2403    * @return A functor that calls emit() on this signal.
2404    */
2405   bound_const_mem_functor6<result_type, signal6, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take,typename type_trait<T_arg5>::take,typename type_trait<T_arg6>::take> make_slot() const
2406     { return bound_const_mem_functor6<result_type, signal6, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take,typename type_trait<T_arg5>::take,typename type_trait<T_arg6>::take>(this, &signal6::emit); }
2407
2408   /** Creates an STL-style interface for the signal's list of slots.
2409    * This interface supports iteration, insertion and removal of slots.
2410    * @return An STL-style interface for the signal's list of slots.
2411    */
2412   slot_list_type slots()
2413     { return slot_list_type(impl()); }
2414
2415   /** Creates an STL-style interface for the signal's list of slots.
2416    * This interface supports iteration, insertion and removal of slots.
2417    * @return An STL-style interface for the signal's list of slots.
2418    */
2419   const slot_list_type slots() const
2420     { return slot_list_type(const_cast<signal6*>(this)->impl()); }
2421
2422   signal6() {}
2423
2424   signal6(const signal6& src)
2425     : signal_base(src) {}
2426 };
2427
2428 /** Signal declaration.
2429  * signal7 can be used to connect() slots that are invoked
2430  * during subsequent calls to emit(). Any functor or slot
2431  * can be passed into connect(). It is converted into a slot
2432  * implicitely.
2433  *
2434  * If you want to connect one signal to another, use make_slot()
2435  * to retrieve a functor that emits the signal when invoked.
2436  *
2437  * Be careful if you directly pass one signal into the connect()
2438  * method of another: a shallow copy of the signal is made and
2439  * the signal's slots are not disconnected until both the signal
2440  * and its clone are destroyed which is probably not what you want!
2441  *
2442  * An STL-style list interface for the signal's list of slots
2443  * can be retrieved with slots(). This interface supports
2444  * iteration, insertion and removal of slots.
2445  *
2446  * The following template arguments are used:
2447  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2448  * - @e T_arg1 Argument type used in the definition of emit().
2449  * - @e T_arg2 Argument type used in the definition of emit().
2450  * - @e T_arg3 Argument type used in the definition of emit().
2451  * - @e T_arg4 Argument type used in the definition of emit().
2452  * - @e T_arg5 Argument type used in the definition of emit().
2453  * - @e T_arg6 Argument type used in the definition of emit().
2454  * - @e T_arg7 Argument type used in the definition of emit().
2455  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used, i.e. signal emission returns the return value of the last slot invoked.
2456  *
2457  * You should use the more convenient unnumbered sigc::signal template.
2458  *
2459  * @ingroup signal
2460  */
2461 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_accumulator=nil>
2462 class signal7
2463   : public signal_base
2464 {
2465 public:
2466   typedef internal::signal_emit7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator> emitter_type;
2467   typedef typename emitter_type::result_type         result_type;
2468   typedef slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>    slot_type;
2469   typedef slot_list<slot_type>                       slot_list_type;
2470   typedef typename slot_list_type::iterator               iterator;
2471   typedef typename slot_list_type::const_iterator         const_iterator;
2472   typedef typename slot_list_type::reverse_iterator       reverse_iterator;
2473   typedef typename slot_list_type::const_reverse_iterator const_reverse_iterator;
2474
2475 #ifdef SIGC_TYPEDEF_REDEFINE_ALLOWED
2476   /** This typedef is only for backwards-compatibility.
2477    * It is not available when using the SUN Forte compiler.
2478    * @deprecated slot_list_type;
2479    */
2480   typedef slot_list_type slot_list;
2481 #endif
2482
2483   /** Add a slot to the list of slots.
2484    * Any functor or slot may be passed into connect().
2485    * It will be converted into a slot implicitely.
2486    * The returned iterator may be stored for disconnection
2487    * of the slot at some later point. It stays valid until
2488    * the slot is removed from the list of slots. The iterator
2489    * can also be implicitely converted into a sigc::connection object
2490    * that may be used safely beyond the life time of the slot.
2491    * @param slot_ The slot to add to the list of slots.
2492    * @return An iterator pointing to the new slot in the list.
2493    */
2494   iterator connect(const slot_type& slot_)
2495     { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
2496
2497   /** Triggers the emission of the signal.
2498    * During signal emission all slots that have been connected
2499    * to the signal are invoked unless they are manually set into
2500    * a blocking state. The parameters are passed on to the slots.
2501    * If @e T_accumulated is not @p nil, an accumulator of this type
2502    * is used to process the return values of the slot invocations.
2503    * Otherwise, the return value of the last slot invoked is returned.
2504    * @param _A_a1 Argument to be passed on to the slots.
2505    * @param _A_a2 Argument to be passed on to the slots.
2506    * @param _A_a3 Argument to be passed on to the slots.
2507    * @param _A_a4 Argument to be passed on to the slots.
2508    * @param _A_a5 Argument to be passed on to the slots.
2509    * @param _A_a6 Argument to be passed on to the slots.
2510    * @param _A_a7 Argument to be passed on to the slots.
2511    * @return The accumulated return values of the slot invocations.
2512    */
2513   result_type emit(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) const
2514     { return emitter_type::emit(impl_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
2515
2516   /** Triggers the emission of the signal (see emit()). */
2517   result_type operator()(typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2,typename type_trait<T_arg3>::take _A_a3,typename type_trait<T_arg4>::take _A_a4,typename type_trait<T_arg5>::take _A_a5,typename type_trait<T_arg6>::take _A_a6,typename type_trait<T_arg7>::take _A_a7) const
2518     { return emit(_A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7); }
2519
2520   /** Creates a functor that calls emit() on this signal.
2521    * @code
2522    * sigc::mem_fun(mysignal, &sigc::signal7::emit)
2523    * @endcode
2524    * yields the same result.
2525    * @return A functor that calls emit() on this signal.
2526    */
2527   bound_const_mem_functor7<result_type, signal7, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take,typename type_trait<T_arg5>::take,typename type_trait<T_arg6>::take,typename type_trait<T_arg7>::take> make_slot() const
2528     { return bound_const_mem_functor7<result_type, signal7, typename type_trait<T_arg1>::take,typename type_trait<T_arg2>::take,typename type_trait<T_arg3>::take,typename type_trait<T_arg4>::take,typename type_trait<T_arg5>::take,typename type_trait<T_arg6>::take,typename type_trait<T_arg7>::take>(this, &signal7::emit); }
2529
2530   /** Creates an STL-style interface for the signal's list of slots.
2531    * This interface supports iteration, insertion and removal of slots.
2532    * @return An STL-style interface for the signal's list of slots.
2533    */
2534   slot_list_type slots()
2535     { return slot_list_type(impl()); }
2536
2537   /** Creates an STL-style interface for the signal's list of slots.
2538    * This interface supports iteration, insertion and removal of slots.
2539    * @return An STL-style interface for the signal's list of slots.
2540    */
2541   const slot_list_type slots() const
2542     { return slot_list_type(const_cast<signal7*>(this)->impl()); }
2543
2544   signal7() {}
2545
2546   signal7(const signal7& src)
2547     : signal_base(src) {}
2548 };
2549
2550
2551
2552 /** Convenience wrapper for the numbered sigc::signal# templates.
2553  * signal can be used to connect() slots that are invoked
2554  * during subsequent calls to emit(). Any functor or slot
2555  * can be passed into connect(). It is converted into a slot
2556  * implicitly.
2557  *
2558  * If you want to connect one signal to another, use make_slot()
2559  * to retrieve a functor that emits the signal when invoked.
2560  *
2561  * Be careful if you directly pass one signal into the connect()
2562  * method of another: a shallow copy of the signal is made and
2563  * the signal's slots are not disconnected until both the signal
2564  * and its clone are destroyed which is probably not what you want!
2565  *
2566  * An STL-style list interface for the signal's list of slots
2567  * can be retrieved with slots(). This interface supports
2568  * iteration, insertion and removal of slots.
2569  *
2570  * The template arguments determine the function signature of
2571  * the emit() function:
2572  * - @e T_return The desired return type of the emit() function.
2573  * - @e T_arg1 Argument type used in the definition of emit(). The default @p nil means no argument.
2574  * - @e T_arg2 Argument type used in the definition of emit(). The default @p nil means no argument.
2575  * - @e T_arg3 Argument type used in the definition of emit(). The default @p nil means no argument.
2576  * - @e T_arg4 Argument type used in the definition of emit(). The default @p nil means no argument.
2577  * - @e T_arg5 Argument type used in the definition of emit(). The default @p nil means no argument.
2578  * - @e T_arg6 Argument type used in the definition of emit(). The default @p nil means no argument.
2579  * - @e T_arg7 Argument type used in the definition of emit(). The default @p nil means no argument.
2580  *
2581  * To specify an accumulator type the nested class signal::accumulated can be used.
2582  *
2583  * @par Example:
2584  *   @code
2585  *   void foo(int) {}
2586  *   sigc::signal<void, long> sig;
2587  *   sig.connect(sigc::ptr_fun(&foo));
2588  *   sig.emit(19);
2589  *   @endcode
2590  *
2591  * @ingroup signal
2592  */
2593 template <class T_return, class T_arg1 = nil,class T_arg2 = nil,class T_arg3 = nil,class T_arg4 = nil,class T_arg5 = nil,class T_arg6 = nil,class T_arg7 = nil>
2594 class signal 
2595   : public signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, nil>
2596 {
2597 public:
2598   /** Convenience wrapper for the numbered sigc::signal# templates.
2599    * Like sigc::signal but the additional template parameter @e T_accumulator
2600    * defines the accumulator type that should be used.
2601    *
2602    * An accumulator is a functor that uses a pair of special iterators
2603    * to step through a list of slots and calculate a return value
2604    * from the results of the slot invokations. The iterators' operator*()
2605    * executes the slot. The return value is buffered, so that in an expression
2606    * like @code a = (*i) * (*i); @endcode the slot is executed only once.
2607    * The accumulator must define its return value as @p result_type.
2608    * 
2609    * @par Example 1:
2610    *   This accumulator calculates the arithmetic mean value:
2611    *   @code
2612    *   struct arithmetic_mean_accumulator
2613    *   {
2614    *     typedef double result_type;
2615    *     template<typename T_iterator>
2616    *     result_type operator()(T_iterator first, T_iterator last) const
2617    *     {
2618    *       result_type value_ = 0;
2619    *       int n_ = 0;
2620    *       for (; first != last; ++first, ++n_)
2621    *         value_ += *first;
2622    *       return value_ / n_;
2623    *     }
2624    *   };
2625    *   @endcode
2626    *
2627    * @par Example 2:
2628    *   This accumulator stops signal emission when a slot returns zero:
2629    *   @code
2630    *   struct interruptable_accumulator
2631    *   {
2632    *     typedef bool result_type;
2633    *     template<typename T_iterator>
2634    *     result_type operator()(T_iterator first, T_iterator last) const
2635    *     {
2636    *       for (; first != last; ++first, ++n_)
2637    *         if (!*first) return false;
2638    *       return true;
2639    *     }
2640    *   };
2641    *   @endcode
2642    *
2643    * @ingroup signal
2644    */
2645   template <class T_accumulator>
2646   class accumulated
2647     : public signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator>
2648   {
2649   public:
2650     accumulated() {}
2651     accumulated(const accumulated& src)
2652       : signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator>(src) {}
2653   };
2654
2655   signal() {}
2656   signal(const signal& src)
2657     : signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, nil>(src) {}
2658 };
2659
2660
2661
2662 /** Convenience wrapper for the numbered sigc::signal0 template.
2663  * See the base class for useful methods.
2664  * This is the template specialization of the unnumbered sigc::signal
2665  * template for 0 argument(s).
2666  */
2667 template <class T_return>
2668 class signal <T_return, nil,nil,nil,nil,nil,nil,nil>
2669   : public signal0<T_return, nil>
2670 {
2671 public:
2672
2673   /** Convenience wrapper for the numbered sigc::signal0 template.
2674    * Like sigc::signal but the additional template parameter @e T_accumulator
2675    * defines the accumulator type that should be used.
2676    */
2677   template <class T_accumulator>
2678   class accumulated
2679     : public signal0<T_return, T_accumulator>
2680   {
2681   public:
2682     accumulated() {}
2683     accumulated(const accumulated& src)
2684       : signal0<T_return, T_accumulator>(src) {}
2685   };
2686
2687   signal() {}
2688   signal(const signal& src)
2689     : signal0<T_return, nil>(src) {}
2690 };
2691
2692
2693 /** Convenience wrapper for the numbered sigc::signal1 template.
2694  * See the base class for useful methods.
2695  * This is the template specialization of the unnumbered sigc::signal
2696  * template for 1 argument(s).
2697  */
2698 template <class T_return, class T_arg1>
2699 class signal <T_return, T_arg1, nil,nil,nil,nil,nil,nil>
2700   : public signal1<T_return, T_arg1, nil>
2701 {
2702 public:
2703
2704   /** Convenience wrapper for the numbered sigc::signal1 template.
2705    * Like sigc::signal but the additional template parameter @e T_accumulator
2706    * defines the accumulator type that should be used.
2707    */
2708   template <class T_accumulator>
2709   class accumulated
2710     : public signal1<T_return, T_arg1, T_accumulator>
2711   {
2712   public:
2713     accumulated() {}
2714     accumulated(const accumulated& src)
2715       : signal1<T_return, T_arg1, T_accumulator>(src) {}
2716   };
2717
2718   signal() {}
2719   signal(const signal& src)
2720     : signal1<T_return, T_arg1, nil>(src) {}
2721 };
2722
2723
2724 /** Convenience wrapper for the numbered sigc::signal2 template.
2725  * See the base class for useful methods.
2726  * This is the template specialization of the unnumbered sigc::signal
2727  * template for 2 argument(s).
2728  */
2729 template <class T_return, class T_arg1,class T_arg2>
2730 class signal <T_return, T_arg1,T_arg2, nil,nil,nil,nil,nil>
2731   : public signal2<T_return, T_arg1,T_arg2, nil>
2732 {
2733 public:
2734
2735   /** Convenience wrapper for the numbered sigc::signal2 template.
2736    * Like sigc::signal but the additional template parameter @e T_accumulator
2737    * defines the accumulator type that should be used.
2738    */
2739   template <class T_accumulator>
2740   class accumulated
2741     : public signal2<T_return, T_arg1,T_arg2, T_accumulator>
2742   {
2743   public:
2744     accumulated() {}
2745     accumulated(const accumulated& src)
2746       : signal2<T_return, T_arg1,T_arg2, T_accumulator>(src) {}
2747   };
2748
2749   signal() {}
2750   signal(const signal& src)
2751     : signal2<T_return, T_arg1,T_arg2, nil>(src) {}
2752 };
2753
2754
2755 /** Convenience wrapper for the numbered sigc::signal3 template.
2756  * See the base class for useful methods.
2757  * This is the template specialization of the unnumbered sigc::signal
2758  * template for 3 argument(s).
2759  */
2760 template <class T_return, class T_arg1,class T_arg2,class T_arg3>
2761 class signal <T_return, T_arg1,T_arg2,T_arg3, nil,nil,nil,nil>
2762   : public signal3<T_return, T_arg1,T_arg2,T_arg3, nil>
2763 {
2764 public:
2765
2766   /** Convenience wrapper for the numbered sigc::signal3 template.
2767    * Like sigc::signal but the additional template parameter @e T_accumulator
2768    * defines the accumulator type that should be used.
2769    */
2770   template <class T_accumulator>
2771   class accumulated
2772     : public signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>
2773   {
2774   public:
2775     accumulated() {}
2776     accumulated(const accumulated& src)
2777       : signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>(src) {}
2778   };
2779
2780   signal() {}
2781   signal(const signal& src)
2782     : signal3<T_return, T_arg1,T_arg2,T_arg3, nil>(src) {}
2783 };
2784
2785
2786 /** Convenience wrapper for the numbered sigc::signal4 template.
2787  * See the base class for useful methods.
2788  * This is the template specialization of the unnumbered sigc::signal
2789  * template for 4 argument(s).
2790  */
2791 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
2792 class signal <T_return, T_arg1,T_arg2,T_arg3,T_arg4, nil,nil,nil>
2793   : public signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, nil>
2794 {
2795 public:
2796
2797   /** Convenience wrapper for the numbered sigc::signal4 template.
2798    * Like sigc::signal but the additional template parameter @e T_accumulator
2799    * defines the accumulator type that should be used.
2800    */
2801   template <class T_accumulator>
2802   class accumulated
2803     : public signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>
2804   {
2805   public:
2806     accumulated() {}
2807     accumulated(const accumulated& src)
2808       : signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>(src) {}
2809   };
2810
2811   signal() {}
2812   signal(const signal& src)
2813     : signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, nil>(src) {}
2814 };
2815
2816
2817 /** Convenience wrapper for the numbered sigc::signal5 template.
2818  * See the base class for useful methods.
2819  * This is the template specialization of the unnumbered sigc::signal
2820  * template for 5 argument(s).
2821  */
2822 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
2823 class signal <T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil,nil>
2824   : public signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil>
2825 {
2826 public:
2827
2828   /** Convenience wrapper for the numbered sigc::signal5 template.
2829    * Like sigc::signal but the additional template parameter @e T_accumulator
2830    * defines the accumulator type that should be used.
2831    */
2832   template <class T_accumulator>
2833   class accumulated
2834     : public signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>
2835   {
2836   public:
2837     accumulated() {}
2838     accumulated(const accumulated& src)
2839       : signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>(src) {}
2840   };
2841
2842   signal() {}
2843   signal(const signal& src)
2844     : signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil>(src) {}
2845 };
2846
2847
2848 /** Convenience wrapper for the numbered sigc::signal6 template.
2849  * See the base class for useful methods.
2850  * This is the template specialization of the unnumbered sigc::signal
2851  * template for 6 argument(s).
2852  */
2853 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
2854 class signal <T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>
2855   : public signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>
2856 {
2857 public:
2858
2859   /** Convenience wrapper for the numbered sigc::signal6 template.
2860    * Like sigc::signal but the additional template parameter @e T_accumulator
2861    * defines the accumulator type that should be used.
2862    */
2863   template <class T_accumulator>
2864   class accumulated
2865     : public signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator>
2866   {
2867   public:
2868     accumulated() {}
2869     accumulated(const accumulated& src)
2870       : signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator>(src) {}
2871   };
2872
2873   signal() {}
2874   signal(const signal& src)
2875     : signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>(src) {}
2876 };
2877
2878
2879
2880 } /* namespace sigc */
2881
2882
2883 #ifndef LIBSIGC_DISABLE_DEPRECATED
2884
2885 namespace SigC {
2886
2887 // SignalN
2888 /** Signal declaration.
2889  * Signal0 can be used to connect() slots that are invoked
2890  * during subsequent calls to emit(). Any functor or slot
2891  * can be passed into connect(). It is converted into a slot
2892  * implicitely.
2893  *
2894  * If you want to connect one signal to another, use slot()
2895  * to retrieve a functor that emits the signal when invoked.
2896  *
2897  * Be careful if you directly pass one signal into the connect()
2898  * method of another: a shallow copy of the signal is made and
2899  * the signal's slots are not disconnected until both the signal
2900  * and its clone are destroyed which is probably not what you want!
2901  *
2902  * An STL-style list interface for the signal's list of slots
2903  * can be retrieved with slots(). This interface supports
2904  * iteration, insertion and removal of slots.
2905  *
2906  * The following template arguments are used:
2907  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2908  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
2909  *
2910  * @deprecated Use the unnumbered template sigc::signal instead.
2911  * @ingroup compat
2912  */
2913 template <class T_return, class T_accumulator=::sigc::nil>
2914 class Signal0
2915   : public ::sigc::signal0<T_return, T_accumulator>
2916 {
2917 public:
2918   typedef ::sigc::signal0<T_return, T_accumulator> parent_type;
2919   typedef typename parent_type::result_type result_type;
2920   typedef typename parent_type::slot_type slot_type;
2921
2922   Signal0() {}
2923   Signal0(const Signal0& src)
2924     : ::sigc::signal0<T_return, T_accumulator>(src) {}
2925
2926   /** Creates a functor that calls emit() on this signal.
2927    * @code
2928    * sigc::mem_fun(mysignal, &sigc::signal0::emit)
2929    * @endcode
2930    * yields the same result.
2931    * @return A functor that calls emit() on this signal.
2932    */
2933   slot_type slot() const
2934     { return ::sigc::bound_const_mem_functor0<result_type, parent_type>(this, &parent_type::emit); }
2935 };
2936
2937 /** Signal declaration.
2938  * Signal1 can be used to connect() slots that are invoked
2939  * during subsequent calls to emit(). Any functor or slot
2940  * can be passed into connect(). It is converted into a slot
2941  * implicitely.
2942  *
2943  * If you want to connect one signal to another, use slot()
2944  * to retrieve a functor that emits the signal when invoked.
2945  *
2946  * Be careful if you directly pass one signal into the connect()
2947  * method of another: a shallow copy of the signal is made and
2948  * the signal's slots are not disconnected until both the signal
2949  * and its clone are destroyed which is probably not what you want!
2950  *
2951  * An STL-style list interface for the signal's list of slots
2952  * can be retrieved with slots(). This interface supports
2953  * iteration, insertion and removal of slots.
2954  *
2955  * The following template arguments are used:
2956  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
2957  * - @e T_arg1 Argument type used in the definition of emit().
2958  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
2959  *
2960  * @deprecated Use the unnumbered template sigc::signal instead.
2961  * @ingroup compat
2962  */
2963 template <class T_return, class T_arg1, class T_accumulator=::sigc::nil>
2964 class Signal1
2965   : public ::sigc::signal1<T_return, T_arg1, T_accumulator>
2966 {
2967 public:
2968   typedef ::sigc::signal1<T_return, T_arg1, T_accumulator> parent_type;
2969   typedef typename parent_type::result_type result_type;
2970   typedef typename parent_type::slot_type slot_type;
2971
2972   Signal1() {}
2973   Signal1(const Signal1& src)
2974     : ::sigc::signal1<T_return, T_arg1, T_accumulator>(src) {}
2975
2976   /** Creates a functor that calls emit() on this signal.
2977    * @code
2978    * sigc::mem_fun(mysignal, &sigc::signal1::emit)
2979    * @endcode
2980    * yields the same result.
2981    * @return A functor that calls emit() on this signal.
2982    */
2983   slot_type slot() const
2984     { return ::sigc::bound_const_mem_functor1<result_type, parent_type, typename ::sigc::type_trait<T_arg1>::take>(this, &parent_type::emit); }
2985 };
2986
2987 /** Signal declaration.
2988  * Signal2 can be used to connect() slots that are invoked
2989  * during subsequent calls to emit(). Any functor or slot
2990  * can be passed into connect(). It is converted into a slot
2991  * implicitely.
2992  *
2993  * If you want to connect one signal to another, use slot()
2994  * to retrieve a functor that emits the signal when invoked.
2995  *
2996  * Be careful if you directly pass one signal into the connect()
2997  * method of another: a shallow copy of the signal is made and
2998  * the signal's slots are not disconnected until both the signal
2999  * and its clone are destroyed which is probably not what you want!
3000  *
3001  * An STL-style list interface for the signal's list of slots
3002  * can be retrieved with slots(). This interface supports
3003  * iteration, insertion and removal of slots.
3004  *
3005  * The following template arguments are used:
3006  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3007  * - @e T_arg1 Argument type used in the definition of emit().
3008  * - @e T_arg2 Argument type used in the definition of emit().
3009  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
3010  *
3011  * @deprecated Use the unnumbered template sigc::signal instead.
3012  * @ingroup compat
3013  */
3014 template <class T_return, class T_arg1,class T_arg2, class T_accumulator=::sigc::nil>
3015 class Signal2
3016   : public ::sigc::signal2<T_return, T_arg1,T_arg2, T_accumulator>
3017 {
3018 public:
3019   typedef ::sigc::signal2<T_return, T_arg1,T_arg2, T_accumulator> parent_type;
3020   typedef typename parent_type::result_type result_type;
3021   typedef typename parent_type::slot_type slot_type;
3022
3023   Signal2() {}
3024   Signal2(const Signal2& src)
3025     : ::sigc::signal2<T_return, T_arg1,T_arg2, T_accumulator>(src) {}
3026
3027   /** Creates a functor that calls emit() on this signal.
3028    * @code
3029    * sigc::mem_fun(mysignal, &sigc::signal2::emit)
3030    * @endcode
3031    * yields the same result.
3032    * @return A functor that calls emit() on this signal.
3033    */
3034   slot_type slot() const
3035     { return ::sigc::bound_const_mem_functor2<result_type, parent_type, typename ::sigc::type_trait<T_arg1>::take,typename ::sigc::type_trait<T_arg2>::take>(this, &parent_type::emit); }
3036 };
3037
3038 /** Signal declaration.
3039  * Signal3 can be used to connect() slots that are invoked
3040  * during subsequent calls to emit(). Any functor or slot
3041  * can be passed into connect(). It is converted into a slot
3042  * implicitely.
3043  *
3044  * If you want to connect one signal to another, use slot()
3045  * to retrieve a functor that emits the signal when invoked.
3046  *
3047  * Be careful if you directly pass one signal into the connect()
3048  * method of another: a shallow copy of the signal is made and
3049  * the signal's slots are not disconnected until both the signal
3050  * and its clone are destroyed which is probably not what you want!
3051  *
3052  * An STL-style list interface for the signal's list of slots
3053  * can be retrieved with slots(). This interface supports
3054  * iteration, insertion and removal of slots.
3055  *
3056  * The following template arguments are used:
3057  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3058  * - @e T_arg1 Argument type used in the definition of emit().
3059  * - @e T_arg2 Argument type used in the definition of emit().
3060  * - @e T_arg3 Argument type used in the definition of emit().
3061  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
3062  *
3063  * @deprecated Use the unnumbered template sigc::signal instead.
3064  * @ingroup compat
3065  */
3066 template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_accumulator=::sigc::nil>
3067 class Signal3
3068   : public ::sigc::signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>
3069 {
3070 public:
3071   typedef ::sigc::signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator> parent_type;
3072   typedef typename parent_type::result_type result_type;
3073   typedef typename parent_type::slot_type slot_type;
3074
3075   Signal3() {}
3076   Signal3(const Signal3& src)
3077     : ::sigc::signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>(src) {}
3078
3079   /** Creates a functor that calls emit() on this signal.
3080    * @code
3081    * sigc::mem_fun(mysignal, &sigc::signal3::emit)
3082    * @endcode
3083    * yields the same result.
3084    * @return A functor that calls emit() on this signal.
3085    */
3086   slot_type slot() const
3087     { return ::sigc::bound_const_mem_functor3<result_type, parent_type, typename ::sigc::type_trait<T_arg1>::take,typename ::sigc::type_trait<T_arg2>::take,typename ::sigc::type_trait<T_arg3>::take>(this, &parent_type::emit); }
3088 };
3089
3090 /** Signal declaration.
3091  * Signal4 can be used to connect() slots that are invoked
3092  * during subsequent calls to emit(). Any functor or slot
3093  * can be passed into connect(). It is converted into a slot
3094  * implicitely.
3095  *
3096  * If you want to connect one signal to another, use slot()
3097  * to retrieve a functor that emits the signal when invoked.
3098  *
3099  * Be careful if you directly pass one signal into the connect()
3100  * method of another: a shallow copy of the signal is made and
3101  * the signal's slots are not disconnected until both the signal
3102  * and its clone are destroyed which is probably not what you want!
3103  *
3104  * An STL-style list interface for the signal's list of slots
3105  * can be retrieved with slots(). This interface supports
3106  * iteration, insertion and removal of slots.
3107  *
3108  * The following template arguments are used:
3109  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3110  * - @e T_arg1 Argument type used in the definition of emit().
3111  * - @e T_arg2 Argument type used in the definition of emit().
3112  * - @e T_arg3 Argument type used in the definition of emit().
3113  * - @e T_arg4 Argument type used in the definition of emit().
3114  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
3115  *
3116  * @deprecated Use the unnumbered template sigc::signal instead.
3117  * @ingroup compat
3118  */
3119 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_accumulator=::sigc::nil>
3120 class Signal4
3121   : public ::sigc::signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>
3122 {
3123 public:
3124   typedef ::sigc::signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator> parent_type;
3125   typedef typename parent_type::result_type result_type;
3126   typedef typename parent_type::slot_type slot_type;
3127
3128   Signal4() {}
3129   Signal4(const Signal4& src)
3130     : ::sigc::signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>(src) {}
3131
3132   /** Creates a functor that calls emit() on this signal.
3133    * @code
3134    * sigc::mem_fun(mysignal, &sigc::signal4::emit)
3135    * @endcode
3136    * yields the same result.
3137    * @return A functor that calls emit() on this signal.
3138    */
3139   slot_type slot() const
3140     { return ::sigc::bound_const_mem_functor4<result_type, parent_type, typename ::sigc::type_trait<T_arg1>::take,typename ::sigc::type_trait<T_arg2>::take,typename ::sigc::type_trait<T_arg3>::take,typename ::sigc::type_trait<T_arg4>::take>(this, &parent_type::emit); }
3141 };
3142
3143 /** Signal declaration.
3144  * Signal5 can be used to connect() slots that are invoked
3145  * during subsequent calls to emit(). Any functor or slot
3146  * can be passed into connect(). It is converted into a slot
3147  * implicitely.
3148  *
3149  * If you want to connect one signal to another, use slot()
3150  * to retrieve a functor that emits the signal when invoked.
3151  *
3152  * Be careful if you directly pass one signal into the connect()
3153  * method of another: a shallow copy of the signal is made and
3154  * the signal's slots are not disconnected until both the signal
3155  * and its clone are destroyed which is probably not what you want!
3156  *
3157  * An STL-style list interface for the signal's list of slots
3158  * can be retrieved with slots(). This interface supports
3159  * iteration, insertion and removal of slots.
3160  *
3161  * The following template arguments are used:
3162  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3163  * - @e T_arg1 Argument type used in the definition of emit().
3164  * - @e T_arg2 Argument type used in the definition of emit().
3165  * - @e T_arg3 Argument type used in the definition of emit().
3166  * - @e T_arg4 Argument type used in the definition of emit().
3167  * - @e T_arg5 Argument type used in the definition of emit().
3168  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
3169  *
3170  * @deprecated Use the unnumbered template sigc::signal instead.
3171  * @ingroup compat
3172  */
3173 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_accumulator=::sigc::nil>
3174 class Signal5
3175   : public ::sigc::signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>
3176 {
3177 public:
3178   typedef ::sigc::signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator> parent_type;
3179   typedef typename parent_type::result_type result_type;
3180   typedef typename parent_type::slot_type slot_type;
3181
3182   Signal5() {}
3183   Signal5(const Signal5& src)
3184     : ::sigc::signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>(src) {}
3185
3186   /** Creates a functor that calls emit() on this signal.
3187    * @code
3188    * sigc::mem_fun(mysignal, &sigc::signal5::emit)
3189    * @endcode
3190    * yields the same result.
3191    * @return A functor that calls emit() on this signal.
3192    */
3193   slot_type slot() const
3194     { return ::sigc::bound_const_mem_functor5<result_type, parent_type, typename ::sigc::type_trait<T_arg1>::take,typename ::sigc::type_trait<T_arg2>::take,typename ::sigc::type_trait<T_arg3>::take,typename ::sigc::type_trait<T_arg4>::take,typename ::sigc::type_trait<T_arg5>::take>(this, &parent_type::emit); }
3195 };
3196
3197 /** Signal declaration.
3198  * Signal6 can be used to connect() slots that are invoked
3199  * during subsequent calls to emit(). Any functor or slot
3200  * can be passed into connect(). It is converted into a slot
3201  * implicitely.
3202  *
3203  * If you want to connect one signal to another, use slot()
3204  * to retrieve a functor that emits the signal when invoked.
3205  *
3206  * Be careful if you directly pass one signal into the connect()
3207  * method of another: a shallow copy of the signal is made and
3208  * the signal's slots are not disconnected until both the signal
3209  * and its clone are destroyed which is probably not what you want!
3210  *
3211  * An STL-style list interface for the signal's list of slots
3212  * can be retrieved with slots(). This interface supports
3213  * iteration, insertion and removal of slots.
3214  *
3215  * The following template arguments are used:
3216  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3217  * - @e T_arg1 Argument type used in the definition of emit().
3218  * - @e T_arg2 Argument type used in the definition of emit().
3219  * - @e T_arg3 Argument type used in the definition of emit().
3220  * - @e T_arg4 Argument type used in the definition of emit().
3221  * - @e T_arg5 Argument type used in the definition of emit().
3222  * - @e T_arg6 Argument type used in the definition of emit().
3223  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
3224  *
3225  * @deprecated Use the unnumbered template sigc::signal instead.
3226  * @ingroup compat
3227  */
3228 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6, class T_accumulator=::sigc::nil>
3229 class Signal6
3230   : public ::sigc::signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator>
3231 {
3232 public:
3233   typedef ::sigc::signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator> parent_type;
3234   typedef typename parent_type::result_type result_type;
3235   typedef typename parent_type::slot_type slot_type;
3236
3237   Signal6() {}
3238   Signal6(const Signal6& src)
3239     : ::sigc::signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator>(src) {}
3240
3241   /** Creates a functor that calls emit() on this signal.
3242    * @code
3243    * sigc::mem_fun(mysignal, &sigc::signal6::emit)
3244    * @endcode
3245    * yields the same result.
3246    * @return A functor that calls emit() on this signal.
3247    */
3248   slot_type slot() const
3249     { return ::sigc::bound_const_mem_functor6<result_type, parent_type, typename ::sigc::type_trait<T_arg1>::take,typename ::sigc::type_trait<T_arg2>::take,typename ::sigc::type_trait<T_arg3>::take,typename ::sigc::type_trait<T_arg4>::take,typename ::sigc::type_trait<T_arg5>::take,typename ::sigc::type_trait<T_arg6>::take>(this, &parent_type::emit); }
3250 };
3251
3252 /** Signal declaration.
3253  * Signal7 can be used to connect() slots that are invoked
3254  * during subsequent calls to emit(). Any functor or slot
3255  * can be passed into connect(). It is converted into a slot
3256  * implicitely.
3257  *
3258  * If you want to connect one signal to another, use slot()
3259  * to retrieve a functor that emits the signal when invoked.
3260  *
3261  * Be careful if you directly pass one signal into the connect()
3262  * method of another: a shallow copy of the signal is made and
3263  * the signal's slots are not disconnected until both the signal
3264  * and its clone are destroyed which is probably not what you want!
3265  *
3266  * An STL-style list interface for the signal's list of slots
3267  * can be retrieved with slots(). This interface supports
3268  * iteration, insertion and removal of slots.
3269  *
3270  * The following template arguments are used:
3271  * - @e T_return The desired return type for the emit() function (may be overridden by the accumulator).
3272  * - @e T_arg1 Argument type used in the definition of emit().
3273  * - @e T_arg2 Argument type used in the definition of emit().
3274  * - @e T_arg3 Argument type used in the definition of emit().
3275  * - @e T_arg4 Argument type used in the definition of emit().
3276  * - @e T_arg5 Argument type used in the definition of emit().
3277  * - @e T_arg6 Argument type used in the definition of emit().
3278  * - @e T_arg7 Argument type used in the definition of emit().
3279  * - @e T_accumulator The accumulator type used for emission. The default @p nil means that no accumulator should be used. Signal emission returns the return value of the last slot invoked.
3280  *
3281  * @deprecated Use the unnumbered template sigc::signal instead.
3282  * @ingroup compat
3283  */
3284 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7, class T_accumulator=::sigc::nil>
3285 class Signal7
3286   : public ::sigc::signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator>
3287 {
3288 public:
3289   typedef ::sigc::signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator> parent_type;
3290   typedef typename parent_type::result_type result_type;
3291   typedef typename parent_type::slot_type slot_type;
3292
3293   Signal7() {}
3294   Signal7(const Signal7& src)
3295     : ::sigc::signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator>(src) {}
3296
3297   /** Creates a functor that calls emit() on this signal.
3298    * @code
3299    * sigc::mem_fun(mysignal, &sigc::signal7::emit)
3300    * @endcode
3301    * yields the same result.
3302    * @return A functor that calls emit() on this signal.
3303    */
3304   slot_type slot() const
3305     { return ::sigc::bound_const_mem_functor7<result_type, parent_type, typename ::sigc::type_trait<T_arg1>::take,typename ::sigc::type_trait<T_arg2>::take,typename ::sigc::type_trait<T_arg3>::take,typename ::sigc::type_trait<T_arg4>::take,typename ::sigc::type_trait<T_arg5>::take,typename ::sigc::type_trait<T_arg6>::take,typename ::sigc::type_trait<T_arg7>::take>(this, &parent_type::emit); }
3306 };
3307
3308
3309 }
3310
3311 #endif /* LIBSIGC_DISABLE_DEPRECATED */
3312
3313 #endif /* _SIGC_SIGNAL_H_ */