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 // For now, this avoids windows.h in bindings (PeerConnectionImpl.h) on WIN32
98 // TODO: wrap win32 crit section and move to another file instead (Bug 932570)
99 #define SIGSLOT_LEAVE_OUT_MULTITHREADING 1
101 #if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS))
102 # define _SIGSLOT_SINGLE_THREADED
104 # define _SIGSLOT_HAS_WIN32_THREADS
105 # ifndef SIGSLOT_LEAVE_OUT_MULTITHREADING
106 # if !defined(WIN32_LEAN_AND_MEAN)
107 # define WIN32_LEAN_AND_MEAN
109 # include "windows.h"
111 #elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS)
112 # define _SIGSLOT_HAS_POSIX_THREADS
113 # include <pthread.h>
115 # define _SIGSLOT_SINGLE_THREADED
118 #ifndef SIGSLOT_DEFAULT_MT_POLICY
119 # ifdef _SIGSLOT_SINGLE_THREADED
120 # define SIGSLOT_DEFAULT_MT_POLICY single_threaded
122 # define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local
126 // TODO: change this namespace to talk_base?
129 class single_threaded
137 virtual ~single_threaded()
147 virtual void unlock()
153 #ifndef SIGSLOT_LEAVE_OUT_MULTITHREADING
154 # ifdef _SIGSLOT_HAS_WIN32_THREADS
156 // The multi threading policies only get compiled in if they are enabled.
157 class multi_threaded_global
160 multi_threaded_global()
162 static bool isinitialised
= false;
166 InitializeCriticalSection(get_critsec());
167 isinitialised
= true;
171 multi_threaded_global(const multi_threaded_global
&)
176 virtual ~multi_threaded_global()
183 EnterCriticalSection(get_critsec());
186 virtual void unlock()
188 LeaveCriticalSection(get_critsec());
192 CRITICAL_SECTION
* get_critsec()
194 static CRITICAL_SECTION g_critsec
;
199 class multi_threaded_local
202 multi_threaded_local()
204 InitializeCriticalSection(&m_critsec
);
207 multi_threaded_local(const multi_threaded_local
&)
209 InitializeCriticalSection(&m_critsec
);
212 virtual ~multi_threaded_local()
214 DeleteCriticalSection(&m_critsec
);
219 EnterCriticalSection(&m_critsec
);
222 virtual void unlock()
224 LeaveCriticalSection(&m_critsec
);
228 CRITICAL_SECTION m_critsec
;
230 # endif // _SIGSLOT_HAS_WIN32_THREADS
232 # ifdef _SIGSLOT_HAS_POSIX_THREADS
233 // The multi threading policies only get compiled in if they are enabled.
234 class multi_threaded_global
237 multi_threaded_global()
239 pthread_mutex_init(get_mutex(), NULL
);
242 multi_threaded_global(const multi_threaded_global
&)
247 virtual ~multi_threaded_global()
254 pthread_mutex_lock(get_mutex());
257 virtual void unlock()
259 pthread_mutex_unlock(get_mutex());
263 pthread_mutex_t
* get_mutex()
265 static pthread_mutex_t g_mutex
;
270 class multi_threaded_local
273 multi_threaded_local()
275 pthread_mutex_init(&m_mutex
, NULL
);
278 multi_threaded_local(const multi_threaded_local
&)
280 pthread_mutex_init(&m_mutex
, NULL
);
283 virtual ~multi_threaded_local()
285 pthread_mutex_destroy(&m_mutex
);
290 pthread_mutex_lock(&m_mutex
);
293 virtual void unlock()
295 pthread_mutex_unlock(&m_mutex
);
299 pthread_mutex_t m_mutex
;
301 # endif // _SIGSLOT_HAS_POSIX_THREADS
302 #endif // SIGSLOT_LEAVE_OUT_MULTITHREADING
304 template<class mt_policy
>
310 explicit lock_block(mt_policy
*mtx
)
322 class has_slots_interface
;
324 template<class mt_policy
>
325 class _connection_base0
328 virtual ~_connection_base0() {}
329 virtual has_slots_interface
* getdest() const = 0;
330 virtual void emit() = 0;
331 virtual _connection_base0
* clone() = 0;
332 virtual _connection_base0
* duplicate(has_slots_interface
* pnewdest
) = 0;
335 template<class arg1_type
, class mt_policy
>
336 class _connection_base1
339 virtual ~_connection_base1() {}
340 virtual has_slots_interface
* getdest() const = 0;
341 virtual void emit(arg1_type
) = 0;
342 virtual _connection_base1
<arg1_type
, mt_policy
>* clone() = 0;
343 virtual _connection_base1
<arg1_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
346 template<class arg1_type
, class arg2_type
, class mt_policy
>
347 class _connection_base2
350 virtual ~_connection_base2() {}
351 virtual has_slots_interface
* getdest() const = 0;
352 virtual void emit(arg1_type
, arg2_type
) = 0;
353 virtual _connection_base2
<arg1_type
, arg2_type
, mt_policy
>* clone() = 0;
354 virtual _connection_base2
<arg1_type
, arg2_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
357 template<class arg1_type
, class arg2_type
, class arg3_type
, class mt_policy
>
358 class _connection_base3
361 virtual ~_connection_base3() {}
362 virtual has_slots_interface
* getdest() const = 0;
363 virtual void emit(arg1_type
, arg2_type
, arg3_type
) = 0;
364 virtual _connection_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>* clone() = 0;
365 virtual _connection_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
368 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
, class mt_policy
>
369 class _connection_base4
372 virtual ~_connection_base4() {}
373 virtual has_slots_interface
* getdest() const = 0;
374 virtual void emit(arg1_type
, arg2_type
, arg3_type
, arg4_type
) = 0;
375 virtual _connection_base4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>* clone() = 0;
376 virtual _connection_base4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
379 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
380 class arg5_type
, class mt_policy
>
381 class _connection_base5
384 virtual ~_connection_base5() {}
385 virtual has_slots_interface
* getdest() const = 0;
386 virtual void emit(arg1_type
, arg2_type
, arg3_type
, arg4_type
,
388 virtual _connection_base5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
389 arg5_type
, mt_policy
>* clone() = 0;
390 virtual _connection_base5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
391 arg5_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
394 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
395 class arg5_type
, class arg6_type
, class mt_policy
>
396 class _connection_base6
399 virtual ~_connection_base6() {}
400 virtual has_slots_interface
* getdest() const = 0;
401 virtual void emit(arg1_type
, arg2_type
, arg3_type
, arg4_type
, arg5_type
,
403 virtual _connection_base6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
404 arg5_type
, arg6_type
, mt_policy
>* clone() = 0;
405 virtual _connection_base6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
406 arg5_type
, arg6_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
409 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
410 class arg5_type
, class arg6_type
, class arg7_type
, class mt_policy
>
411 class _connection_base7
414 virtual ~_connection_base7() {}
415 virtual has_slots_interface
* getdest() const = 0;
416 virtual void emit(arg1_type
, arg2_type
, arg3_type
, arg4_type
, arg5_type
,
417 arg6_type
, arg7_type
) = 0;
418 virtual _connection_base7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
419 arg5_type
, arg6_type
, arg7_type
, mt_policy
>* clone() = 0;
420 virtual _connection_base7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
421 arg5_type
, arg6_type
, arg7_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
424 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
425 class arg5_type
, class arg6_type
, class arg7_type
, class arg8_type
, class mt_policy
>
426 class _connection_base8
429 virtual ~_connection_base8() {}
430 virtual has_slots_interface
* getdest() const = 0;
431 virtual void emit(arg1_type
, arg2_type
, arg3_type
, arg4_type
, arg5_type
,
432 arg6_type
, arg7_type
, arg8_type
) = 0;
433 virtual _connection_base8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
434 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>* clone() = 0;
435 virtual _connection_base8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
436 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
) = 0;
439 class _signal_base_interface
442 virtual void slot_disconnect(has_slots_interface
* pslot
) = 0;
443 virtual void slot_duplicate(const has_slots_interface
* poldslot
, has_slots_interface
* pnewslot
) = 0;
446 template<class mt_policy
>
447 class _signal_base
: public _signal_base_interface
, public mt_policy
451 class has_slots_interface
454 has_slots_interface()
459 virtual void signal_connect(_signal_base_interface
* sender
) = 0;
461 virtual void signal_disconnect(_signal_base_interface
* sender
) = 0;
463 virtual ~has_slots_interface()
467 virtual void disconnect_all() = 0;
470 template<class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
471 class has_slots
: public has_slots_interface
, public mt_policy
474 typedef std::set
<_signal_base_interface
*> sender_set
;
475 typedef sender_set::const_iterator const_iterator
;
483 has_slots(const has_slots
& hs
)
485 lock_block
<mt_policy
> lock(this);
486 const_iterator it
= hs
.m_senders
.begin();
487 const_iterator itEnd
= hs
.m_senders
.end();
491 (*it
)->slot_duplicate(&hs
, this);
492 m_senders
.insert(*it
);
497 void signal_connect(_signal_base_interface
* sender
)
499 lock_block
<mt_policy
> lock(this);
500 m_senders
.insert(sender
);
503 void signal_disconnect(_signal_base_interface
* sender
)
505 lock_block
<mt_policy
> lock(this);
506 m_senders
.erase(sender
);
514 void disconnect_all()
516 lock_block
<mt_policy
> lock(this);
517 const_iterator it
= m_senders
.begin();
518 const_iterator itEnd
= m_senders
.end();
522 (*it
)->slot_disconnect(this);
526 m_senders
.erase(m_senders
.begin(), m_senders
.end());
530 sender_set m_senders
;
533 template<class mt_policy
>
534 class _signal_base0
: public _signal_base
<mt_policy
>
537 typedef std::list
<_connection_base0
<mt_policy
> *> connections_list
;
544 _signal_base0(const _signal_base0
& s
)
545 : _signal_base
<mt_policy
>(s
)
547 lock_block
<mt_policy
> lock(this);
548 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
549 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
553 (*it
)->getdest()->signal_connect(this);
554 m_connected_slots
.push_back((*it
)->clone());
567 lock_block
<mt_policy
> lock(this);
568 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
569 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
573 void disconnect_all()
575 lock_block
<mt_policy
> lock(this);
576 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
577 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
581 (*it
)->getdest()->signal_disconnect(this);
587 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
591 bool connected(has_slots_interface
* pclass
)
593 lock_block
<mt_policy
> lock(this);
594 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
595 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
600 if ((*it
)->getdest() == pclass
)
608 void disconnect(has_slots_interface
* pclass
)
610 lock_block
<mt_policy
> lock(this);
611 typename
connections_list::iterator it
= m_connected_slots
.begin();
612 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
616 if((*it
)->getdest() == pclass
)
619 m_connected_slots
.erase(it
);
620 pclass
->signal_disconnect(this);
628 void slot_disconnect(has_slots_interface
* pslot
)
630 lock_block
<mt_policy
> lock(this);
631 typename
connections_list::iterator it
= m_connected_slots
.begin();
632 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
636 typename
connections_list::iterator itNext
= it
;
639 if((*it
)->getdest() == pslot
)
642 m_connected_slots
.erase(it
);
649 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
651 lock_block
<mt_policy
> lock(this);
652 typename
connections_list::iterator it
= m_connected_slots
.begin();
653 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
657 if((*it
)->getdest() == oldtarget
)
659 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
667 connections_list m_connected_slots
;
670 template<class arg1_type
, class mt_policy
>
671 class _signal_base1
: public _signal_base
<mt_policy
>
674 typedef std::list
<_connection_base1
<arg1_type
, mt_policy
> *> connections_list
;
681 _signal_base1(const _signal_base1
<arg1_type
, mt_policy
>& s
)
682 : _signal_base
<mt_policy
>(s
)
684 lock_block
<mt_policy
> lock(this);
685 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
686 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
690 (*it
)->getdest()->signal_connect(this);
691 m_connected_slots
.push_back((*it
)->clone());
697 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
699 lock_block
<mt_policy
> lock(this);
700 typename
connections_list::iterator it
= m_connected_slots
.begin();
701 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
705 if((*it
)->getdest() == oldtarget
)
707 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
721 lock_block
<mt_policy
> lock(this);
722 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
723 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
727 void disconnect_all()
729 lock_block
<mt_policy
> lock(this);
730 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
731 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
735 (*it
)->getdest()->signal_disconnect(this);
741 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
745 bool connected(has_slots_interface
* pclass
)
747 lock_block
<mt_policy
> lock(this);
748 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
749 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
754 if ((*it
)->getdest() == pclass
)
762 void disconnect(has_slots_interface
* pclass
)
764 lock_block
<mt_policy
> lock(this);
765 typename
connections_list::iterator it
= m_connected_slots
.begin();
766 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
770 if((*it
)->getdest() == pclass
)
773 m_connected_slots
.erase(it
);
774 pclass
->signal_disconnect(this);
782 void slot_disconnect(has_slots_interface
* pslot
)
784 lock_block
<mt_policy
> lock(this);
785 typename
connections_list::iterator it
= m_connected_slots
.begin();
786 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
790 typename
connections_list::iterator itNext
= it
;
793 if((*it
)->getdest() == pslot
)
796 m_connected_slots
.erase(it
);
805 connections_list m_connected_slots
;
808 template<class arg1_type
, class arg2_type
, class mt_policy
>
809 class _signal_base2
: public _signal_base
<mt_policy
>
812 typedef std::list
<_connection_base2
<arg1_type
, arg2_type
, mt_policy
> *>
820 _signal_base2(const _signal_base2
<arg1_type
, arg2_type
, mt_policy
>& s
)
821 : _signal_base
<mt_policy
>(s
)
823 lock_block
<mt_policy
> lock(this);
824 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
825 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
829 (*it
)->getdest()->signal_connect(this);
830 m_connected_slots
.push_back((*it
)->clone());
836 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
838 lock_block
<mt_policy
> lock(this);
839 typename
connections_list::iterator it
= m_connected_slots
.begin();
840 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
844 if((*it
)->getdest() == oldtarget
)
846 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
860 lock_block
<mt_policy
> lock(this);
861 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
862 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
866 void disconnect_all()
868 lock_block
<mt_policy
> lock(this);
869 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
870 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
874 (*it
)->getdest()->signal_disconnect(this);
880 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
884 bool connected(has_slots_interface
* pclass
)
886 lock_block
<mt_policy
> lock(this);
887 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
888 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
893 if ((*it
)->getdest() == pclass
)
901 void disconnect(has_slots_interface
* pclass
)
903 lock_block
<mt_policy
> lock(this);
904 typename
connections_list::iterator it
= m_connected_slots
.begin();
905 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
909 if((*it
)->getdest() == pclass
)
912 m_connected_slots
.erase(it
);
913 pclass
->signal_disconnect(this);
921 void slot_disconnect(has_slots_interface
* pslot
)
923 lock_block
<mt_policy
> lock(this);
924 typename
connections_list::iterator it
= m_connected_slots
.begin();
925 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
929 typename
connections_list::iterator itNext
= it
;
932 if((*it
)->getdest() == pslot
)
935 m_connected_slots
.erase(it
);
943 connections_list m_connected_slots
;
946 template<class arg1_type
, class arg2_type
, class arg3_type
, class mt_policy
>
947 class _signal_base3
: public _signal_base
<mt_policy
>
950 typedef std::list
<_connection_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
> *>
958 _signal_base3(const _signal_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>& s
)
959 : _signal_base
<mt_policy
>(s
)
961 lock_block
<mt_policy
> lock(this);
962 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
963 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
967 (*it
)->getdest()->signal_connect(this);
968 m_connected_slots
.push_back((*it
)->clone());
974 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
976 lock_block
<mt_policy
> lock(this);
977 typename
connections_list::iterator it
= m_connected_slots
.begin();
978 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
982 if((*it
)->getdest() == oldtarget
)
984 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
998 lock_block
<mt_policy
> lock(this);
999 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1000 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1004 void disconnect_all()
1006 lock_block
<mt_policy
> lock(this);
1007 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1008 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1012 (*it
)->getdest()->signal_disconnect(this);
1018 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
1022 bool connected(has_slots_interface
* pclass
)
1024 lock_block
<mt_policy
> lock(this);
1025 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
1026 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1031 if ((*it
)->getdest() == pclass
)
1039 void disconnect(has_slots_interface
* pclass
)
1041 lock_block
<mt_policy
> lock(this);
1042 typename
connections_list::iterator it
= m_connected_slots
.begin();
1043 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1047 if((*it
)->getdest() == pclass
)
1050 m_connected_slots
.erase(it
);
1051 pclass
->signal_disconnect(this);
1059 void slot_disconnect(has_slots_interface
* pslot
)
1061 lock_block
<mt_policy
> lock(this);
1062 typename
connections_list::iterator it
= m_connected_slots
.begin();
1063 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1067 typename
connections_list::iterator itNext
= it
;
1070 if((*it
)->getdest() == pslot
)
1073 m_connected_slots
.erase(it
);
1081 connections_list m_connected_slots
;
1084 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
, class mt_policy
>
1085 class _signal_base4
: public _signal_base
<mt_policy
>
1088 typedef std::list
<_connection_base4
<arg1_type
, arg2_type
, arg3_type
,
1089 arg4_type
, mt_policy
> *> connections_list
;
1096 _signal_base4(const _signal_base4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>& s
)
1097 : _signal_base
<mt_policy
>(s
)
1099 lock_block
<mt_policy
> lock(this);
1100 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
1101 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
1105 (*it
)->getdest()->signal_connect(this);
1106 m_connected_slots
.push_back((*it
)->clone());
1112 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
1114 lock_block
<mt_policy
> lock(this);
1115 typename
connections_list::iterator it
= m_connected_slots
.begin();
1116 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1120 if((*it
)->getdest() == oldtarget
)
1122 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
1136 lock_block
<mt_policy
> lock(this);
1137 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1138 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1142 void disconnect_all()
1144 lock_block
<mt_policy
> lock(this);
1145 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1146 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1150 (*it
)->getdest()->signal_disconnect(this);
1156 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
1160 bool connected(has_slots_interface
* pclass
)
1162 lock_block
<mt_policy
> lock(this);
1163 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
1164 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1169 if ((*it
)->getdest() == pclass
)
1177 void disconnect(has_slots_interface
* pclass
)
1179 lock_block
<mt_policy
> lock(this);
1180 typename
connections_list::iterator it
= m_connected_slots
.begin();
1181 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1185 if((*it
)->getdest() == pclass
)
1188 m_connected_slots
.erase(it
);
1189 pclass
->signal_disconnect(this);
1197 void slot_disconnect(has_slots_interface
* pslot
)
1199 lock_block
<mt_policy
> lock(this);
1200 typename
connections_list::iterator it
= m_connected_slots
.begin();
1201 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1205 typename
connections_list::iterator itNext
= it
;
1208 if((*it
)->getdest() == pslot
)
1211 m_connected_slots
.erase(it
);
1219 connections_list m_connected_slots
;
1222 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
1223 class arg5_type
, class mt_policy
>
1224 class _signal_base5
: public _signal_base
<mt_policy
>
1227 typedef std::list
<_connection_base5
<arg1_type
, arg2_type
, arg3_type
,
1228 arg4_type
, arg5_type
, mt_policy
> *> connections_list
;
1235 _signal_base5(const _signal_base5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
1236 arg5_type
, mt_policy
>& s
)
1237 : _signal_base
<mt_policy
>(s
)
1239 lock_block
<mt_policy
> lock(this);
1240 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
1241 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
1245 (*it
)->getdest()->signal_connect(this);
1246 m_connected_slots
.push_back((*it
)->clone());
1252 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
1254 lock_block
<mt_policy
> lock(this);
1255 typename
connections_list::iterator it
= m_connected_slots
.begin();
1256 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1260 if((*it
)->getdest() == oldtarget
)
1262 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
1276 lock_block
<mt_policy
> lock(this);
1277 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1278 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1282 void disconnect_all()
1284 lock_block
<mt_policy
> lock(this);
1285 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1286 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1290 (*it
)->getdest()->signal_disconnect(this);
1296 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
1300 bool connected(has_slots_interface
* pclass
)
1302 lock_block
<mt_policy
> lock(this);
1303 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
1304 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1309 if ((*it
)->getdest() == pclass
)
1317 void disconnect(has_slots_interface
* pclass
)
1319 lock_block
<mt_policy
> lock(this);
1320 typename
connections_list::iterator it
= m_connected_slots
.begin();
1321 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1325 if((*it
)->getdest() == pclass
)
1328 m_connected_slots
.erase(it
);
1329 pclass
->signal_disconnect(this);
1337 void slot_disconnect(has_slots_interface
* pslot
)
1339 lock_block
<mt_policy
> lock(this);
1340 typename
connections_list::iterator it
= m_connected_slots
.begin();
1341 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1345 typename
connections_list::iterator itNext
= it
;
1348 if((*it
)->getdest() == pslot
)
1351 m_connected_slots
.erase(it
);
1359 connections_list m_connected_slots
;
1362 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
1363 class arg5_type
, class arg6_type
, class mt_policy
>
1364 class _signal_base6
: public _signal_base
<mt_policy
>
1367 typedef std::list
<_connection_base6
<arg1_type
, arg2_type
, arg3_type
,
1368 arg4_type
, arg5_type
, arg6_type
, mt_policy
> *> connections_list
;
1375 _signal_base6(const _signal_base6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
1376 arg5_type
, arg6_type
, mt_policy
>& s
)
1377 : _signal_base
<mt_policy
>(s
)
1379 lock_block
<mt_policy
> lock(this);
1380 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
1381 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
1385 (*it
)->getdest()->signal_connect(this);
1386 m_connected_slots
.push_back((*it
)->clone());
1392 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
1394 lock_block
<mt_policy
> lock(this);
1395 typename
connections_list::iterator it
= m_connected_slots
.begin();
1396 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1400 if((*it
)->getdest() == oldtarget
)
1402 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
1416 lock_block
<mt_policy
> lock(this);
1417 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1418 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1422 void disconnect_all()
1424 lock_block
<mt_policy
> lock(this);
1425 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1426 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1430 (*it
)->getdest()->signal_disconnect(this);
1436 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
1440 bool connected(has_slots_interface
* pclass
)
1442 lock_block
<mt_policy
> lock(this);
1443 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
1444 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1449 if ((*it
)->getdest() == pclass
)
1457 void disconnect(has_slots_interface
* pclass
)
1459 lock_block
<mt_policy
> lock(this);
1460 typename
connections_list::iterator it
= m_connected_slots
.begin();
1461 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1465 if((*it
)->getdest() == pclass
)
1468 m_connected_slots
.erase(it
);
1469 pclass
->signal_disconnect(this);
1477 void slot_disconnect(has_slots_interface
* pslot
)
1479 lock_block
<mt_policy
> lock(this);
1480 typename
connections_list::iterator it
= m_connected_slots
.begin();
1481 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1485 typename
connections_list::iterator itNext
= it
;
1488 if((*it
)->getdest() == pslot
)
1491 m_connected_slots
.erase(it
);
1499 connections_list m_connected_slots
;
1502 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
1503 class arg5_type
, class arg6_type
, class arg7_type
, class mt_policy
>
1504 class _signal_base7
: public _signal_base
<mt_policy
>
1507 typedef std::list
<_connection_base7
<arg1_type
, arg2_type
, arg3_type
,
1508 arg4_type
, arg5_type
, arg6_type
, arg7_type
, mt_policy
> *> connections_list
;
1515 _signal_base7(const _signal_base7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
1516 arg5_type
, arg6_type
, arg7_type
, mt_policy
>& s
)
1517 : _signal_base
<mt_policy
>(s
)
1519 lock_block
<mt_policy
> lock(this);
1520 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
1521 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
1525 (*it
)->getdest()->signal_connect(this);
1526 m_connected_slots
.push_back((*it
)->clone());
1532 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
1534 lock_block
<mt_policy
> lock(this);
1535 typename
connections_list::iterator it
= m_connected_slots
.begin();
1536 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1540 if((*it
)->getdest() == oldtarget
)
1542 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
1556 lock_block
<mt_policy
> lock(this);
1557 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1558 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1562 void disconnect_all()
1564 lock_block
<mt_policy
> lock(this);
1565 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1566 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1570 (*it
)->getdest()->signal_disconnect(this);
1576 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
1580 bool connected(has_slots_interface
* pclass
)
1582 lock_block
<mt_policy
> lock(this);
1583 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
1584 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1589 if ((*it
)->getdest() == pclass
)
1597 void disconnect(has_slots_interface
* pclass
)
1599 lock_block
<mt_policy
> lock(this);
1600 typename
connections_list::iterator it
= m_connected_slots
.begin();
1601 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1605 if((*it
)->getdest() == pclass
)
1608 m_connected_slots
.erase(it
);
1609 pclass
->signal_disconnect(this);
1617 void slot_disconnect(has_slots_interface
* pslot
)
1619 lock_block
<mt_policy
> lock(this);
1620 typename
connections_list::iterator it
= m_connected_slots
.begin();
1621 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1625 typename
connections_list::iterator itNext
= it
;
1628 if((*it
)->getdest() == pslot
)
1631 m_connected_slots
.erase(it
);
1639 connections_list m_connected_slots
;
1642 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
1643 class arg5_type
, class arg6_type
, class arg7_type
, class arg8_type
, class mt_policy
>
1644 class _signal_base8
: public _signal_base
<mt_policy
>
1647 typedef std::list
<_connection_base8
<arg1_type
, arg2_type
, arg3_type
,
1648 arg4_type
, arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
> *>
1656 _signal_base8(const _signal_base8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
1657 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>& s
)
1658 : _signal_base
<mt_policy
>(s
)
1660 lock_block
<mt_policy
> lock(this);
1661 typename
connections_list::const_iterator it
= s
.m_connected_slots
.begin();
1662 typename
connections_list::const_iterator itEnd
= s
.m_connected_slots
.end();
1666 (*it
)->getdest()->signal_connect(this);
1667 m_connected_slots
.push_back((*it
)->clone());
1673 void slot_duplicate(const has_slots_interface
* oldtarget
, has_slots_interface
* newtarget
)
1675 lock_block
<mt_policy
> lock(this);
1676 typename
connections_list::iterator it
= m_connected_slots
.begin();
1677 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1681 if((*it
)->getdest() == oldtarget
)
1683 m_connected_slots
.push_back((*it
)->duplicate(newtarget
));
1697 lock_block
<mt_policy
> lock(this);
1698 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1699 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1703 void disconnect_all()
1705 lock_block
<mt_policy
> lock(this);
1706 typename
connections_list::const_iterator it
= m_connected_slots
.begin();
1707 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1711 (*it
)->getdest()->signal_disconnect(this);
1717 m_connected_slots
.erase(m_connected_slots
.begin(), m_connected_slots
.end());
1721 bool connected(has_slots_interface
* pclass
)
1723 lock_block
<mt_policy
> lock(this);
1724 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
1725 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
1730 if ((*it
)->getdest() == pclass
)
1738 void disconnect(has_slots_interface
* pclass
)
1740 lock_block
<mt_policy
> lock(this);
1741 typename
connections_list::iterator it
= m_connected_slots
.begin();
1742 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1746 if((*it
)->getdest() == pclass
)
1749 m_connected_slots
.erase(it
);
1750 pclass
->signal_disconnect(this);
1758 void slot_disconnect(has_slots_interface
* pslot
)
1760 lock_block
<mt_policy
> lock(this);
1761 typename
connections_list::iterator it
= m_connected_slots
.begin();
1762 typename
connections_list::iterator itEnd
= m_connected_slots
.end();
1766 typename
connections_list::iterator itNext
= it
;
1769 if((*it
)->getdest() == pslot
)
1772 m_connected_slots
.erase(it
);
1780 connections_list m_connected_slots
;
1784 template<class dest_type
, class mt_policy
>
1785 class _connection0
: public _connection_base0
<mt_policy
>
1794 _connection0(dest_type
* pobject
, void (dest_type::*pmemfun
)())
1796 m_pobject
= pobject
;
1797 m_pmemfun
= pmemfun
;
1800 virtual ~_connection0()
1804 virtual _connection_base0
<mt_policy
>* clone()
1806 return new _connection0
<dest_type
, mt_policy
>(*this);
1809 virtual _connection_base0
<mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
1811 return new _connection0
<dest_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
1816 (m_pobject
->*m_pmemfun
)();
1819 virtual has_slots_interface
* getdest() const
1825 dest_type
* m_pobject
;
1826 void (dest_type::* m_pmemfun
)();
1829 template<class dest_type
, class arg1_type
, class mt_policy
>
1830 class _connection1
: public _connection_base1
<arg1_type
, mt_policy
>
1839 _connection1(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
))
1841 m_pobject
= pobject
;
1842 m_pmemfun
= pmemfun
;
1845 virtual ~_connection1()
1849 virtual _connection_base1
<arg1_type
, mt_policy
>* clone()
1851 return new _connection1
<dest_type
, arg1_type
, mt_policy
>(*this);
1854 virtual _connection_base1
<arg1_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
1856 return new _connection1
<dest_type
, arg1_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
1859 virtual void emit(arg1_type a1
)
1861 (m_pobject
->*m_pmemfun
)(a1
);
1864 virtual has_slots_interface
* getdest() const
1870 dest_type
* m_pobject
;
1871 void (dest_type::* m_pmemfun
)(arg1_type
);
1874 template<class dest_type
, class arg1_type
, class arg2_type
, class mt_policy
>
1875 class _connection2
: public _connection_base2
<arg1_type
, arg2_type
, mt_policy
>
1884 _connection2(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
,
1887 m_pobject
= pobject
;
1888 m_pmemfun
= pmemfun
;
1891 virtual ~_connection2()
1895 virtual _connection_base2
<arg1_type
, arg2_type
, mt_policy
>* clone()
1897 return new _connection2
<dest_type
, arg1_type
, arg2_type
, mt_policy
>(*this);
1900 virtual _connection_base2
<arg1_type
, arg2_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
1902 return new _connection2
<dest_type
, arg1_type
, arg2_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
1905 virtual void emit(arg1_type a1
, arg2_type a2
)
1907 (m_pobject
->*m_pmemfun
)(a1
, a2
);
1910 virtual has_slots_interface
* getdest() const
1916 dest_type
* m_pobject
;
1917 void (dest_type::* m_pmemfun
)(arg1_type
, arg2_type
);
1920 template<class dest_type
, class arg1_type
, class arg2_type
, class arg3_type
, class mt_policy
>
1921 class _connection3
: public _connection_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>
1930 _connection3(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
,
1931 arg2_type
, arg3_type
))
1933 m_pobject
= pobject
;
1934 m_pmemfun
= pmemfun
;
1937 virtual ~_connection3()
1941 virtual _connection_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>* clone()
1943 return new _connection3
<dest_type
, arg1_type
, arg2_type
, arg3_type
, mt_policy
>(*this);
1946 virtual _connection_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
1948 return new _connection3
<dest_type
, arg1_type
, arg2_type
, arg3_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
1951 virtual void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
)
1953 (m_pobject
->*m_pmemfun
)(a1
, a2
, a3
);
1956 virtual has_slots_interface
* getdest() const
1962 dest_type
* m_pobject
;
1963 void (dest_type::* m_pmemfun
)(arg1_type
, arg2_type
, arg3_type
);
1966 template<class dest_type
, class arg1_type
, class arg2_type
, class arg3_type
,
1967 class arg4_type
, class mt_policy
>
1968 class _connection4
: public _connection_base4
<arg1_type
, arg2_type
,
1969 arg3_type
, arg4_type
, mt_policy
>
1978 _connection4(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
,
1979 arg2_type
, arg3_type
, arg4_type
))
1981 m_pobject
= pobject
;
1982 m_pmemfun
= pmemfun
;
1985 virtual ~_connection4()
1989 virtual _connection_base4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>* clone()
1991 return new _connection4
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>(*this);
1994 virtual _connection_base4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
1996 return new _connection4
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
1999 virtual void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
,
2002 (m_pobject
->*m_pmemfun
)(a1
, a2
, a3
, a4
);
2005 virtual has_slots_interface
* getdest() const
2011 dest_type
* m_pobject
;
2012 void (dest_type::* m_pmemfun
)(arg1_type
, arg2_type
, arg3_type
,
2016 template<class dest_type
, class arg1_type
, class arg2_type
, class arg3_type
,
2017 class arg4_type
, class arg5_type
, class mt_policy
>
2018 class _connection5
: public _connection_base5
<arg1_type
, arg2_type
,
2019 arg3_type
, arg4_type
, arg5_type
, mt_policy
>
2028 _connection5(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
,
2029 arg2_type
, arg3_type
, arg4_type
, arg5_type
))
2031 m_pobject
= pobject
;
2032 m_pmemfun
= pmemfun
;
2035 virtual ~_connection5()
2039 virtual _connection_base5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2040 arg5_type
, mt_policy
>* clone()
2042 return new _connection5
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2043 arg5_type
, mt_policy
>(*this);
2046 virtual _connection_base5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2047 arg5_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
2049 return new _connection5
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2050 arg5_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
2053 virtual void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2056 (m_pobject
->*m_pmemfun
)(a1
, a2
, a3
, a4
, a5
);
2059 virtual has_slots_interface
* getdest() const
2065 dest_type
* m_pobject
;
2066 void (dest_type::* m_pmemfun
)(arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2070 template<class dest_type
, class arg1_type
, class arg2_type
, class arg3_type
,
2071 class arg4_type
, class arg5_type
, class arg6_type
, class mt_policy
>
2072 class _connection6
: public _connection_base6
<arg1_type
, arg2_type
,
2073 arg3_type
, arg4_type
, arg5_type
, arg6_type
, mt_policy
>
2082 _connection6(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
,
2083 arg2_type
, arg3_type
, arg4_type
, arg5_type
, arg6_type
))
2085 m_pobject
= pobject
;
2086 m_pmemfun
= pmemfun
;
2089 virtual ~_connection6()
2093 virtual _connection_base6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2094 arg5_type
, arg6_type
, mt_policy
>* clone()
2096 return new _connection6
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2097 arg5_type
, arg6_type
, mt_policy
>(*this);
2100 virtual _connection_base6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2101 arg5_type
, arg6_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
2103 return new _connection6
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2104 arg5_type
, arg6_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
2107 virtual void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2108 arg5_type a5
, arg6_type a6
)
2110 (m_pobject
->*m_pmemfun
)(a1
, a2
, a3
, a4
, a5
, a6
);
2113 virtual has_slots_interface
* getdest() const
2119 dest_type
* m_pobject
;
2120 void (dest_type::* m_pmemfun
)(arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2121 arg5_type
, arg6_type
);
2124 template<class dest_type
, class arg1_type
, class arg2_type
, class arg3_type
,
2125 class arg4_type
, class arg5_type
, class arg6_type
, class arg7_type
, class mt_policy
>
2126 class _connection7
: public _connection_base7
<arg1_type
, arg2_type
,
2127 arg3_type
, arg4_type
, arg5_type
, arg6_type
, arg7_type
, mt_policy
>
2136 _connection7(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
,
2137 arg2_type
, arg3_type
, arg4_type
, arg5_type
, arg6_type
, arg7_type
))
2139 m_pobject
= pobject
;
2140 m_pmemfun
= pmemfun
;
2143 virtual ~_connection7()
2147 virtual _connection_base7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2148 arg5_type
, arg6_type
, arg7_type
, mt_policy
>* clone()
2150 return new _connection7
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2151 arg5_type
, arg6_type
, arg7_type
, mt_policy
>(*this);
2154 virtual _connection_base7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2155 arg5_type
, arg6_type
, arg7_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
2157 return new _connection7
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2158 arg5_type
, arg6_type
, arg7_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
2161 virtual void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2162 arg5_type a5
, arg6_type a6
, arg7_type a7
)
2164 (m_pobject
->*m_pmemfun
)(a1
, a2
, a3
, a4
, a5
, a6
, a7
);
2167 virtual has_slots_interface
* getdest() const
2173 dest_type
* m_pobject
;
2174 void (dest_type::* m_pmemfun
)(arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2175 arg5_type
, arg6_type
, arg7_type
);
2178 template<class dest_type
, class arg1_type
, class arg2_type
, class arg3_type
,
2179 class arg4_type
, class arg5_type
, class arg6_type
, class arg7_type
,
2180 class arg8_type
, class mt_policy
>
2181 class _connection8
: public _connection_base8
<arg1_type
, arg2_type
,
2182 arg3_type
, arg4_type
, arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>
2191 _connection8(dest_type
* pobject
, void (dest_type::*pmemfun
)(arg1_type
,
2192 arg2_type
, arg3_type
, arg4_type
, arg5_type
, arg6_type
,
2193 arg7_type
, arg8_type
))
2195 m_pobject
= pobject
;
2196 m_pmemfun
= pmemfun
;
2199 virtual ~_connection8()
2203 virtual _connection_base8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2204 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>* clone()
2206 return new _connection8
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2207 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>(*this);
2210 virtual _connection_base8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2211 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>* duplicate(has_slots_interface
* pnewdest
)
2213 return new _connection8
<dest_type
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2214 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>((dest_type
*)pnewdest
, m_pmemfun
);
2217 virtual void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2218 arg5_type a5
, arg6_type a6
, arg7_type a7
, arg8_type a8
)
2220 (m_pobject
->*m_pmemfun
)(a1
, a2
, a3
, a4
, a5
, a6
, a7
, a8
);
2223 virtual has_slots_interface
* getdest() const
2229 dest_type
* m_pobject
;
2230 void (dest_type::* m_pmemfun
)(arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2231 arg5_type
, arg6_type
, arg7_type
, arg8_type
);
2234 template<class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2235 class signal0
: public _signal_base0
<mt_policy
>
2238 typedef _signal_base0
<mt_policy
> base
;
2239 typedef typename
base::connections_list connections_list
;
2240 using base::m_connected_slots
;
2247 signal0(const signal0
<mt_policy
>& s
)
2248 : _signal_base0
<mt_policy
>(s
)
2253 template<class desttype
>
2254 void connect(desttype
* pclass
, void (desttype::*pmemfun
)())
2256 lock_block
<mt_policy
> lock(this);
2257 _connection0
<desttype
, mt_policy
>* conn
=
2258 new _connection0
<desttype
, mt_policy
>(pclass
, pmemfun
);
2259 m_connected_slots
.push_back(conn
);
2260 pclass
->signal_connect(this);
2265 lock_block
<mt_policy
> lock(this);
2266 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2267 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2282 lock_block
<mt_policy
> lock(this);
2283 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2284 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2298 template<class arg1_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2299 class signal1
: public _signal_base1
<arg1_type
, mt_policy
>
2302 typedef _signal_base1
<arg1_type
, mt_policy
> base
;
2303 typedef typename
base::connections_list connections_list
;
2304 using base::m_connected_slots
;
2311 signal1(const signal1
<arg1_type
, mt_policy
>& s
)
2312 : _signal_base1
<arg1_type
, mt_policy
>(s
)
2317 template<class desttype
>
2318 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
))
2320 lock_block
<mt_policy
> lock(this);
2321 _connection1
<desttype
, arg1_type
, mt_policy
>* conn
=
2322 new _connection1
<desttype
, arg1_type
, mt_policy
>(pclass
, pmemfun
);
2323 m_connected_slots
.push_back(conn
);
2324 pclass
->signal_connect(this);
2327 void emit(arg1_type a1
)
2329 lock_block
<mt_policy
> lock(this);
2330 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2331 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2344 void operator()(arg1_type a1
)
2346 lock_block
<mt_policy
> lock(this);
2347 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2348 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2362 template<class arg1_type
, class arg2_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2363 class signal2
: public _signal_base2
<arg1_type
, arg2_type
, mt_policy
>
2366 typedef _signal_base2
<arg1_type
, arg2_type
, mt_policy
> base
;
2367 typedef typename
base::connections_list connections_list
;
2368 using base::m_connected_slots
;
2375 signal2(const signal2
<arg1_type
, arg2_type
, mt_policy
>& s
)
2376 : _signal_base2
<arg1_type
, arg2_type
, mt_policy
>(s
)
2381 template<class desttype
>
2382 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
,
2385 lock_block
<mt_policy
> lock(this);
2386 _connection2
<desttype
, arg1_type
, arg2_type
, mt_policy
>* conn
= new
2387 _connection2
<desttype
, arg1_type
, arg2_type
, mt_policy
>(pclass
, pmemfun
);
2388 m_connected_slots
.push_back(conn
);
2389 pclass
->signal_connect(this);
2392 void emit(arg1_type a1
, arg2_type a2
)
2394 lock_block
<mt_policy
> lock(this);
2395 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2396 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2403 (*it
)->emit(a1
, a2
);
2409 void operator()(arg1_type a1
, arg2_type a2
)
2411 lock_block
<mt_policy
> lock(this);
2412 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2413 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2420 (*it
)->emit(a1
, a2
);
2427 template<class arg1_type
, class arg2_type
, class arg3_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2428 class signal3
: public _signal_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>
2431 typedef _signal_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
> base
;
2432 typedef typename
base::connections_list connections_list
;
2433 using base::m_connected_slots
;
2440 signal3(const signal3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>& s
)
2441 : _signal_base3
<arg1_type
, arg2_type
, arg3_type
, mt_policy
>(s
)
2446 template<class desttype
>
2447 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
,
2448 arg2_type
, arg3_type
))
2450 lock_block
<mt_policy
> lock(this);
2451 _connection3
<desttype
, arg1_type
, arg2_type
, arg3_type
, mt_policy
>* conn
=
2452 new _connection3
<desttype
, arg1_type
, arg2_type
, arg3_type
, mt_policy
>(pclass
,
2454 m_connected_slots
.push_back(conn
);
2455 pclass
->signal_connect(this);
2458 void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
)
2460 lock_block
<mt_policy
> lock(this);
2461 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2462 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2469 (*it
)->emit(a1
, a2
, a3
);
2475 void operator()(arg1_type a1
, arg2_type a2
, arg3_type a3
)
2477 lock_block
<mt_policy
> lock(this);
2478 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2479 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2486 (*it
)->emit(a1
, a2
, a3
);
2493 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2494 class signal4
: public _signal_base4
<arg1_type
, arg2_type
, arg3_type
,
2495 arg4_type
, mt_policy
>
2498 typedef _signal_base4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
> base
;
2499 typedef typename
base::connections_list connections_list
;
2500 using base::m_connected_slots
;
2507 signal4(const signal4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>& s
)
2508 : _signal_base4
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>(s
)
2513 template<class desttype
>
2514 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
,
2515 arg2_type
, arg3_type
, arg4_type
))
2517 lock_block
<mt_policy
> lock(this);
2518 _connection4
<desttype
, arg1_type
, arg2_type
, arg3_type
, arg4_type
, mt_policy
>*
2519 conn
= new _connection4
<desttype
, arg1_type
, arg2_type
, arg3_type
,
2520 arg4_type
, mt_policy
>(pclass
, pmemfun
);
2521 m_connected_slots
.push_back(conn
);
2522 pclass
->signal_connect(this);
2525 void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
)
2527 lock_block
<mt_policy
> lock(this);
2528 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2529 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2536 (*it
)->emit(a1
, a2
, a3
, a4
);
2542 void operator()(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
)
2544 lock_block
<mt_policy
> lock(this);
2545 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2546 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2553 (*it
)->emit(a1
, a2
, a3
, a4
);
2560 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
2561 class arg5_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2562 class signal5
: public _signal_base5
<arg1_type
, arg2_type
, arg3_type
,
2563 arg4_type
, arg5_type
, mt_policy
>
2566 typedef _signal_base5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, arg5_type
, mt_policy
> base
;
2567 typedef typename
base::connections_list connections_list
;
2568 using base::m_connected_slots
;
2575 signal5(const signal5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2576 arg5_type
, mt_policy
>& s
)
2577 : _signal_base5
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2578 arg5_type
, mt_policy
>(s
)
2583 template<class desttype
>
2584 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
,
2585 arg2_type
, arg3_type
, arg4_type
, arg5_type
))
2587 lock_block
<mt_policy
> lock(this);
2588 _connection5
<desttype
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2589 arg5_type
, mt_policy
>* conn
= new _connection5
<desttype
, arg1_type
, arg2_type
,
2590 arg3_type
, arg4_type
, arg5_type
, mt_policy
>(pclass
, pmemfun
);
2591 m_connected_slots
.push_back(conn
);
2592 pclass
->signal_connect(this);
2595 void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2598 lock_block
<mt_policy
> lock(this);
2599 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2600 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2607 (*it
)->emit(a1
, a2
, a3
, a4
, a5
);
2613 void operator()(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2616 lock_block
<mt_policy
> lock(this);
2617 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2618 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2625 (*it
)->emit(a1
, a2
, a3
, a4
, a5
);
2633 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
2634 class arg5_type
, class arg6_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2635 class signal6
: public _signal_base6
<arg1_type
, arg2_type
, arg3_type
,
2636 arg4_type
, arg5_type
, arg6_type
, mt_policy
>
2639 typedef _signal_base6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
, arg5_type
, arg6_type
, mt_policy
> base
;
2640 typedef typename
base::connections_list connections_list
;
2641 using base::m_connected_slots
;
2648 signal6(const signal6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2649 arg5_type
, arg6_type
, mt_policy
>& s
)
2650 : _signal_base6
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2651 arg5_type
, arg6_type
, mt_policy
>(s
)
2656 template<class desttype
>
2657 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
,
2658 arg2_type
, arg3_type
, arg4_type
, arg5_type
, arg6_type
))
2660 lock_block
<mt_policy
> lock(this);
2661 _connection6
<desttype
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2662 arg5_type
, arg6_type
, mt_policy
>* conn
=
2663 new _connection6
<desttype
, arg1_type
, arg2_type
, arg3_type
,
2664 arg4_type
, arg5_type
, arg6_type
, mt_policy
>(pclass
, pmemfun
);
2665 m_connected_slots
.push_back(conn
);
2666 pclass
->signal_connect(this);
2669 void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2670 arg5_type a5
, arg6_type a6
)
2672 lock_block
<mt_policy
> lock(this);
2673 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2674 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2681 (*it
)->emit(a1
, a2
, a3
, a4
, a5
, a6
);
2687 void operator()(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2688 arg5_type a5
, arg6_type a6
)
2690 lock_block
<mt_policy
> lock(this);
2691 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2692 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2699 (*it
)->emit(a1
, a2
, a3
, a4
, a5
, a6
);
2706 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
2707 class arg5_type
, class arg6_type
, class arg7_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2708 class signal7
: public _signal_base7
<arg1_type
, arg2_type
, arg3_type
,
2709 arg4_type
, arg5_type
, arg6_type
, arg7_type
, mt_policy
>
2712 typedef _signal_base7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2713 arg5_type
, arg6_type
, arg7_type
, mt_policy
> base
;
2714 typedef typename
base::connections_list connections_list
;
2715 using base::m_connected_slots
;
2722 signal7(const signal7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2723 arg5_type
, arg6_type
, arg7_type
, mt_policy
>& s
)
2724 : _signal_base7
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2725 arg5_type
, arg6_type
, arg7_type
, mt_policy
>(s
)
2730 template<class desttype
>
2731 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
,
2732 arg2_type
, arg3_type
, arg4_type
, arg5_type
, arg6_type
,
2735 lock_block
<mt_policy
> lock(this);
2736 _connection7
<desttype
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2737 arg5_type
, arg6_type
, arg7_type
, mt_policy
>* conn
=
2738 new _connection7
<desttype
, arg1_type
, arg2_type
, arg3_type
,
2739 arg4_type
, arg5_type
, arg6_type
, arg7_type
, mt_policy
>(pclass
, pmemfun
);
2740 m_connected_slots
.push_back(conn
);
2741 pclass
->signal_connect(this);
2744 void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2745 arg5_type a5
, arg6_type a6
, arg7_type a7
)
2747 lock_block
<mt_policy
> lock(this);
2748 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2749 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2756 (*it
)->emit(a1
, a2
, a3
, a4
, a5
, a6
, a7
);
2762 void operator()(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2763 arg5_type a5
, arg6_type a6
, arg7_type a7
)
2765 lock_block
<mt_policy
> lock(this);
2766 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2767 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2774 (*it
)->emit(a1
, a2
, a3
, a4
, a5
, a6
, a7
);
2781 template<class arg1_type
, class arg2_type
, class arg3_type
, class arg4_type
,
2782 class arg5_type
, class arg6_type
, class arg7_type
, class arg8_type
, class mt_policy
= SIGSLOT_DEFAULT_MT_POLICY
>
2783 class signal8
: public _signal_base8
<arg1_type
, arg2_type
, arg3_type
,
2784 arg4_type
, arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>
2787 typedef _signal_base8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2788 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
> base
;
2789 typedef typename
base::connections_list connections_list
;
2790 using base::m_connected_slots
;
2797 signal8(const signal8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2798 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>& s
)
2799 : _signal_base8
<arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2800 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>(s
)
2805 template<class desttype
>
2806 void connect(desttype
* pclass
, void (desttype::*pmemfun
)(arg1_type
,
2807 arg2_type
, arg3_type
, arg4_type
, arg5_type
, arg6_type
,
2808 arg7_type
, arg8_type
))
2810 lock_block
<mt_policy
> lock(this);
2811 _connection8
<desttype
, arg1_type
, arg2_type
, arg3_type
, arg4_type
,
2812 arg5_type
, arg6_type
, arg7_type
, arg8_type
, mt_policy
>* conn
=
2813 new _connection8
<desttype
, arg1_type
, arg2_type
, arg3_type
,
2814 arg4_type
, arg5_type
, arg6_type
, arg7_type
,
2815 arg8_type
, mt_policy
>(pclass
, pmemfun
);
2816 m_connected_slots
.push_back(conn
);
2817 pclass
->signal_connect(this);
2820 void emit(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2821 arg5_type a5
, arg6_type a6
, arg7_type a7
, arg8_type a8
)
2823 lock_block
<mt_policy
> lock(this);
2824 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2825 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2832 (*it
)->emit(a1
, a2
, a3
, a4
, a5
, a6
, a7
, a8
);
2838 void operator()(arg1_type a1
, arg2_type a2
, arg3_type a3
, arg4_type a4
,
2839 arg5_type a5
, arg6_type a6
, arg7_type a7
, arg8_type a8
)
2841 lock_block
<mt_policy
> lock(this);
2842 typename
connections_list::const_iterator itNext
, it
= m_connected_slots
.begin();
2843 typename
connections_list::const_iterator itEnd
= m_connected_slots
.end();
2850 (*it
)->emit(a1
, a2
, a3
, a4
, a5
, a6
, a7
, a8
);
2857 } // namespace sigslot
2859 #endif // TALK_BASE_SIGSLOT_H__