2 /* Do not edit! -- generated file */
4 #ifndef _SIGC_SIGNAL_H_
5 #define _SIGC_SIGNAL_H_
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>
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
26 /** STL-style iterator for slot_list.
30 template <typename T_slot>
33 typedef size_t size_type;
34 typedef ptrdiff_t difference_type;
35 typedef std::bidirectional_iterator_tag iterator_category;
37 typedef T_slot slot_type;
39 typedef T_slot value_type;
40 typedef T_slot* pointer;
41 typedef T_slot& reference;
43 typedef typename internal::signal_impl::iterator_type iterator_type;
48 explicit slot_iterator(const iterator_type& i)
51 reference operator*() const
52 { return static_cast<reference>(*i_); }
54 pointer operator->() const
55 { return &(operator*()); }
57 slot_iterator& operator++()
63 slot_iterator operator++(int)
65 slot_iterator __tmp(*this);
70 slot_iterator& operator--()
76 slot_iterator operator--(int)
78 slot_iterator __tmp(*this);
83 bool operator == (const slot_iterator& other) const
84 { return i_ == other.i_; }
86 bool operator != (const slot_iterator& other) const
87 { return i_ != other.i_; }
92 /** STL-style const iterator for slot_list.
96 template <typename T_slot>
97 struct slot_const_iterator
99 typedef size_t size_type;
100 typedef ptrdiff_t difference_type;
101 typedef std::bidirectional_iterator_tag iterator_category;
103 typedef T_slot slot_type;
105 typedef T_slot value_type;
106 typedef const T_slot* pointer;
107 typedef const T_slot& reference;
109 typedef typename internal::signal_impl::const_iterator_type iterator_type;
111 slot_const_iterator()
114 explicit slot_const_iterator(const iterator_type& i)
117 reference operator*() const
118 { return static_cast<reference>(*i_); }
120 pointer operator->() const
121 { return &(operator*()); }
123 slot_const_iterator& operator++()
129 slot_const_iterator operator++(int)
131 slot_const_iterator __tmp(*this);
136 slot_const_iterator& operator--()
142 slot_const_iterator operator--(int)
144 slot_const_iterator __tmp(*this);
149 bool operator == (const slot_const_iterator& other) const
150 { return i_ == other.i_; }
152 bool operator != (const slot_const_iterator& other) const
153 { return i_ != other.i_; }
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.
166 template <class T_slot>
169 typedef T_slot slot_type;
171 typedef slot_type& reference;
172 typedef const slot_type& const_reference;
174 typedef slot_iterator<slot_type> iterator;
175 typedef slot_const_iterator<slot_type> const_iterator;
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;
181 typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
182 int, int&, int*, ptrdiff_t> reverse_iterator;
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 */
194 explicit slot_list(internal::signal_impl* __list)
198 { return iterator(list_->slots_.begin()); }
200 const_iterator begin() const
201 { return const_iterator(list_->slots_.begin()); }
204 { return iterator(list_->slots_.end()); }
206 const_iterator end() const
207 { return const_iterator(list_->slots_.end()); }
209 reverse_iterator rbegin()
210 { return reverse_iterator(end()); }
212 const_reverse_iterator rbegin() const
213 { return const_reverse_iterator(end()); }
215 reverse_iterator rend()
216 { return reverse_iterator(begin()); }
218 const_reverse_iterator rend() const
219 { return const_reverse_iterator(begin()); }
224 const_reference front() const
228 { return *(--end()); }
230 const_reference back() const
231 { return *(--end()); }
233 iterator insert(iterator i, const slot_type& slot_)
234 { return iterator(list_->insert(i.i_, static_cast<const slot_base&>(slot_))); }
236 void push_front(const slot_type& c)
237 { insert(begin(), c); }
239 void push_back(const slot_type& c)
240 { insert(end(), c); }
242 iterator erase(iterator i)
243 { return iterator(list_->erase(i.i_)); }
245 iterator erase(iterator first_, iterator last_)
247 while (first_ != last_)
248 first_ = erase(first_);
257 iterator tmp_ = end();
262 internal::signal_impl* list_;
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.
273 template <class T_emitter, class T_result = typename T_emitter::result_type>
274 struct slot_iterator_buf
276 typedef size_t size_type;
277 typedef ptrdiff_t difference_type;
278 typedef std::bidirectional_iterator_tag iterator_category;
280 typedef T_emitter emitter_type;
281 typedef T_result result_type;
282 typedef typename T_emitter::slot_type slot_type;
284 typedef signal_impl::const_iterator_type iterator_type;
287 : c_(0), invoked_(false) {}
289 slot_iterator_buf(const iterator_type& i, const emitter_type* c)
290 : i_(i), c_(c), invoked_(false) {}
292 result_type operator*() const
294 if (!i_->empty() && !i_->blocked() && !invoked_)
296 r_ = (*c_)(static_cast<const slot_type&>(*i_));
302 slot_iterator_buf& operator++()
309 slot_iterator_buf operator++(int)
311 slot_iterator_buf __tmp(*this);
317 slot_iterator_buf& operator--()
324 slot_iterator_buf operator--(int)
326 slot_iterator_buf __tmp(*this);
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. */
338 bool operator != (const slot_iterator_buf& other) const
339 { return (c_ && (i_ != other.i_)); }
343 const emitter_type* c_;
344 mutable result_type r_;
345 mutable bool invoked_;
348 /** Template specialization of slot_iterator_buf for void return signals.
350 template <class T_emitter>
351 struct slot_iterator_buf<T_emitter, void>
353 typedef size_t size_type;
354 typedef ptrdiff_t difference_type;
355 typedef std::bidirectional_iterator_tag iterator_category;
357 typedef T_emitter emitter_type;
358 typedef void result_type;
359 typedef typename T_emitter::slot_type slot_type;
361 typedef signal_impl::const_iterator_type iterator_type;
364 : c_(0), invoked_(false) {}
366 slot_iterator_buf(const iterator_type& i, const emitter_type* c)
367 : i_(i), c_(c), invoked_(false) {}
369 void operator*() const
371 if (!i_->empty() && !i_->blocked() && !invoked_)
373 (*c_)(static_cast<const slot_type&>(*i_));
378 slot_iterator_buf& operator++()
385 slot_iterator_buf operator++(int)
387 slot_iterator_buf __tmp(*this);
393 slot_iterator_buf& operator--()
400 slot_iterator_buf operator--(int)
402 slot_iterator_buf __tmp(*this);
408 bool operator == (const slot_iterator_buf& other) const
409 { return i_ == other.i_; }
411 bool operator != (const slot_iterator_buf& other) const
412 { return i_ != other.i_; }
416 const emitter_type* c_;
417 mutable bool invoked_;
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.
426 template <class T_return, class T_accumulator>
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;
438 * @param _A_slot Some slot to invoke.
439 * @return The slot's return value.
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_); }
444 /** Executes a list of slots using an accumulator of type @e T_accumulator.
446 * @return The accumulated return values of the slot invocations as processed by the accumulator.
448 static result_type emit(signal_impl* impl)
450 T_accumulator accumulator;
453 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
455 signal_exec exec(impl);
456 temp_slot_list slots(impl->slots_);
459 return accumulator(slot_iterator_buf_type(slots.begin(), &self),
460 slot_iterator_buf_type(slots.end(), &self));
465 /** Abstracts signal emission.
466 * This template specialization implements an optimized emit()
467 * function for the case that no accumulator is used.
469 template <class T_return>
470 struct signal_emit0<T_return, nil>
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;
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.
484 static result_type emit(signal_impl* impl)
486 if (!impl || impl->slots_.empty())
489 signal_exec exec(impl);
490 T_return r_ = T_return();
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
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;
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:
503 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_);
504 for (++it; it != slots.end(); ++it)
506 if (it->empty() || it->blocked())
508 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_);
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.
522 struct signal_emit0<void, nil>
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*);
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.
534 static result_type emit(signal_impl* impl)
536 if (!impl || impl->slots_.empty()) return;
537 signal_exec exec(impl);
538 temp_slot_list slots(impl->slots_);
540 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
542 if (it->empty() || it->blocked())
544 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_);
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.
555 template <class T_return, class T_arg1, class T_accumulator>
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;
564 /** Instantiates the class.
565 * The parameters are stored in member variables. operator()() passes
566 * the values on to some slot.
568 signal_emit1(typename type_trait<T_arg1>::take _A_a1)
572 /** Invokes a slot using the buffered parameter values.
573 * @param _A_slot Some slot to invoke.
574 * @return The slot's return value.
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_); }
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.
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.
585 static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1)
587 T_accumulator accumulator;
590 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
592 signal_exec exec(impl);
593 temp_slot_list slots(impl->slots_);
595 self_type self (_A_a1);
596 return accumulator(slot_iterator_buf_type(slots.begin(), &self),
597 slot_iterator_buf_type(slots.end(), &self));
600 typename type_trait<T_arg1>::take _A_a1_;
603 /** Abstracts signal emission.
604 * This template specialization implements an optimized emit()
605 * function for the case that no accumulator is used.
607 template <class T_return, class T_arg1>
608 struct signal_emit1<T_return, T_arg1, nil>
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;
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.
624 static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1)
626 if (!impl || impl->slots_.empty())
629 signal_exec exec(impl);
630 T_return r_ = T_return();
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
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;
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:
643 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
644 for (++it; it != slots.end(); ++it)
646 if (it->empty() || it->blocked())
648 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
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.
661 template <class T_arg1>
662 struct signal_emit1<void, T_arg1, nil>
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;
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.
676 static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1)
678 if (!impl || impl->slots_.empty()) return;
679 signal_exec exec(impl);
680 temp_slot_list slots(impl->slots_);
682 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
684 if (it->empty() || it->blocked())
686 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1);
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.
697 template <class T_return, class T_arg1,class T_arg2, class T_accumulator>
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;
706 /** Instantiates the class.
707 * The parameters are stored in member variables. operator()() passes
708 * the values on to some slot.
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) {}
714 /** Invokes a slot using the buffered parameter values.
715 * @param _A_slot Some slot to invoke.
716 * @return The slot's return value.
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_); }
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.
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.
728 static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2)
730 T_accumulator accumulator;
733 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
735 signal_exec exec(impl);
736 temp_slot_list slots(impl->slots_);
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));
743 typename type_trait<T_arg1>::take _A_a1_;
744 typename type_trait<T_arg2>::take _A_a2_;
747 /** Abstracts signal emission.
748 * This template specialization implements an optimized emit()
749 * function for the case that no accumulator is used.
751 template <class T_return, class T_arg1,class T_arg2>
752 struct signal_emit2<T_return, T_arg1,T_arg2, nil>
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;
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.
769 static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2)
771 if (!impl || impl->slots_.empty())
774 signal_exec exec(impl);
775 T_return r_ = T_return();
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
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;
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:
788 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2);
789 for (++it; it != slots.end(); ++it)
791 if (it->empty() || it->blocked())
793 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2);
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.
806 template <class T_arg1,class T_arg2>
807 struct signal_emit2<void, T_arg1,T_arg2, nil>
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;
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.
822 static result_type emit(signal_impl* impl, typename type_trait<T_arg1>::take _A_a1,typename type_trait<T_arg2>::take _A_a2)
824 if (!impl || impl->slots_.empty()) return;
825 signal_exec exec(impl);
826 temp_slot_list slots(impl->slots_);
828 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
830 if (it->empty() || it->blocked())
832 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2);
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.
843 template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_accumulator>
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;
852 /** Instantiates the class.
853 * The parameters are stored in member variables. operator()() passes
854 * the values on to some slot.
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) {}
860 /** Invokes a slot using the buffered parameter values.
861 * @param _A_slot Some slot to invoke.
862 * @return The slot's return value.
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_); }
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.
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.
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)
877 T_accumulator accumulator;
880 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
882 signal_exec exec(impl);
883 temp_slot_list slots(impl->slots_);
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));
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_;
895 /** Abstracts signal emission.
896 * This template specialization implements an optimized emit()
897 * function for the case that no accumulator is used.
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>
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;
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.
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)
920 if (!impl || impl->slots_.empty())
923 signal_exec exec(impl);
924 T_return r_ = T_return();
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
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;
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:
937 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3);
938 for (++it; it != slots.end(); ++it)
940 if (it->empty() || it->blocked())
942 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3);
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.
955 template <class T_arg1,class T_arg2,class T_arg3>
956 struct signal_emit3<void, T_arg1,T_arg2,T_arg3, nil>
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;
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.
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)
974 if (!impl || impl->slots_.empty()) return;
975 signal_exec exec(impl);
976 temp_slot_list slots(impl->slots_);
978 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
980 if (it->empty() || it->blocked())
982 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3);
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.
993 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_accumulator>
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;
1002 /** Instantiates the class.
1003 * The parameters are stored in member variables. operator()() passes
1004 * the values on to some slot.
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) {}
1010 /** Invokes a slot using the buffered parameter values.
1011 * @param _A_slot Some slot to invoke.
1012 * @return The slot's return value.
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_); }
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.
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.
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)
1028 T_accumulator accumulator;
1031 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1033 signal_exec exec(impl);
1034 temp_slot_list slots(impl->slots_);
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));
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_;
1047 /** Abstracts signal emission.
1048 * This template specialization implements an optimized emit()
1049 * function for the case that no accumulator is used.
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>
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;
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.
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)
1073 if (!impl || impl->slots_.empty())
1076 signal_exec exec(impl);
1077 T_return r_ = T_return();
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
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;
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:
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)
1093 if (it->empty() || it->blocked())
1095 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4);
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.
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>
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;
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.
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)
1128 if (!impl || impl->slots_.empty()) return;
1129 signal_exec exec(impl);
1130 temp_slot_list slots(impl->slots_);
1132 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1134 if (it->empty() || it->blocked())
1136 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4);
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.
1147 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_accumulator>
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;
1156 /** Instantiates the class.
1157 * The parameters are stored in member variables. operator()() passes
1158 * the values on to some slot.
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) {}
1164 /** Invokes a slot using the buffered parameter values.
1165 * @param _A_slot Some slot to invoke.
1166 * @return The slot's return value.
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_); }
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.
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.
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)
1183 T_accumulator accumulator;
1186 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1188 signal_exec exec(impl);
1189 temp_slot_list slots(impl->slots_);
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));
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_;
1203 /** Abstracts signal emission.
1204 * This template specialization implements an optimized emit()
1205 * function for the case that no accumulator is used.
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>
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;
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.
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)
1230 if (!impl || impl->slots_.empty())
1233 signal_exec exec(impl);
1234 T_return r_ = T_return();
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
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;
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:
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)
1250 if (it->empty() || it->blocked())
1252 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
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.
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>
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;
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.
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)
1286 if (!impl || impl->slots_.empty()) return;
1287 signal_exec exec(impl);
1288 temp_slot_list slots(impl->slots_);
1290 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1292 if (it->empty() || it->blocked())
1294 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5);
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.
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>
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;
1314 /** Instantiates the class.
1315 * The parameters are stored in member variables. operator()() passes
1316 * the values on to some slot.
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) {}
1322 /** Invokes a slot using the buffered parameter values.
1323 * @param _A_slot Some slot to invoke.
1324 * @return The slot's return value.
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_); }
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.
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.
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)
1342 T_accumulator accumulator;
1345 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1347 signal_exec exec(impl);
1348 temp_slot_list slots(impl->slots_);
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));
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_;
1363 /** Abstracts signal emission.
1364 * This template specialization implements an optimized emit()
1365 * function for the case that no accumulator is used.
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>
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;
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.
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)
1391 if (!impl || impl->slots_.empty())
1394 signal_exec exec(impl);
1395 T_return r_ = T_return();
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
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;
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:
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)
1411 if (it->empty() || it->blocked())
1413 r_ = (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
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.
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>
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;
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.
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)
1448 if (!impl || impl->slots_.empty()) return;
1449 signal_exec exec(impl);
1450 temp_slot_list slots(impl->slots_);
1452 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1454 if (it->empty() || it->blocked())
1456 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6);
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.
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>
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;
1476 /** Instantiates the class.
1477 * The parameters are stored in member variables. operator()() passes
1478 * the values on to some slot.
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) {}
1484 /** Invokes a slot using the buffered parameter values.
1485 * @param _A_slot Some slot to invoke.
1486 * @return The slot's return value.
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_); }
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.
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.
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)
1505 T_accumulator accumulator;
1508 return accumulator(slot_iterator_buf_type(), slot_iterator_buf_type());
1510 signal_exec exec(impl);
1511 temp_slot_list slots(impl->slots_);
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));
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_;
1527 /** Abstracts signal emission.
1528 * This template specialization implements an optimized emit()
1529 * function for the case that no accumulator is used.
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>
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;
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.
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)
1556 if (!impl || impl->slots_.empty())
1559 signal_exec exec(impl);
1560 T_return r_ = T_return();
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
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;
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:
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)
1576 if (it->empty() || it->blocked())
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);
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.
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>
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;
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.
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)
1614 if (!impl || impl->slots_.empty()) return;
1615 signal_exec exec(impl);
1616 temp_slot_list slots(impl->slots_);
1618 for (iterator_type it = slots.begin(); it != slots.end(); ++it)
1620 if (it->empty() || it->blocked())
1622 (reinterpret_cast<call_type>(it->rep_->call_))(it->rep_, _A_a1,_A_a2,_A_a3,_A_a4,_A_a5,_A_a6,_A_a7);
1628 } /* namespace internal */
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
1636 * If you want to connect one signal to another, use make_slot()
1637 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
1652 * You should use the more convenient unnumbered sigc::signal template.
1656 template <class T_return, class T_accumulator=nil>
1658 : public signal_base
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;
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;
1675 typedef slot_list_type slot_list;
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.
1689 iterator connect(const slot_type& slot_)
1690 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
1701 result_type emit() const
1702 { return emitter_type::emit(impl_); }
1704 /** Triggers the emission of the signal (see emit()). */
1705 result_type operator()() const
1708 /** Creates a functor that calls emit() on this signal.
1710 * sigc::mem_fun(mysignal, &sigc::signal0::emit)
1712 * yields the same result.
1713 * @return A functor that calls emit() on this signal.
1715 bound_const_mem_functor0<result_type, signal0> make_slot() const
1716 { return bound_const_mem_functor0<result_type, signal0>(this, &signal0::emit); }
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.
1722 slot_list_type slots()
1723 { return slot_list_type(impl()); }
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.
1729 const slot_list_type slots() const
1730 { return slot_list_type(const_cast<signal0*>(this)->impl()); }
1734 signal0(const signal0& src)
1735 : signal_base(src) {}
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
1744 * If you want to connect one signal to another, use make_slot()
1745 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
1761 * You should use the more convenient unnumbered sigc::signal template.
1765 template <class T_return, class T_arg1, class T_accumulator=nil>
1767 : public signal_base
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;
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;
1784 typedef slot_list_type slot_list;
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.
1798 iterator connect(const slot_type& slot_)
1799 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
1811 result_type emit(typename type_trait<T_arg1>::take _A_a1) const
1812 { return emitter_type::emit(impl_, _A_a1); }
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); }
1818 /** Creates a functor that calls emit() on this signal.
1820 * sigc::mem_fun(mysignal, &sigc::signal1::emit)
1822 * yields the same result.
1823 * @return A functor that calls emit() on this signal.
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); }
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.
1832 slot_list_type slots()
1833 { return slot_list_type(impl()); }
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.
1839 const slot_list_type slots() const
1840 { return slot_list_type(const_cast<signal1*>(this)->impl()); }
1844 signal1(const signal1& src)
1845 : signal_base(src) {}
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
1854 * If you want to connect one signal to another, use make_slot()
1855 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
1872 * You should use the more convenient unnumbered sigc::signal template.
1876 template <class T_return, class T_arg1,class T_arg2, class T_accumulator=nil>
1878 : public signal_base
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;
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;
1895 typedef slot_list_type slot_list;
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.
1909 iterator connect(const slot_type& slot_)
1910 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
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); }
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); }
1930 /** Creates a functor that calls emit() on this signal.
1932 * sigc::mem_fun(mysignal, &sigc::signal2::emit)
1934 * yields the same result.
1935 * @return A functor that calls emit() on this signal.
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); }
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.
1944 slot_list_type slots()
1945 { return slot_list_type(impl()); }
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.
1951 const slot_list_type slots() const
1952 { return slot_list_type(const_cast<signal2*>(this)->impl()); }
1956 signal2(const signal2& src)
1957 : signal_base(src) {}
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
1966 * If you want to connect one signal to another, use make_slot()
1967 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
1985 * You should use the more convenient unnumbered sigc::signal template.
1989 template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_accumulator=nil>
1991 : public signal_base
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;
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;
2008 typedef slot_list_type slot_list;
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.
2022 iterator connect(const slot_type& slot_)
2023 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
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); }
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); }
2044 /** Creates a functor that calls emit() on this signal.
2046 * sigc::mem_fun(mysignal, &sigc::signal3::emit)
2048 * yields the same result.
2049 * @return A functor that calls emit() on this signal.
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); }
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.
2058 slot_list_type slots()
2059 { return slot_list_type(impl()); }
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.
2065 const slot_list_type slots() const
2066 { return slot_list_type(const_cast<signal3*>(this)->impl()); }
2070 signal3(const signal3& src)
2071 : signal_base(src) {}
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
2080 * If you want to connect one signal to another, use make_slot()
2081 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
2100 * You should use the more convenient unnumbered sigc::signal template.
2104 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_accumulator=nil>
2106 : public signal_base
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;
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;
2123 typedef slot_list_type slot_list;
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.
2137 iterator connect(const slot_type& slot_)
2138 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
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); }
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); }
2160 /** Creates a functor that calls emit() on this signal.
2162 * sigc::mem_fun(mysignal, &sigc::signal4::emit)
2164 * yields the same result.
2165 * @return A functor that calls emit() on this signal.
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); }
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.
2174 slot_list_type slots()
2175 { return slot_list_type(impl()); }
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.
2181 const slot_list_type slots() const
2182 { return slot_list_type(const_cast<signal4*>(this)->impl()); }
2186 signal4(const signal4& src)
2187 : signal_base(src) {}
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
2196 * If you want to connect one signal to another, use make_slot()
2197 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
2217 * You should use the more convenient unnumbered sigc::signal template.
2221 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5, class T_accumulator=nil>
2223 : public signal_base
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;
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;
2240 typedef slot_list_type slot_list;
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.
2254 iterator connect(const slot_type& slot_)
2255 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
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); }
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); }
2278 /** Creates a functor that calls emit() on this signal.
2280 * sigc::mem_fun(mysignal, &sigc::signal5::emit)
2282 * yields the same result.
2283 * @return A functor that calls emit() on this signal.
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); }
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.
2292 slot_list_type slots()
2293 { return slot_list_type(impl()); }
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.
2299 const slot_list_type slots() const
2300 { return slot_list_type(const_cast<signal5*>(this)->impl()); }
2304 signal5(const signal5& src)
2305 : signal_base(src) {}
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
2314 * If you want to connect one signal to another, use make_slot()
2315 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
2336 * You should use the more convenient unnumbered sigc::signal template.
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>
2342 : public signal_base
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;
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;
2359 typedef slot_list_type slot_list;
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.
2373 iterator connect(const slot_type& slot_)
2374 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
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); }
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); }
2398 /** Creates a functor that calls emit() on this signal.
2400 * sigc::mem_fun(mysignal, &sigc::signal6::emit)
2402 * yields the same result.
2403 * @return A functor that calls emit() on this signal.
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); }
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.
2412 slot_list_type slots()
2413 { return slot_list_type(impl()); }
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.
2419 const slot_list_type slots() const
2420 { return slot_list_type(const_cast<signal6*>(this)->impl()); }
2424 signal6(const signal6& src)
2425 : signal_base(src) {}
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
2434 * If you want to connect one signal to another, use make_slot()
2435 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
2457 * You should use the more convenient unnumbered sigc::signal template.
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>
2463 : public signal_base
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;
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;
2480 typedef slot_list_type slot_list;
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.
2494 iterator connect(const slot_type& slot_)
2495 { return iterator(signal_base::connect(static_cast<const slot_base&>(slot_))); }
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.
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); }
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); }
2520 /** Creates a functor that calls emit() on this signal.
2522 * sigc::mem_fun(mysignal, &sigc::signal7::emit)
2524 * yields the same result.
2525 * @return A functor that calls emit() on this signal.
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); }
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.
2534 slot_list_type slots()
2535 { return slot_list_type(impl()); }
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.
2541 const slot_list_type slots() const
2542 { return slot_list_type(const_cast<signal7*>(this)->impl()); }
2546 signal7(const signal7& src)
2547 : signal_base(src) {}
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
2558 * If you want to connect one signal to another, use make_slot()
2559 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
2581 * To specify an accumulator type the nested class signal::accumulated can be used.
2586 * sigc::signal<void, long> sig;
2587 * sig.connect(sigc::ptr_fun(&foo));
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>
2595 : public signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, nil>
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.
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.
2610 * This accumulator calculates the arithmetic mean value:
2612 * struct arithmetic_mean_accumulator
2614 * typedef double result_type;
2615 * template<typename T_iterator>
2616 * result_type operator()(T_iterator first, T_iterator last) const
2618 * result_type value_ = 0;
2620 * for (; first != last; ++first, ++n_)
2622 * return value_ / n_;
2628 * This accumulator stops signal emission when a slot returns zero:
2630 * struct interruptable_accumulator
2632 * typedef bool result_type;
2633 * template<typename T_iterator>
2634 * result_type operator()(T_iterator first, T_iterator last) const
2636 * for (; first != last; ++first, ++n_)
2637 * if (!*first) return false;
2645 template <class T_accumulator>
2647 : public signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator>
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) {}
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) {}
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).
2667 template <class T_return>
2668 class signal <T_return, nil,nil,nil,nil,nil,nil,nil>
2669 : public signal0<T_return, nil>
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.
2677 template <class T_accumulator>
2679 : public signal0<T_return, T_accumulator>
2683 accumulated(const accumulated& src)
2684 : signal0<T_return, T_accumulator>(src) {}
2688 signal(const signal& src)
2689 : signal0<T_return, nil>(src) {}
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).
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>
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.
2708 template <class T_accumulator>
2710 : public signal1<T_return, T_arg1, T_accumulator>
2714 accumulated(const accumulated& src)
2715 : signal1<T_return, T_arg1, T_accumulator>(src) {}
2719 signal(const signal& src)
2720 : signal1<T_return, T_arg1, nil>(src) {}
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).
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>
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.
2739 template <class T_accumulator>
2741 : public signal2<T_return, T_arg1,T_arg2, T_accumulator>
2745 accumulated(const accumulated& src)
2746 : signal2<T_return, T_arg1,T_arg2, T_accumulator>(src) {}
2750 signal(const signal& src)
2751 : signal2<T_return, T_arg1,T_arg2, nil>(src) {}
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).
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>
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.
2770 template <class T_accumulator>
2772 : public signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>
2776 accumulated(const accumulated& src)
2777 : signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>(src) {}
2781 signal(const signal& src)
2782 : signal3<T_return, T_arg1,T_arg2,T_arg3, nil>(src) {}
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).
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>
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.
2801 template <class T_accumulator>
2803 : public signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>
2807 accumulated(const accumulated& src)
2808 : signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>(src) {}
2812 signal(const signal& src)
2813 : signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, nil>(src) {}
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).
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>
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.
2832 template <class T_accumulator>
2834 : public signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>
2838 accumulated(const accumulated& src)
2839 : signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>(src) {}
2843 signal(const signal& src)
2844 : signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, nil>(src) {}
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).
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>
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.
2863 template <class T_accumulator>
2865 : public signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator>
2869 accumulated(const accumulated& src)
2870 : signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator>(src) {}
2874 signal(const signal& src)
2875 : signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, nil>(src) {}
2880 } /* namespace sigc */
2883 #ifndef LIBSIGC_DISABLE_DEPRECATED
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
2894 * If you want to connect one signal to another, use slot()
2895 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
2910 * @deprecated Use the unnumbered template sigc::signal instead.
2913 template <class T_return, class T_accumulator=::sigc::nil>
2915 : public ::sigc::signal0<T_return, T_accumulator>
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;
2923 Signal0(const Signal0& src)
2924 : ::sigc::signal0<T_return, T_accumulator>(src) {}
2926 /** Creates a functor that calls emit() on this signal.
2928 * sigc::mem_fun(mysignal, &sigc::signal0::emit)
2930 * yields the same result.
2931 * @return A functor that calls emit() on this signal.
2933 slot_type slot() const
2934 { return ::sigc::bound_const_mem_functor0<result_type, parent_type>(this, &parent_type::emit); }
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
2943 * If you want to connect one signal to another, use slot()
2944 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
2960 * @deprecated Use the unnumbered template sigc::signal instead.
2963 template <class T_return, class T_arg1, class T_accumulator=::sigc::nil>
2965 : public ::sigc::signal1<T_return, T_arg1, T_accumulator>
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;
2973 Signal1(const Signal1& src)
2974 : ::sigc::signal1<T_return, T_arg1, T_accumulator>(src) {}
2976 /** Creates a functor that calls emit() on this signal.
2978 * sigc::mem_fun(mysignal, &sigc::signal1::emit)
2980 * yields the same result.
2981 * @return A functor that calls emit() on this signal.
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); }
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
2993 * If you want to connect one signal to another, use slot()
2994 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
3011 * @deprecated Use the unnumbered template sigc::signal instead.
3014 template <class T_return, class T_arg1,class T_arg2, class T_accumulator=::sigc::nil>
3016 : public ::sigc::signal2<T_return, T_arg1,T_arg2, T_accumulator>
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;
3024 Signal2(const Signal2& src)
3025 : ::sigc::signal2<T_return, T_arg1,T_arg2, T_accumulator>(src) {}
3027 /** Creates a functor that calls emit() on this signal.
3029 * sigc::mem_fun(mysignal, &sigc::signal2::emit)
3031 * yields the same result.
3032 * @return A functor that calls emit() on this signal.
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); }
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
3044 * If you want to connect one signal to another, use slot()
3045 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
3063 * @deprecated Use the unnumbered template sigc::signal instead.
3066 template <class T_return, class T_arg1,class T_arg2,class T_arg3, class T_accumulator=::sigc::nil>
3068 : public ::sigc::signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>
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;
3076 Signal3(const Signal3& src)
3077 : ::sigc::signal3<T_return, T_arg1,T_arg2,T_arg3, T_accumulator>(src) {}
3079 /** Creates a functor that calls emit() on this signal.
3081 * sigc::mem_fun(mysignal, &sigc::signal3::emit)
3083 * yields the same result.
3084 * @return A functor that calls emit() on this signal.
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); }
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
3096 * If you want to connect one signal to another, use slot()
3097 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
3116 * @deprecated Use the unnumbered template sigc::signal instead.
3119 template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4, class T_accumulator=::sigc::nil>
3121 : public ::sigc::signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>
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;
3129 Signal4(const Signal4& src)
3130 : ::sigc::signal4<T_return, T_arg1,T_arg2,T_arg3,T_arg4, T_accumulator>(src) {}
3132 /** Creates a functor that calls emit() on this signal.
3134 * sigc::mem_fun(mysignal, &sigc::signal4::emit)
3136 * yields the same result.
3137 * @return A functor that calls emit() on this signal.
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); }
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
3149 * If you want to connect one signal to another, use slot()
3150 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
3170 * @deprecated Use the unnumbered template sigc::signal instead.
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>
3175 : public ::sigc::signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>
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;
3183 Signal5(const Signal5& src)
3184 : ::sigc::signal5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5, T_accumulator>(src) {}
3186 /** Creates a functor that calls emit() on this signal.
3188 * sigc::mem_fun(mysignal, &sigc::signal5::emit)
3190 * yields the same result.
3191 * @return A functor that calls emit() on this signal.
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); }
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
3203 * If you want to connect one signal to another, use slot()
3204 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
3225 * @deprecated Use the unnumbered template sigc::signal instead.
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>
3230 : public ::sigc::signal6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6, T_accumulator>
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;
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) {}
3241 /** Creates a functor that calls emit() on this signal.
3243 * sigc::mem_fun(mysignal, &sigc::signal6::emit)
3245 * yields the same result.
3246 * @return A functor that calls emit() on this signal.
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); }
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
3258 * If you want to connect one signal to another, use slot()
3259 * to retrieve a functor that emits the signal when invoked.
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!
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.
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.
3281 * @deprecated Use the unnumbered template sigc::signal instead.
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>
3286 : public ::sigc::signal7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7, T_accumulator>
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;
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) {}
3297 /** Creates a functor that calls emit() on this signal.
3299 * sigc::mem_fun(mysignal, &sigc::signal7::emit)
3301 * yields the same result.
3302 * @return A functor that calls emit() on this signal.
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); }
3311 #endif /* LIBSIGC_DISABLE_DEPRECATED */
3313 #endif /* _SIGC_SIGNAL_H_ */