1 // sigslot.h: Signal/Slot classes
3 // Written by Sarah Thompson (sarah@telergy.com) 2002.
5 // License: Public domain. You are free to use this code however you like, with the proviso that
6 // the author takes on no responsibility or liability for any use.
10 // (see also the full documentation at http://sigslot.sourceforge.net/)
13 // SIGSLOT_PURE_ISO - Define this to force ISO C++ compliance. This also disables
14 // all of the thread safety support on platforms where it is
17 // SIGSLOT_USE_POSIX_THREADS - Force use of Posix threads when using a C++ compiler other than
18 // gcc on a platform that supports Posix threads. (When using gcc,
19 // this is the default - use SIGSLOT_PURE_ISO to disable this if
22 // SIGSLOT_DEFAULT_MT_POLICY - Where thread support is enabled, this defaults to multi_threaded_global.
23 // Otherwise, the default is single_threaded. #define this yourself to
24 // override the default. In pure ISO mode, anything other than
25 // single_threaded will cause a compiler error.
29 // Win32 - On Win32, the WIN32 symbol must be #defined. Most mainstream
30 // compilers do this by default, but you may need to define it
31 // yourself if your build environment is less standard. This causes
32 // the Win32 thread support to be compiled in and used automatically.
34 // Unix/Linux/BSD, etc. - If you're using gcc, it is assumed that you have Posix threads
35 // available, so they are used automatically. You can override this
36 // (as under Windows) with the SIGSLOT_PURE_ISO switch. If you're using
37 // something other than gcc but still want to use Posix threads, you
38 // need to #define SIGSLOT_USE_POSIX_THREADS.
40 // ISO C++ - If none of the supported platforms are detected, or if
41 // SIGSLOT_PURE_ISO is defined, all multithreading support is turned off,
42 // along with any code that might cause a pure ISO C++ environment to
43 // complain. Before you ask, gcc -ansi -pedantic won't compile this
44 // library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of
45 // errors that aren't really there. If you feel like investigating this,
46 // please contact the author.
51 // single_threaded - Your program is assumed to be single threaded from the point of view
52 // of signal/slot usage (i.e. all objects using signals and slots are
53 // created and destroyed from a single thread). Behaviour if objects are
54 // destroyed concurrently is undefined (i.e. you'll get the occasional
55 // segmentation fault/memory exception).
57 // multi_threaded_global - Your program is assumed to be multi threaded. Objects using signals and
58 // slots can be safely created and destroyed from any thread, even when
59 // connections exist. In multi_threaded_global mode, this is achieved by a
60 // single global mutex (actually a critical section on Windows because they
61 // are faster). This option uses less OS resources, but results in more
62 // opportunities for contention, possibly resulting in more context switches
63 // than are strictly necessary.
65 // multi_threaded_local - Behaviour in this mode is essentially the same as multi_threaded_global,
66 // except that each signal, and each object that inherits has_slots, all
67 // have their own mutex/critical section. In practice, this means that
68 // mutex collisions (and hence context switches) only happen if they are
69 // absolutely essential. However, on some platforms, creating a lot of
70 // mutexes can slow down the whole OS, so use this option with care.
74 // See the full documentation at http://sigslot.sourceforge.net/
77 // Libjingle specific:
78 // This file has been modified such that has_slots and signalx do not have to be
79 // using the same threading requirements. E.g. it is possible to connect a
80 // has_slots<single_threaded> and signal0<multi_threaded_local> or
81 // has_slots<multi_threaded_local> and signal0<single_threaded>.
82 // If has_slots is single threaded the user must ensure that it is not trying
83 // to connect or disconnect to signalx concurrently or data race may occur.
84 // If signalx is single threaded the user must ensure that disconnect, connect
85 // or signal is not happening concurrently or data race may occur.
87 #ifndef TALK_BASE_SIGSLOT_H__
88 #define TALK_BASE_SIGSLOT_H__
94 // On our copy of sigslot.h, we set single threading as default.
95 #define SIGSLOT_DEFAULT_MT_POLICY single_threaded
97 #if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS))
98 # define _SIGSLOT_SINGLE_THREADED
100 # define _SIGSLOT_HAS_WIN32_THREADS
101 # if !defined(WIN32_LEAN_AND_MEAN)
102 # define WIN32_LEAN_AND_MEAN
104 # include "talk/base/win32.h"
105 #elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS)
106 # define _SIGSLOT_HAS_POSIX_THREADS
107 # include <pthread.h>
109 # define _SIGSLOT_SINGLE_THREADED
112 #ifndef SIGSLOT_DEFAULT_MT_POLICY
113 # ifdef _SIGSLOT_SINGLE_THREADED
114 # define SIGSLOT_DEFAULT_MT_POLICY single_threaded
116 # define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local
120 // TODO: change this namespace to talk_base?
123 class single_threaded
131 virtual ~single_threaded()
141 virtual void unlock()
147 #ifdef _SIGSLOT_HAS_WIN32_THREADS
148 // The multi threading policies only get compiled in if they are enabled.
149 class multi_threaded_global
152 multi_threaded_global()
154 static bool isinitialised = false;
158 InitializeCriticalSection(get_critsec());
159 isinitialised = true;
163 multi_threaded_global(const multi_threaded_global&)
168 virtual ~multi_threaded_global()
175 EnterCriticalSection(get_critsec());
178 virtual void unlock()
180 LeaveCriticalSection(get_critsec());
184 CRITICAL_SECTION* get_critsec()
186 static CRITICAL_SECTION g_critsec;
191 class multi_threaded_local
194 multi_threaded_local()
196 InitializeCriticalSection(&m_critsec);
199 multi_threaded_local(const multi_threaded_local&)
201 InitializeCriticalSection(&m_critsec);
204 virtual ~multi_threaded_local()
206 DeleteCriticalSection(&m_critsec);
211 EnterCriticalSection(&m_critsec);
214 virtual void unlock()
216 LeaveCriticalSection(&m_critsec);
220 CRITICAL_SECTION m_critsec;
222 #endif // _SIGSLOT_HAS_WIN32_THREADS
224 #ifdef _SIGSLOT_HAS_POSIX_THREADS
225 // The multi threading policies only get compiled in if they are enabled.
226 class multi_threaded_global
229 multi_threaded_global()
231 pthread_mutex_init(get_mutex(), NULL);
234 multi_threaded_global(const multi_threaded_global&)
239 virtual ~multi_threaded_global()
246 pthread_mutex_lock(get_mutex());
249 virtual void unlock()
251 pthread_mutex_unlock(get_mutex());
255 pthread_mutex_t* get_mutex()
257 static pthread_mutex_t g_mutex;
262 class multi_threaded_local
265 multi_threaded_local()
267 pthread_mutex_init(&m_mutex, NULL);
270 multi_threaded_local(const multi_threaded_local&)
272 pthread_mutex_init(&m_mutex, NULL);
275 virtual ~multi_threaded_local()
277 pthread_mutex_destroy(&m_mutex);
282 pthread_mutex_lock(&m_mutex);
285 virtual void unlock()
287 pthread_mutex_unlock(&m_mutex);
291 pthread_mutex_t m_mutex;
293 #endif // _SIGSLOT_HAS_POSIX_THREADS
295 template<class mt_policy>
301 lock_block(mt_policy *mtx)
313 class has_slots_interface;
315 template<class mt_policy>
316 class _connection_base0
319 virtual ~_connection_base0() {}
320 virtual has_slots_interface* getdest() const = 0;
321 virtual void emit() = 0;
322 virtual _connection_base0* clone() = 0;
323 virtual _connection_base0* duplicate(has_slots_interface* pnewdest) = 0;
326 template<class arg1_type, class mt_policy>
327 class _connection_base1
330 virtual ~_connection_base1() {}
331 virtual has_slots_interface* getdest() const = 0;
332 virtual void emit(arg1_type) = 0;
333 virtual _connection_base1<arg1_type, mt_policy>* clone() = 0;
334 virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
337 template<class arg1_type, class arg2_type, class mt_policy>
338 class _connection_base2
341 virtual ~_connection_base2() {}
342 virtual has_slots_interface* getdest() const = 0;
343 virtual void emit(arg1_type, arg2_type) = 0;
344 virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0;
345 virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
348 template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
349 class _connection_base3
352 virtual ~_connection_base3() {}
353 virtual has_slots_interface* getdest() const = 0;
354 virtual void emit(arg1_type, arg2_type, arg3_type) = 0;
355 virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0;
356 virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
359 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
360 class _connection_base4
363 virtual ~_connection_base4() {}
364 virtual has_slots_interface* getdest() const = 0;
365 virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0;
366 virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0;
367 virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
370 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
371 class arg5_type, class mt_policy>
372 class _connection_base5
375 virtual ~_connection_base5() {}
376 virtual has_slots_interface* getdest() const = 0;
377 virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type,
379 virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
380 arg5_type, mt_policy>* clone() = 0;
381 virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
382 arg5_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
385 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
386 class arg5_type, class arg6_type, class mt_policy>
387 class _connection_base6
390 virtual ~_connection_base6() {}
391 virtual has_slots_interface* getdest() const = 0;
392 virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
394 virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
395 arg5_type, arg6_type, mt_policy>* clone() = 0;
396 virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
397 arg5_type, arg6_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
400 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
401 class arg5_type, class arg6_type, class arg7_type, class mt_policy>
402 class _connection_base7
405 virtual ~_connection_base7() {}
406 virtual has_slots_interface* getdest() const = 0;
407 virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
408 arg6_type, arg7_type) = 0;
409 virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
410 arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0;
411 virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
412 arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
415 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
416 class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
417 class _connection_base8
420 virtual ~_connection_base8() {}
421 virtual has_slots_interface* getdest() const = 0;
422 virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
423 arg6_type, arg7_type, arg8_type) = 0;
424 virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
425 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0;
426 virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
427 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0;
430 class _signal_base_interface
433 virtual void slot_disconnect(has_slots_interface* pslot) = 0;
434 virtual void slot_duplicate(const has_slots_interface* poldslot, has_slots_interface* pnewslot) = 0;
437 template<class mt_policy>
438 class _signal_base : public _signal_base_interface, public mt_policy
442 class has_slots_interface
445 has_slots_interface()
450 virtual void signal_connect(_signal_base_interface* sender) = 0;
452 virtual void signal_disconnect(_signal_base_interface* sender) = 0;
454 virtual ~has_slots_interface()
458 virtual void disconnect_all() = 0;
461 template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
462 class has_slots : public has_slots_interface, public mt_policy
465 typedef std::set<_signal_base_interface*> sender_set;
466 typedef sender_set::const_iterator const_iterator;
474 has_slots(const has_slots& hs)
476 lock_block<mt_policy> lock(this);
477 const_iterator it = hs.m_senders.begin();
478 const_iterator itEnd = hs.m_senders.end();
482 (*it)->slot_duplicate(&hs, this);
483 m_senders.insert(*it);
488 void signal_connect(_signal_base_interface* sender)
490 lock_block<mt_policy> lock(this);
491 m_senders.insert(sender);
494 void signal_disconnect(_signal_base_interface* sender)
496 lock_block<mt_policy> lock(this);
497 m_senders.erase(sender);
505 void disconnect_all()
507 lock_block<mt_policy> lock(this);
508 const_iterator it = m_senders.begin();
509 const_iterator itEnd = m_senders.end();
513 (*it)->slot_disconnect(this);
517 m_senders.erase(m_senders.begin(), m_senders.end());
521 sender_set m_senders;
524 template<class mt_policy>
525 class _signal_base0 : public _signal_base<mt_policy>
528 typedef std::list<_connection_base0<mt_policy> *> connections_list;
535 _signal_base0(const _signal_base0& s)
536 : _signal_base<mt_policy>(s)
538 lock_block<mt_policy> lock(this);
539 typename connections_list::const_iterator it = s.m_connected_slots.begin();
540 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
544 (*it)->getdest()->signal_connect(this);
545 m_connected_slots.push_back((*it)->clone());
558 lock_block<mt_policy> lock(this);
559 typename connections_list::const_iterator it = m_connected_slots.begin();
560 typename connections_list::const_iterator itEnd = m_connected_slots.end();
564 void disconnect_all()
566 lock_block<mt_policy> lock(this);
567 typename connections_list::const_iterator it = m_connected_slots.begin();
568 typename connections_list::const_iterator itEnd = m_connected_slots.end();
572 (*it)->getdest()->signal_disconnect(this);
578 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
582 bool connected(has_slots_interface* pclass)
584 lock_block<mt_policy> lock(this);
585 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
586 typename connections_list::const_iterator itEnd = m_connected_slots.end();
591 if ((*it)->getdest() == pclass)
599 void disconnect(has_slots_interface* pclass)
601 lock_block<mt_policy> lock(this);
602 typename connections_list::iterator it = m_connected_slots.begin();
603 typename connections_list::iterator itEnd = m_connected_slots.end();
607 if((*it)->getdest() == pclass)
610 m_connected_slots.erase(it);
611 pclass->signal_disconnect(this);
619 void slot_disconnect(has_slots_interface* pslot)
621 lock_block<mt_policy> lock(this);
622 typename connections_list::iterator it = m_connected_slots.begin();
623 typename connections_list::iterator itEnd = m_connected_slots.end();
627 typename connections_list::iterator itNext = it;
630 if((*it)->getdest() == pslot)
633 m_connected_slots.erase(it);
640 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
642 lock_block<mt_policy> lock(this);
643 typename connections_list::iterator it = m_connected_slots.begin();
644 typename connections_list::iterator itEnd = m_connected_slots.end();
648 if((*it)->getdest() == oldtarget)
650 m_connected_slots.push_back((*it)->duplicate(newtarget));
658 connections_list m_connected_slots;
661 template<class arg1_type, class mt_policy>
662 class _signal_base1 : public _signal_base<mt_policy>
665 typedef std::list<_connection_base1<arg1_type, mt_policy> *> connections_list;
672 _signal_base1(const _signal_base1<arg1_type, mt_policy>& s)
673 : _signal_base<mt_policy>(s)
675 lock_block<mt_policy> lock(this);
676 typename connections_list::const_iterator it = s.m_connected_slots.begin();
677 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
681 (*it)->getdest()->signal_connect(this);
682 m_connected_slots.push_back((*it)->clone());
688 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
690 lock_block<mt_policy> lock(this);
691 typename connections_list::iterator it = m_connected_slots.begin();
692 typename connections_list::iterator itEnd = m_connected_slots.end();
696 if((*it)->getdest() == oldtarget)
698 m_connected_slots.push_back((*it)->duplicate(newtarget));
712 lock_block<mt_policy> lock(this);
713 typename connections_list::const_iterator it = m_connected_slots.begin();
714 typename connections_list::const_iterator itEnd = m_connected_slots.end();
718 void disconnect_all()
720 lock_block<mt_policy> lock(this);
721 typename connections_list::const_iterator it = m_connected_slots.begin();
722 typename connections_list::const_iterator itEnd = m_connected_slots.end();
726 (*it)->getdest()->signal_disconnect(this);
732 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
736 bool connected(has_slots_interface* pclass)
738 lock_block<mt_policy> lock(this);
739 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
740 typename connections_list::const_iterator itEnd = m_connected_slots.end();
745 if ((*it)->getdest() == pclass)
753 void disconnect(has_slots_interface* pclass)
755 lock_block<mt_policy> lock(this);
756 typename connections_list::iterator it = m_connected_slots.begin();
757 typename connections_list::iterator itEnd = m_connected_slots.end();
761 if((*it)->getdest() == pclass)
764 m_connected_slots.erase(it);
765 pclass->signal_disconnect(this);
773 void slot_disconnect(has_slots_interface* pslot)
775 lock_block<mt_policy> lock(this);
776 typename connections_list::iterator it = m_connected_slots.begin();
777 typename connections_list::iterator itEnd = m_connected_slots.end();
781 typename connections_list::iterator itNext = it;
784 if((*it)->getdest() == pslot)
787 m_connected_slots.erase(it);
796 connections_list m_connected_slots;
799 template<class arg1_type, class arg2_type, class mt_policy>
800 class _signal_base2 : public _signal_base<mt_policy>
803 typedef std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *>
811 _signal_base2(const _signal_base2<arg1_type, arg2_type, mt_policy>& s)
812 : _signal_base<mt_policy>(s)
814 lock_block<mt_policy> lock(this);
815 typename connections_list::const_iterator it = s.m_connected_slots.begin();
816 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
820 (*it)->getdest()->signal_connect(this);
821 m_connected_slots.push_back((*it)->clone());
827 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
829 lock_block<mt_policy> lock(this);
830 typename connections_list::iterator it = m_connected_slots.begin();
831 typename connections_list::iterator itEnd = m_connected_slots.end();
835 if((*it)->getdest() == oldtarget)
837 m_connected_slots.push_back((*it)->duplicate(newtarget));
851 lock_block<mt_policy> lock(this);
852 typename connections_list::const_iterator it = m_connected_slots.begin();
853 typename connections_list::const_iterator itEnd = m_connected_slots.end();
857 void disconnect_all()
859 lock_block<mt_policy> lock(this);
860 typename connections_list::const_iterator it = m_connected_slots.begin();
861 typename connections_list::const_iterator itEnd = m_connected_slots.end();
865 (*it)->getdest()->signal_disconnect(this);
871 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
875 bool connected(has_slots_interface* pclass)
877 lock_block<mt_policy> lock(this);
878 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
879 typename connections_list::const_iterator itEnd = m_connected_slots.end();
884 if ((*it)->getdest() == pclass)
892 void disconnect(has_slots_interface* pclass)
894 lock_block<mt_policy> lock(this);
895 typename connections_list::iterator it = m_connected_slots.begin();
896 typename connections_list::iterator itEnd = m_connected_slots.end();
900 if((*it)->getdest() == pclass)
903 m_connected_slots.erase(it);
904 pclass->signal_disconnect(this);
912 void slot_disconnect(has_slots_interface* pslot)
914 lock_block<mt_policy> lock(this);
915 typename connections_list::iterator it = m_connected_slots.begin();
916 typename connections_list::iterator itEnd = m_connected_slots.end();
920 typename connections_list::iterator itNext = it;
923 if((*it)->getdest() == pslot)
926 m_connected_slots.erase(it);
934 connections_list m_connected_slots;
937 template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
938 class _signal_base3 : public _signal_base<mt_policy>
941 typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *>
949 _signal_base3(const _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
950 : _signal_base<mt_policy>(s)
952 lock_block<mt_policy> lock(this);
953 typename connections_list::const_iterator it = s.m_connected_slots.begin();
954 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
958 (*it)->getdest()->signal_connect(this);
959 m_connected_slots.push_back((*it)->clone());
965 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
967 lock_block<mt_policy> lock(this);
968 typename connections_list::iterator it = m_connected_slots.begin();
969 typename connections_list::iterator itEnd = m_connected_slots.end();
973 if((*it)->getdest() == oldtarget)
975 m_connected_slots.push_back((*it)->duplicate(newtarget));
989 lock_block<mt_policy> lock(this);
990 typename connections_list::const_iterator it = m_connected_slots.begin();
991 typename connections_list::const_iterator itEnd = m_connected_slots.end();
995 void disconnect_all()
997 lock_block<mt_policy> lock(this);
998 typename connections_list::const_iterator it = m_connected_slots.begin();
999 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1003 (*it)->getdest()->signal_disconnect(this);
1009 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1013 bool connected(has_slots_interface* pclass)
1015 lock_block<mt_policy> lock(this);
1016 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1017 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1022 if ((*it)->getdest() == pclass)
1030 void disconnect(has_slots_interface* pclass)
1032 lock_block<mt_policy> lock(this);
1033 typename connections_list::iterator it = m_connected_slots.begin();
1034 typename connections_list::iterator itEnd = m_connected_slots.end();
1038 if((*it)->getdest() == pclass)
1041 m_connected_slots.erase(it);
1042 pclass->signal_disconnect(this);
1050 void slot_disconnect(has_slots_interface* pslot)
1052 lock_block<mt_policy> lock(this);
1053 typename connections_list::iterator it = m_connected_slots.begin();
1054 typename connections_list::iterator itEnd = m_connected_slots.end();
1058 typename connections_list::iterator itNext = it;
1061 if((*it)->getdest() == pslot)
1064 m_connected_slots.erase(it);
1072 connections_list m_connected_slots;
1075 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
1076 class _signal_base4 : public _signal_base<mt_policy>
1079 typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type,
1080 arg4_type, mt_policy> *> connections_list;
1087 _signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
1088 : _signal_base<mt_policy>(s)
1090 lock_block<mt_policy> lock(this);
1091 typename connections_list::const_iterator it = s.m_connected_slots.begin();
1092 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1096 (*it)->getdest()->signal_connect(this);
1097 m_connected_slots.push_back((*it)->clone());
1103 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1105 lock_block<mt_policy> lock(this);
1106 typename connections_list::iterator it = m_connected_slots.begin();
1107 typename connections_list::iterator itEnd = m_connected_slots.end();
1111 if((*it)->getdest() == oldtarget)
1113 m_connected_slots.push_back((*it)->duplicate(newtarget));
1127 lock_block<mt_policy> lock(this);
1128 typename connections_list::const_iterator it = m_connected_slots.begin();
1129 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1133 void disconnect_all()
1135 lock_block<mt_policy> lock(this);
1136 typename connections_list::const_iterator it = m_connected_slots.begin();
1137 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1141 (*it)->getdest()->signal_disconnect(this);
1147 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1151 bool connected(has_slots_interface* pclass)
1153 lock_block<mt_policy> lock(this);
1154 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1155 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1160 if ((*it)->getdest() == pclass)
1168 void disconnect(has_slots_interface* pclass)
1170 lock_block<mt_policy> lock(this);
1171 typename connections_list::iterator it = m_connected_slots.begin();
1172 typename connections_list::iterator itEnd = m_connected_slots.end();
1176 if((*it)->getdest() == pclass)
1179 m_connected_slots.erase(it);
1180 pclass->signal_disconnect(this);
1188 void slot_disconnect(has_slots_interface* pslot)
1190 lock_block<mt_policy> lock(this);
1191 typename connections_list::iterator it = m_connected_slots.begin();
1192 typename connections_list::iterator itEnd = m_connected_slots.end();
1196 typename connections_list::iterator itNext = it;
1199 if((*it)->getdest() == pslot)
1202 m_connected_slots.erase(it);
1210 connections_list m_connected_slots;
1213 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1214 class arg5_type, class mt_policy>
1215 class _signal_base5 : public _signal_base<mt_policy>
1218 typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type,
1219 arg4_type, arg5_type, mt_policy> *> connections_list;
1226 _signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
1227 arg5_type, mt_policy>& s)
1228 : _signal_base<mt_policy>(s)
1230 lock_block<mt_policy> lock(this);
1231 typename connections_list::const_iterator it = s.m_connected_slots.begin();
1232 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1236 (*it)->getdest()->signal_connect(this);
1237 m_connected_slots.push_back((*it)->clone());
1243 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1245 lock_block<mt_policy> lock(this);
1246 typename connections_list::iterator it = m_connected_slots.begin();
1247 typename connections_list::iterator itEnd = m_connected_slots.end();
1251 if((*it)->getdest() == oldtarget)
1253 m_connected_slots.push_back((*it)->duplicate(newtarget));
1267 lock_block<mt_policy> lock(this);
1268 typename connections_list::const_iterator it = m_connected_slots.begin();
1269 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1273 void disconnect_all()
1275 lock_block<mt_policy> lock(this);
1276 typename connections_list::const_iterator it = m_connected_slots.begin();
1277 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1281 (*it)->getdest()->signal_disconnect(this);
1287 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1291 bool connected(has_slots_interface* pclass)
1293 lock_block<mt_policy> lock(this);
1294 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1295 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1300 if ((*it)->getdest() == pclass)
1308 void disconnect(has_slots_interface* pclass)
1310 lock_block<mt_policy> lock(this);
1311 typename connections_list::iterator it = m_connected_slots.begin();
1312 typename connections_list::iterator itEnd = m_connected_slots.end();
1316 if((*it)->getdest() == pclass)
1319 m_connected_slots.erase(it);
1320 pclass->signal_disconnect(this);
1328 void slot_disconnect(has_slots_interface* pslot)
1330 lock_block<mt_policy> lock(this);
1331 typename connections_list::iterator it = m_connected_slots.begin();
1332 typename connections_list::iterator itEnd = m_connected_slots.end();
1336 typename connections_list::iterator itNext = it;
1339 if((*it)->getdest() == pslot)
1342 m_connected_slots.erase(it);
1350 connections_list m_connected_slots;
1353 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1354 class arg5_type, class arg6_type, class mt_policy>
1355 class _signal_base6 : public _signal_base<mt_policy>
1358 typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type,
1359 arg4_type, arg5_type, arg6_type, mt_policy> *> connections_list;
1366 _signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
1367 arg5_type, arg6_type, mt_policy>& s)
1368 : _signal_base<mt_policy>(s)
1370 lock_block<mt_policy> lock(this);
1371 typename connections_list::const_iterator it = s.m_connected_slots.begin();
1372 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1376 (*it)->getdest()->signal_connect(this);
1377 m_connected_slots.push_back((*it)->clone());
1383 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1385 lock_block<mt_policy> lock(this);
1386 typename connections_list::iterator it = m_connected_slots.begin();
1387 typename connections_list::iterator itEnd = m_connected_slots.end();
1391 if((*it)->getdest() == oldtarget)
1393 m_connected_slots.push_back((*it)->duplicate(newtarget));
1407 lock_block<mt_policy> lock(this);
1408 typename connections_list::const_iterator it = m_connected_slots.begin();
1409 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1413 void disconnect_all()
1415 lock_block<mt_policy> lock(this);
1416 typename connections_list::const_iterator it = m_connected_slots.begin();
1417 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1421 (*it)->getdest()->signal_disconnect(this);
1427 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1431 bool connected(has_slots_interface* pclass)
1433 lock_block<mt_policy> lock(this);
1434 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1435 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1440 if ((*it)->getdest() == pclass)
1448 void disconnect(has_slots_interface* pclass)
1450 lock_block<mt_policy> lock(this);
1451 typename connections_list::iterator it = m_connected_slots.begin();
1452 typename connections_list::iterator itEnd = m_connected_slots.end();
1456 if((*it)->getdest() == pclass)
1459 m_connected_slots.erase(it);
1460 pclass->signal_disconnect(this);
1468 void slot_disconnect(has_slots_interface* pslot)
1470 lock_block<mt_policy> lock(this);
1471 typename connections_list::iterator it = m_connected_slots.begin();
1472 typename connections_list::iterator itEnd = m_connected_slots.end();
1476 typename connections_list::iterator itNext = it;
1479 if((*it)->getdest() == pslot)
1482 m_connected_slots.erase(it);
1490 connections_list m_connected_slots;
1493 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1494 class arg5_type, class arg6_type, class arg7_type, class mt_policy>
1495 class _signal_base7 : public _signal_base<mt_policy>
1498 typedef std::list<_connection_base7<arg1_type, arg2_type, arg3_type,
1499 arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> *> connections_list;
1506 _signal_base7(const _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
1507 arg5_type, arg6_type, arg7_type, mt_policy>& s)
1508 : _signal_base<mt_policy>(s)
1510 lock_block<mt_policy> lock(this);
1511 typename connections_list::const_iterator it = s.m_connected_slots.begin();
1512 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1516 (*it)->getdest()->signal_connect(this);
1517 m_connected_slots.push_back((*it)->clone());
1523 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1525 lock_block<mt_policy> lock(this);
1526 typename connections_list::iterator it = m_connected_slots.begin();
1527 typename connections_list::iterator itEnd = m_connected_slots.end();
1531 if((*it)->getdest() == oldtarget)
1533 m_connected_slots.push_back((*it)->duplicate(newtarget));
1547 lock_block<mt_policy> lock(this);
1548 typename connections_list::const_iterator it = m_connected_slots.begin();
1549 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1553 void disconnect_all()
1555 lock_block<mt_policy> lock(this);
1556 typename connections_list::const_iterator it = m_connected_slots.begin();
1557 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1561 (*it)->getdest()->signal_disconnect(this);
1567 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1571 bool connected(has_slots_interface* pclass)
1573 lock_block<mt_policy> lock(this);
1574 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1575 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1580 if ((*it)->getdest() == pclass)
1588 void disconnect(has_slots_interface* pclass)
1590 lock_block<mt_policy> lock(this);
1591 typename connections_list::iterator it = m_connected_slots.begin();
1592 typename connections_list::iterator itEnd = m_connected_slots.end();
1596 if((*it)->getdest() == pclass)
1599 m_connected_slots.erase(it);
1600 pclass->signal_disconnect(this);
1608 void slot_disconnect(has_slots_interface* pslot)
1610 lock_block<mt_policy> lock(this);
1611 typename connections_list::iterator it = m_connected_slots.begin();
1612 typename connections_list::iterator itEnd = m_connected_slots.end();
1616 typename connections_list::iterator itNext = it;
1619 if((*it)->getdest() == pslot)
1622 m_connected_slots.erase(it);
1630 connections_list m_connected_slots;
1633 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1634 class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
1635 class _signal_base8 : public _signal_base<mt_policy>
1638 typedef std::list<_connection_base8<arg1_type, arg2_type, arg3_type,
1639 arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> *>
1647 _signal_base8(const _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
1648 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
1649 : _signal_base<mt_policy>(s)
1651 lock_block<mt_policy> lock(this);
1652 typename connections_list::const_iterator it = s.m_connected_slots.begin();
1653 typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1657 (*it)->getdest()->signal_connect(this);
1658 m_connected_slots.push_back((*it)->clone());
1664 void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget)
1666 lock_block<mt_policy> lock(this);
1667 typename connections_list::iterator it = m_connected_slots.begin();
1668 typename connections_list::iterator itEnd = m_connected_slots.end();
1672 if((*it)->getdest() == oldtarget)
1674 m_connected_slots.push_back((*it)->duplicate(newtarget));
1688 lock_block<mt_policy> lock(this);
1689 typename connections_list::const_iterator it = m_connected_slots.begin();
1690 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1694 void disconnect_all()
1696 lock_block<mt_policy> lock(this);
1697 typename connections_list::const_iterator it = m_connected_slots.begin();
1698 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1702 (*it)->getdest()->signal_disconnect(this);
1708 m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1712 bool connected(has_slots_interface* pclass)
1714 lock_block<mt_policy> lock(this);
1715 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1716 typename connections_list::const_iterator itEnd = m_connected_slots.end();
1721 if ((*it)->getdest() == pclass)
1729 void disconnect(has_slots_interface* pclass)
1731 lock_block<mt_policy> lock(this);
1732 typename connections_list::iterator it = m_connected_slots.begin();
1733 typename connections_list::iterator itEnd = m_connected_slots.end();
1737 if((*it)->getdest() == pclass)
1740 m_connected_slots.erase(it);
1741 pclass->signal_disconnect(this);
1749 void slot_disconnect(has_slots_interface* pslot)
1751 lock_block<mt_policy> lock(this);
1752 typename connections_list::iterator it = m_connected_slots.begin();
1753 typename connections_list::iterator itEnd = m_connected_slots.end();
1757 typename connections_list::iterator itNext = it;
1760 if((*it)->getdest() == pslot)
1763 m_connected_slots.erase(it);
1771 connections_list m_connected_slots;
1775 template<class dest_type, class mt_policy>
1776 class _connection0 : public _connection_base0<mt_policy>
1785 _connection0(dest_type* pobject, void (dest_type::*pmemfun)())
1787 m_pobject = pobject;
1788 m_pmemfun = pmemfun;
1791 virtual ~_connection0()
1795 virtual _connection_base0<mt_policy>* clone()
1797 return new _connection0<dest_type, mt_policy>(*this);
1800 virtual _connection_base0<mt_policy>* duplicate(has_slots_interface* pnewdest)
1802 return new _connection0<dest_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1807 (m_pobject->*m_pmemfun)();
1810 virtual has_slots_interface* getdest() const
1816 dest_type* m_pobject;
1817 void (dest_type::* m_pmemfun)();
1820 template<class dest_type, class arg1_type, class mt_policy>
1821 class _connection1 : public _connection_base1<arg1_type, mt_policy>
1830 _connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type))
1832 m_pobject = pobject;
1833 m_pmemfun = pmemfun;
1836 virtual ~_connection1()
1840 virtual _connection_base1<arg1_type, mt_policy>* clone()
1842 return new _connection1<dest_type, arg1_type, mt_policy>(*this);
1845 virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1847 return new _connection1<dest_type, arg1_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1850 virtual void emit(arg1_type a1)
1852 (m_pobject->*m_pmemfun)(a1);
1855 virtual has_slots_interface* getdest() const
1861 dest_type* m_pobject;
1862 void (dest_type::* m_pmemfun)(arg1_type);
1865 template<class dest_type, class arg1_type, class arg2_type, class mt_policy>
1866 class _connection2 : public _connection_base2<arg1_type, arg2_type, mt_policy>
1875 _connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1878 m_pobject = pobject;
1879 m_pmemfun = pmemfun;
1882 virtual ~_connection2()
1886 virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone()
1888 return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>(*this);
1891 virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1893 return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1896 virtual void emit(arg1_type a1, arg2_type a2)
1898 (m_pobject->*m_pmemfun)(a1, a2);
1901 virtual has_slots_interface* getdest() const
1907 dest_type* m_pobject;
1908 void (dest_type::* m_pmemfun)(arg1_type, arg2_type);
1911 template<class dest_type, class arg1_type, class arg2_type, class arg3_type, class mt_policy>
1912 class _connection3 : public _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>
1921 _connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1922 arg2_type, arg3_type))
1924 m_pobject = pobject;
1925 m_pmemfun = pmemfun;
1928 virtual ~_connection3()
1932 virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone()
1934 return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>(*this);
1937 virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1939 return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1942 virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3)
1944 (m_pobject->*m_pmemfun)(a1, a2, a3);
1947 virtual has_slots_interface* getdest() const
1953 dest_type* m_pobject;
1954 void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type);
1957 template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1958 class arg4_type, class mt_policy>
1959 class _connection4 : public _connection_base4<arg1_type, arg2_type,
1960 arg3_type, arg4_type, mt_policy>
1969 _connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1970 arg2_type, arg3_type, arg4_type))
1972 m_pobject = pobject;
1973 m_pmemfun = pmemfun;
1976 virtual ~_connection4()
1980 virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone()
1982 return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(*this);
1985 virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
1987 return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1990 virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3,
1993 (m_pobject->*m_pmemfun)(a1, a2, a3, a4);
1996 virtual has_slots_interface* getdest() const
2002 dest_type* m_pobject;
2003 void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type,
2007 template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2008 class arg4_type, class arg5_type, class mt_policy>
2009 class _connection5 : public _connection_base5<arg1_type, arg2_type,
2010 arg3_type, arg4_type, arg5_type, mt_policy>
2019 _connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2020 arg2_type, arg3_type, arg4_type, arg5_type))
2022 m_pobject = pobject;
2023 m_pmemfun = pmemfun;
2026 virtual ~_connection5()
2030 virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2031 arg5_type, mt_policy>* clone()
2033 return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2034 arg5_type, mt_policy>(*this);
2037 virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2038 arg5_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2040 return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2041 arg5_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2044 virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2047 (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5);
2050 virtual has_slots_interface* getdest() const
2056 dest_type* m_pobject;
2057 void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2061 template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2062 class arg4_type, class arg5_type, class arg6_type, class mt_policy>
2063 class _connection6 : public _connection_base6<arg1_type, arg2_type,
2064 arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>
2073 _connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2074 arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
2076 m_pobject = pobject;
2077 m_pmemfun = pmemfun;
2080 virtual ~_connection6()
2084 virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2085 arg5_type, arg6_type, mt_policy>* clone()
2087 return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2088 arg5_type, arg6_type, mt_policy>(*this);
2091 virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2092 arg5_type, arg6_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2094 return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2095 arg5_type, arg6_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2098 virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2099 arg5_type a5, arg6_type a6)
2101 (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6);
2104 virtual has_slots_interface* getdest() const
2110 dest_type* m_pobject;
2111 void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2112 arg5_type, arg6_type);
2115 template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2116 class arg4_type, class arg5_type, class arg6_type, class arg7_type, class mt_policy>
2117 class _connection7 : public _connection_base7<arg1_type, arg2_type,
2118 arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
2127 _connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2128 arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type))
2130 m_pobject = pobject;
2131 m_pmemfun = pmemfun;
2134 virtual ~_connection7()
2138 virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2139 arg5_type, arg6_type, arg7_type, mt_policy>* clone()
2141 return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2142 arg5_type, arg6_type, arg7_type, mt_policy>(*this);
2145 virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2146 arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2148 return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2149 arg5_type, arg6_type, arg7_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2152 virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2153 arg5_type a5, arg6_type a6, arg7_type a7)
2155 (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7);
2158 virtual has_slots_interface* getdest() const
2164 dest_type* m_pobject;
2165 void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2166 arg5_type, arg6_type, arg7_type);
2169 template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2170 class arg4_type, class arg5_type, class arg6_type, class arg7_type,
2171 class arg8_type, class mt_policy>
2172 class _connection8 : public _connection_base8<arg1_type, arg2_type,
2173 arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
2182 _connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2183 arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2184 arg7_type, arg8_type))
2186 m_pobject = pobject;
2187 m_pmemfun = pmemfun;
2190 virtual ~_connection8()
2194 virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2195 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone()
2197 return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2198 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(*this);
2201 virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2202 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots_interface* pnewdest)
2204 return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2205 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2208 virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2209 arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2211 (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8);
2214 virtual has_slots_interface* getdest() const
2220 dest_type* m_pobject;
2221 void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2222 arg5_type, arg6_type, arg7_type, arg8_type);
2225 template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2226 class signal0 : public _signal_base0<mt_policy>
2229 typedef _signal_base0<mt_policy> base;
2230 typedef typename base::connections_list connections_list;
2231 using base::m_connected_slots;
2238 signal0(const signal0<mt_policy>& s)
2239 : _signal_base0<mt_policy>(s)
2244 template<class desttype>
2245 void connect(desttype* pclass, void (desttype::*pmemfun)())
2247 lock_block<mt_policy> lock(this);
2248 _connection0<desttype, mt_policy>* conn =
2249 new _connection0<desttype, mt_policy>(pclass, pmemfun);
2250 m_connected_slots.push_back(conn);
2251 pclass->signal_connect(this);
2256 lock_block<mt_policy> lock(this);
2257 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2258 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2273 lock_block<mt_policy> lock(this);
2274 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2275 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2289 template<class arg1_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2290 class signal1 : public _signal_base1<arg1_type, mt_policy>
2293 typedef _signal_base1<arg1_type, mt_policy> base;
2294 typedef typename base::connections_list connections_list;
2295 using base::m_connected_slots;
2302 signal1(const signal1<arg1_type, mt_policy>& s)
2303 : _signal_base1<arg1_type, mt_policy>(s)
2308 template<class desttype>
2309 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type))
2311 lock_block<mt_policy> lock(this);
2312 _connection1<desttype, arg1_type, mt_policy>* conn =
2313 new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun);
2314 m_connected_slots.push_back(conn);
2315 pclass->signal_connect(this);
2318 void emit(arg1_type a1)
2320 lock_block<mt_policy> lock(this);
2321 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2322 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2335 void operator()(arg1_type a1)
2337 lock_block<mt_policy> lock(this);
2338 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2339 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2353 template<class arg1_type, class arg2_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2354 class signal2 : public _signal_base2<arg1_type, arg2_type, mt_policy>
2357 typedef _signal_base2<arg1_type, arg2_type, mt_policy> base;
2358 typedef typename base::connections_list connections_list;
2359 using base::m_connected_slots;
2366 signal2(const signal2<arg1_type, arg2_type, mt_policy>& s)
2367 : _signal_base2<arg1_type, arg2_type, mt_policy>(s)
2372 template<class desttype>
2373 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2376 lock_block<mt_policy> lock(this);
2377 _connection2<desttype, arg1_type, arg2_type, mt_policy>* conn = new
2378 _connection2<desttype, arg1_type, arg2_type, mt_policy>(pclass, pmemfun);
2379 m_connected_slots.push_back(conn);
2380 pclass->signal_connect(this);
2383 void emit(arg1_type a1, arg2_type a2)
2385 lock_block<mt_policy> lock(this);
2386 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2387 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2394 (*it)->emit(a1, a2);
2400 void operator()(arg1_type a1, arg2_type a2)
2402 lock_block<mt_policy> lock(this);
2403 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2404 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2411 (*it)->emit(a1, a2);
2418 template<class arg1_type, class arg2_type, class arg3_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2419 class signal3 : public _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>
2422 typedef _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> base;
2423 typedef typename base::connections_list connections_list;
2424 using base::m_connected_slots;
2431 signal3(const signal3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
2432 : _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>(s)
2437 template<class desttype>
2438 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2439 arg2_type, arg3_type))
2441 lock_block<mt_policy> lock(this);
2442 _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn =
2443 new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass,
2445 m_connected_slots.push_back(conn);
2446 pclass->signal_connect(this);
2449 void emit(arg1_type a1, arg2_type a2, arg3_type a3)
2451 lock_block<mt_policy> lock(this);
2452 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2453 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2460 (*it)->emit(a1, a2, a3);
2466 void operator()(arg1_type a1, arg2_type a2, arg3_type a3)
2468 lock_block<mt_policy> lock(this);
2469 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2470 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2477 (*it)->emit(a1, a2, a3);
2484 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2485 class signal4 : public _signal_base4<arg1_type, arg2_type, arg3_type,
2486 arg4_type, mt_policy>
2489 typedef _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> base;
2490 typedef typename base::connections_list connections_list;
2491 using base::m_connected_slots;
2498 signal4(const signal4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
2499 : _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(s)
2504 template<class desttype>
2505 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2506 arg2_type, arg3_type, arg4_type))
2508 lock_block<mt_policy> lock(this);
2509 _connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>*
2510 conn = new _connection4<desttype, arg1_type, arg2_type, arg3_type,
2511 arg4_type, mt_policy>(pclass, pmemfun);
2512 m_connected_slots.push_back(conn);
2513 pclass->signal_connect(this);
2516 void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2518 lock_block<mt_policy> lock(this);
2519 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2520 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2527 (*it)->emit(a1, a2, a3, a4);
2533 void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2535 lock_block<mt_policy> lock(this);
2536 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2537 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2544 (*it)->emit(a1, a2, a3, a4);
2551 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2552 class arg5_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2553 class signal5 : public _signal_base5<arg1_type, arg2_type, arg3_type,
2554 arg4_type, arg5_type, mt_policy>
2557 typedef _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> base;
2558 typedef typename base::connections_list connections_list;
2559 using base::m_connected_slots;
2566 signal5(const signal5<arg1_type, arg2_type, arg3_type, arg4_type,
2567 arg5_type, mt_policy>& s)
2568 : _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2569 arg5_type, mt_policy>(s)
2574 template<class desttype>
2575 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2576 arg2_type, arg3_type, arg4_type, arg5_type))
2578 lock_block<mt_policy> lock(this);
2579 _connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2580 arg5_type, mt_policy>* conn = new _connection5<desttype, arg1_type, arg2_type,
2581 arg3_type, arg4_type, arg5_type, mt_policy>(pclass, pmemfun);
2582 m_connected_slots.push_back(conn);
2583 pclass->signal_connect(this);
2586 void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2589 lock_block<mt_policy> lock(this);
2590 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2591 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2598 (*it)->emit(a1, a2, a3, a4, a5);
2604 void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2607 lock_block<mt_policy> lock(this);
2608 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2609 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2616 (*it)->emit(a1, a2, a3, a4, a5);
2624 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2625 class arg5_type, class arg6_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2626 class signal6 : public _signal_base6<arg1_type, arg2_type, arg3_type,
2627 arg4_type, arg5_type, arg6_type, mt_policy>
2630 typedef _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> base;
2631 typedef typename base::connections_list connections_list;
2632 using base::m_connected_slots;
2639 signal6(const signal6<arg1_type, arg2_type, arg3_type, arg4_type,
2640 arg5_type, arg6_type, mt_policy>& s)
2641 : _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2642 arg5_type, arg6_type, mt_policy>(s)
2647 template<class desttype>
2648 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2649 arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
2651 lock_block<mt_policy> lock(this);
2652 _connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2653 arg5_type, arg6_type, mt_policy>* conn =
2654 new _connection6<desttype, arg1_type, arg2_type, arg3_type,
2655 arg4_type, arg5_type, arg6_type, mt_policy>(pclass, pmemfun);
2656 m_connected_slots.push_back(conn);
2657 pclass->signal_connect(this);
2660 void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2661 arg5_type a5, arg6_type a6)
2663 lock_block<mt_policy> lock(this);
2664 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2665 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2672 (*it)->emit(a1, a2, a3, a4, a5, a6);
2678 void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2679 arg5_type a5, arg6_type a6)
2681 lock_block<mt_policy> lock(this);
2682 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2683 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2690 (*it)->emit(a1, a2, a3, a4, a5, a6);
2697 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2698 class arg5_type, class arg6_type, class arg7_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2699 class signal7 : public _signal_base7<arg1_type, arg2_type, arg3_type,
2700 arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
2703 typedef _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2704 arg5_type, arg6_type, arg7_type, mt_policy> base;
2705 typedef typename base::connections_list connections_list;
2706 using base::m_connected_slots;
2713 signal7(const signal7<arg1_type, arg2_type, arg3_type, arg4_type,
2714 arg5_type, arg6_type, arg7_type, mt_policy>& s)
2715 : _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2716 arg5_type, arg6_type, arg7_type, mt_policy>(s)
2721 template<class desttype>
2722 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2723 arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2726 lock_block<mt_policy> lock(this);
2727 _connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2728 arg5_type, arg6_type, arg7_type, mt_policy>* conn =
2729 new _connection7<desttype, arg1_type, arg2_type, arg3_type,
2730 arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(pclass, pmemfun);
2731 m_connected_slots.push_back(conn);
2732 pclass->signal_connect(this);
2735 void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2736 arg5_type a5, arg6_type a6, arg7_type a7)
2738 lock_block<mt_policy> lock(this);
2739 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2740 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2747 (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2753 void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2754 arg5_type a5, arg6_type a6, arg7_type a7)
2756 lock_block<mt_policy> lock(this);
2757 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2758 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2765 (*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2772 template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2773 class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2774 class signal8 : public _signal_base8<arg1_type, arg2_type, arg3_type,
2775 arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
2778 typedef _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2779 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> base;
2780 typedef typename base::connections_list connections_list;
2781 using base::m_connected_slots;
2788 signal8(const signal8<arg1_type, arg2_type, arg3_type, arg4_type,
2789 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
2790 : _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2791 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(s)
2796 template<class desttype>
2797 void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2798 arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2799 arg7_type, arg8_type))
2801 lock_block<mt_policy> lock(this);
2802 _connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2803 arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn =
2804 new _connection8<desttype, arg1_type, arg2_type, arg3_type,
2805 arg4_type, arg5_type, arg6_type, arg7_type,
2806 arg8_type, mt_policy>(pclass, pmemfun);
2807 m_connected_slots.push_back(conn);
2808 pclass->signal_connect(this);
2811 void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2812 arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2814 lock_block<mt_policy> lock(this);
2815 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2816 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2823 (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2829 void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2830 arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2832 lock_block<mt_policy> lock(this);
2833 typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2834 typename connections_list::const_iterator itEnd = m_connected_slots.end();
2841 (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2848 }; // namespace sigslot
2850 #endif // TALK_BASE_SIGSLOT_H__