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/
78
#ifndef TALK_BASE_SIGSLOT_H__
79
#define TALK_BASE_SIGSLOT_H__
85
// On our copy of sigslot.h, we force single threading
86
#define SIGSLOT_PURE_ISO
88
#if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS))
89
# define _SIGSLOT_SINGLE_THREADED
91
# define _SIGSLOT_HAS_WIN32_THREADS
93
#elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS)
94
# define _SIGSLOT_HAS_POSIX_THREADS
97
# define _SIGSLOT_SINGLE_THREADED
100
#ifndef SIGSLOT_DEFAULT_MT_POLICY
101
# ifdef _SIGSLOT_SINGLE_THREADED
102
# define SIGSLOT_DEFAULT_MT_POLICY single_threaded
104
# define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local
108
// TODO: change this namespace to talk_base?
111
class single_threaded
119
virtual ~single_threaded()
129
virtual void unlock()
135
#ifdef _SIGSLOT_HAS_WIN32_THREADS
136
// The multi threading policies only get compiled in if they are enabled.
137
class multi_threaded_global
140
multi_threaded_global()
142
static bool isinitialised = false;
146
InitializeCriticalSection(get_critsec());
147
isinitialised = true;
151
multi_threaded_global(const multi_threaded_global&)
156
virtual ~multi_threaded_global()
163
EnterCriticalSection(get_critsec());
166
virtual void unlock()
168
LeaveCriticalSection(get_critsec());
172
CRITICAL_SECTION* get_critsec()
174
static CRITICAL_SECTION g_critsec;
179
class multi_threaded_local
182
multi_threaded_local()
184
InitializeCriticalSection(&m_critsec);
187
multi_threaded_local(const multi_threaded_local&)
189
InitializeCriticalSection(&m_critsec);
192
virtual ~multi_threaded_local()
194
DeleteCriticalSection(&m_critsec);
199
EnterCriticalSection(&m_critsec);
202
virtual void unlock()
204
LeaveCriticalSection(&m_critsec);
208
CRITICAL_SECTION m_critsec;
210
#endif // _SIGSLOT_HAS_WIN32_THREADS
212
#ifdef _SIGSLOT_HAS_POSIX_THREADS
213
// The multi threading policies only get compiled in if they are enabled.
214
class multi_threaded_global
217
multi_threaded_global()
219
pthread_mutex_init(get_mutex(), NULL);
222
multi_threaded_global(const multi_threaded_global&)
227
virtual ~multi_threaded_global()
234
pthread_mutex_lock(get_mutex());
237
virtual void unlock()
239
pthread_mutex_unlock(get_mutex());
243
pthread_mutex_t* get_mutex()
245
static pthread_mutex_t g_mutex;
250
class multi_threaded_local
253
multi_threaded_local()
255
pthread_mutex_init(&m_mutex, NULL);
258
multi_threaded_local(const multi_threaded_local&)
260
pthread_mutex_init(&m_mutex, NULL);
263
virtual ~multi_threaded_local()
265
pthread_mutex_destroy(&m_mutex);
270
pthread_mutex_lock(&m_mutex);
273
virtual void unlock()
275
pthread_mutex_unlock(&m_mutex);
279
pthread_mutex_t m_mutex;
281
#endif // _SIGSLOT_HAS_POSIX_THREADS
283
template<class mt_policy>
289
lock_block(mt_policy *mtx)
301
template<class mt_policy>
304
template<class mt_policy>
305
class _connection_base0
308
virtual ~_connection_base0() {}
309
virtual has_slots<mt_policy>* getdest() const = 0;
310
virtual void emit() = 0;
311
virtual _connection_base0* clone() = 0;
312
virtual _connection_base0* duplicate(has_slots<mt_policy>* pnewdest) = 0;
315
template<class arg1_type, class mt_policy>
316
class _connection_base1
319
virtual ~_connection_base1() {}
320
virtual has_slots<mt_policy>* getdest() const = 0;
321
virtual void emit(arg1_type) = 0;
322
virtual _connection_base1<arg1_type, mt_policy>* clone() = 0;
323
virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
326
template<class arg1_type, class arg2_type, class mt_policy>
327
class _connection_base2
330
virtual ~_connection_base2() {}
331
virtual has_slots<mt_policy>* getdest() const = 0;
332
virtual void emit(arg1_type, arg2_type) = 0;
333
virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0;
334
virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
337
template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
338
class _connection_base3
341
virtual ~_connection_base3() {}
342
virtual has_slots<mt_policy>* getdest() const = 0;
343
virtual void emit(arg1_type, arg2_type, arg3_type) = 0;
344
virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0;
345
virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
348
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
349
class _connection_base4
352
virtual ~_connection_base4() {}
353
virtual has_slots<mt_policy>* getdest() const = 0;
354
virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0;
355
virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0;
356
virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
359
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
360
class arg5_type, class mt_policy>
361
class _connection_base5
364
virtual ~_connection_base5() {}
365
virtual has_slots<mt_policy>* getdest() const = 0;
366
virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type,
368
virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
369
arg5_type, mt_policy>* clone() = 0;
370
virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
371
arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
374
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
375
class arg5_type, class arg6_type, class mt_policy>
376
class _connection_base6
379
virtual ~_connection_base6() {}
380
virtual has_slots<mt_policy>* getdest() const = 0;
381
virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
383
virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
384
arg5_type, arg6_type, mt_policy>* clone() = 0;
385
virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
386
arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
389
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
390
class arg5_type, class arg6_type, class arg7_type, class mt_policy>
391
class _connection_base7
394
virtual ~_connection_base7() {}
395
virtual has_slots<mt_policy>* getdest() const = 0;
396
virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
397
arg6_type, arg7_type) = 0;
398
virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
399
arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0;
400
virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
401
arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
404
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
405
class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
406
class _connection_base8
409
virtual ~_connection_base8() {}
410
virtual has_slots<mt_policy>* getdest() const = 0;
411
virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type,
412
arg6_type, arg7_type, arg8_type) = 0;
413
virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
414
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0;
415
virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
416
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0;
419
template<class mt_policy>
420
class _signal_base : public mt_policy
423
virtual void slot_disconnect(has_slots<mt_policy>* pslot) = 0;
424
virtual void slot_duplicate(const has_slots<mt_policy>* poldslot, has_slots<mt_policy>* pnewslot) = 0;
427
template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
428
class has_slots : public mt_policy
431
typedef typename std::set<_signal_base<mt_policy> *> sender_set;
432
typedef typename sender_set::const_iterator const_iterator;
440
has_slots(const has_slots& hs)
443
lock_block<mt_policy> lock(this);
444
const_iterator it = hs.m_senders.begin();
445
const_iterator itEnd = hs.m_senders.end();
449
(*it)->slot_duplicate(&hs, this);
450
m_senders.insert(*it);
455
void signal_connect(_signal_base<mt_policy>* sender)
457
lock_block<mt_policy> lock(this);
458
m_senders.insert(sender);
461
void signal_disconnect(_signal_base<mt_policy>* sender)
463
lock_block<mt_policy> lock(this);
464
m_senders.erase(sender);
472
void disconnect_all()
474
lock_block<mt_policy> lock(this);
475
const_iterator it = m_senders.begin();
476
const_iterator itEnd = m_senders.end();
480
(*it)->slot_disconnect(this);
484
m_senders.erase(m_senders.begin(), m_senders.end());
488
sender_set m_senders;
491
template<class mt_policy>
492
class _signal_base0 : public _signal_base<mt_policy>
495
typedef std::list<_connection_base0<mt_policy> *> connections_list;
502
_signal_base0(const _signal_base0& s)
503
: _signal_base<mt_policy>(s)
505
lock_block<mt_policy> lock(this);
506
typename connections_list::const_iterator it = s.m_connected_slots.begin();
507
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
511
(*it)->getdest()->signal_connect(this);
512
m_connected_slots.push_back((*it)->clone());
525
lock_block<mt_policy> lock(this);
526
typename connections_list::const_iterator it = m_connected_slots.begin();
527
typename connections_list::const_iterator itEnd = m_connected_slots.end();
531
void disconnect_all()
533
lock_block<mt_policy> lock(this);
534
typename connections_list::const_iterator it = m_connected_slots.begin();
535
typename connections_list::const_iterator itEnd = m_connected_slots.end();
539
(*it)->getdest()->signal_disconnect(this);
545
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
549
bool connected(has_slots<mt_policy>* pclass)
551
lock_block<mt_policy> lock(this);
552
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
553
typename connections_list::const_iterator itEnd = m_connected_slots.end();
558
if ((*it)->getdest() == pclass)
566
void disconnect(has_slots<mt_policy>* pclass)
568
lock_block<mt_policy> lock(this);
569
typename connections_list::iterator it = m_connected_slots.begin();
570
typename connections_list::iterator itEnd = m_connected_slots.end();
574
if((*it)->getdest() == pclass)
577
m_connected_slots.erase(it);
578
pclass->signal_disconnect(this);
586
void slot_disconnect(has_slots<mt_policy>* pslot)
588
lock_block<mt_policy> lock(this);
589
typename connections_list::iterator it = m_connected_slots.begin();
590
typename connections_list::iterator itEnd = m_connected_slots.end();
594
typename connections_list::iterator itNext = it;
597
if((*it)->getdest() == pslot)
600
m_connected_slots.erase(it);
607
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
609
lock_block<mt_policy> lock(this);
610
typename connections_list::iterator it = m_connected_slots.begin();
611
typename connections_list::iterator itEnd = m_connected_slots.end();
615
if((*it)->getdest() == oldtarget)
617
m_connected_slots.push_back((*it)->duplicate(newtarget));
625
connections_list m_connected_slots;
628
template<class arg1_type, class mt_policy>
629
class _signal_base1 : public _signal_base<mt_policy>
632
typedef std::list<_connection_base1<arg1_type, mt_policy> *> connections_list;
639
_signal_base1(const _signal_base1<arg1_type, mt_policy>& s)
640
: _signal_base<mt_policy>(s)
642
lock_block<mt_policy> lock(this);
643
typename connections_list::const_iterator it = s.m_connected_slots.begin();
644
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
648
(*it)->getdest()->signal_connect(this);
649
m_connected_slots.push_back((*it)->clone());
655
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
657
lock_block<mt_policy> lock(this);
658
typename connections_list::iterator it = m_connected_slots.begin();
659
typename connections_list::iterator itEnd = m_connected_slots.end();
663
if((*it)->getdest() == oldtarget)
665
m_connected_slots.push_back((*it)->duplicate(newtarget));
679
lock_block<mt_policy> lock(this);
680
typename connections_list::const_iterator it = m_connected_slots.begin();
681
typename connections_list::const_iterator itEnd = m_connected_slots.end();
685
void disconnect_all()
687
lock_block<mt_policy> lock(this);
688
typename connections_list::const_iterator it = m_connected_slots.begin();
689
typename connections_list::const_iterator itEnd = m_connected_slots.end();
693
(*it)->getdest()->signal_disconnect(this);
699
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
703
bool connected(has_slots<mt_policy>* pclass)
705
lock_block<mt_policy> lock(this);
706
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
707
typename connections_list::const_iterator itEnd = m_connected_slots.end();
712
if ((*it)->getdest() == pclass)
720
void disconnect(has_slots<mt_policy>* pclass)
722
lock_block<mt_policy> lock(this);
723
typename connections_list::iterator it = m_connected_slots.begin();
724
typename connections_list::iterator itEnd = m_connected_slots.end();
728
if((*it)->getdest() == pclass)
731
m_connected_slots.erase(it);
732
pclass->signal_disconnect(this);
740
void slot_disconnect(has_slots<mt_policy>* pslot)
742
lock_block<mt_policy> lock(this);
743
typename connections_list::iterator it = m_connected_slots.begin();
744
typename connections_list::iterator itEnd = m_connected_slots.end();
748
typename connections_list::iterator itNext = it;
751
if((*it)->getdest() == pslot)
754
m_connected_slots.erase(it);
763
connections_list m_connected_slots;
766
template<class arg1_type, class arg2_type, class mt_policy>
767
class _signal_base2 : public _signal_base<mt_policy>
770
typedef std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *>
778
_signal_base2(const _signal_base2<arg1_type, arg2_type, mt_policy>& s)
779
: _signal_base<mt_policy>(s)
781
lock_block<mt_policy> lock(this);
782
typename connections_list::const_iterator it = s.m_connected_slots.begin();
783
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
787
(*it)->getdest()->signal_connect(this);
788
m_connected_slots.push_back((*it)->clone());
794
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
796
lock_block<mt_policy> lock(this);
797
typename connections_list::iterator it = m_connected_slots.begin();
798
typename connections_list::iterator itEnd = m_connected_slots.end();
802
if((*it)->getdest() == oldtarget)
804
m_connected_slots.push_back((*it)->duplicate(newtarget));
818
lock_block<mt_policy> lock(this);
819
typename connections_list::const_iterator it = m_connected_slots.begin();
820
typename connections_list::const_iterator itEnd = m_connected_slots.end();
824
void disconnect_all()
826
lock_block<mt_policy> lock(this);
827
typename connections_list::const_iterator it = m_connected_slots.begin();
828
typename connections_list::const_iterator itEnd = m_connected_slots.end();
832
(*it)->getdest()->signal_disconnect(this);
838
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
842
bool connected(has_slots<mt_policy>* pclass)
844
lock_block<mt_policy> lock(this);
845
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
846
typename connections_list::const_iterator itEnd = m_connected_slots.end();
851
if ((*it)->getdest() == pclass)
859
void disconnect(has_slots<mt_policy>* pclass)
861
lock_block<mt_policy> lock(this);
862
typename connections_list::iterator it = m_connected_slots.begin();
863
typename connections_list::iterator itEnd = m_connected_slots.end();
867
if((*it)->getdest() == pclass)
870
m_connected_slots.erase(it);
871
pclass->signal_disconnect(this);
879
void slot_disconnect(has_slots<mt_policy>* pslot)
881
lock_block<mt_policy> lock(this);
882
typename connections_list::iterator it = m_connected_slots.begin();
883
typename connections_list::iterator itEnd = m_connected_slots.end();
887
typename connections_list::iterator itNext = it;
890
if((*it)->getdest() == pslot)
893
m_connected_slots.erase(it);
901
connections_list m_connected_slots;
904
template<class arg1_type, class arg2_type, class arg3_type, class mt_policy>
905
class _signal_base3 : public _signal_base<mt_policy>
908
typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *>
916
_signal_base3(const _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
917
: _signal_base<mt_policy>(s)
919
lock_block<mt_policy> lock(this);
920
typename connections_list::const_iterator it = s.m_connected_slots.begin();
921
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
925
(*it)->getdest()->signal_connect(this);
926
m_connected_slots.push_back((*it)->clone());
932
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
934
lock_block<mt_policy> lock(this);
935
typename connections_list::iterator it = m_connected_slots.begin();
936
typename connections_list::iterator itEnd = m_connected_slots.end();
940
if((*it)->getdest() == oldtarget)
942
m_connected_slots.push_back((*it)->duplicate(newtarget));
956
lock_block<mt_policy> lock(this);
957
typename connections_list::const_iterator it = m_connected_slots.begin();
958
typename connections_list::const_iterator itEnd = m_connected_slots.end();
962
void disconnect_all()
964
lock_block<mt_policy> lock(this);
965
typename connections_list::const_iterator it = m_connected_slots.begin();
966
typename connections_list::const_iterator itEnd = m_connected_slots.end();
970
(*it)->getdest()->signal_disconnect(this);
976
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
980
bool connected(has_slots<mt_policy>* pclass)
982
lock_block<mt_policy> lock(this);
983
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
984
typename connections_list::const_iterator itEnd = m_connected_slots.end();
989
if ((*it)->getdest() == pclass)
997
void disconnect(has_slots<mt_policy>* pclass)
999
lock_block<mt_policy> lock(this);
1000
typename connections_list::iterator it = m_connected_slots.begin();
1001
typename connections_list::iterator itEnd = m_connected_slots.end();
1005
if((*it)->getdest() == pclass)
1008
m_connected_slots.erase(it);
1009
pclass->signal_disconnect(this);
1017
void slot_disconnect(has_slots<mt_policy>* pslot)
1019
lock_block<mt_policy> lock(this);
1020
typename connections_list::iterator it = m_connected_slots.begin();
1021
typename connections_list::iterator itEnd = m_connected_slots.end();
1025
typename connections_list::iterator itNext = it;
1028
if((*it)->getdest() == pslot)
1031
m_connected_slots.erase(it);
1039
connections_list m_connected_slots;
1042
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy>
1043
class _signal_base4 : public _signal_base<mt_policy>
1046
typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type,
1047
arg4_type, mt_policy> *> connections_list;
1054
_signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
1055
: _signal_base<mt_policy>(s)
1057
lock_block<mt_policy> lock(this);
1058
typename connections_list::const_iterator it = s.m_connected_slots.begin();
1059
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1063
(*it)->getdest()->signal_connect(this);
1064
m_connected_slots.push_back((*it)->clone());
1070
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1072
lock_block<mt_policy> lock(this);
1073
typename connections_list::iterator it = m_connected_slots.begin();
1074
typename connections_list::iterator itEnd = m_connected_slots.end();
1078
if((*it)->getdest() == oldtarget)
1080
m_connected_slots.push_back((*it)->duplicate(newtarget));
1094
lock_block<mt_policy> lock(this);
1095
typename connections_list::const_iterator it = m_connected_slots.begin();
1096
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1100
void disconnect_all()
1102
lock_block<mt_policy> lock(this);
1103
typename connections_list::const_iterator it = m_connected_slots.begin();
1104
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1108
(*it)->getdest()->signal_disconnect(this);
1114
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1118
bool connected(has_slots<mt_policy>* pclass)
1120
lock_block<mt_policy> lock(this);
1121
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1122
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1127
if ((*it)->getdest() == pclass)
1135
void disconnect(has_slots<mt_policy>* pclass)
1137
lock_block<mt_policy> lock(this);
1138
typename connections_list::iterator it = m_connected_slots.begin();
1139
typename connections_list::iterator itEnd = m_connected_slots.end();
1143
if((*it)->getdest() == pclass)
1146
m_connected_slots.erase(it);
1147
pclass->signal_disconnect(this);
1155
void slot_disconnect(has_slots<mt_policy>* pslot)
1157
lock_block<mt_policy> lock(this);
1158
typename connections_list::iterator it = m_connected_slots.begin();
1159
typename connections_list::iterator itEnd = m_connected_slots.end();
1163
typename connections_list::iterator itNext = it;
1166
if((*it)->getdest() == pslot)
1169
m_connected_slots.erase(it);
1177
connections_list m_connected_slots;
1180
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1181
class arg5_type, class mt_policy>
1182
class _signal_base5 : public _signal_base<mt_policy>
1185
typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type,
1186
arg4_type, arg5_type, mt_policy> *> connections_list;
1193
_signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
1194
arg5_type, mt_policy>& s)
1195
: _signal_base<mt_policy>(s)
1197
lock_block<mt_policy> lock(this);
1198
typename connections_list::const_iterator it = s.m_connected_slots.begin();
1199
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1203
(*it)->getdest()->signal_connect(this);
1204
m_connected_slots.push_back((*it)->clone());
1210
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1212
lock_block<mt_policy> lock(this);
1213
typename connections_list::iterator it = m_connected_slots.begin();
1214
typename connections_list::iterator itEnd = m_connected_slots.end();
1218
if((*it)->getdest() == oldtarget)
1220
m_connected_slots.push_back((*it)->duplicate(newtarget));
1234
lock_block<mt_policy> lock(this);
1235
typename connections_list::const_iterator it = m_connected_slots.begin();
1236
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1240
void disconnect_all()
1242
lock_block<mt_policy> lock(this);
1243
typename connections_list::const_iterator it = m_connected_slots.begin();
1244
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1248
(*it)->getdest()->signal_disconnect(this);
1254
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1258
bool connected(has_slots<mt_policy>* pclass)
1260
lock_block<mt_policy> lock(this);
1261
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1262
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1267
if ((*it)->getdest() == pclass)
1275
void disconnect(has_slots<mt_policy>* pclass)
1277
lock_block<mt_policy> lock(this);
1278
typename connections_list::iterator it = m_connected_slots.begin();
1279
typename connections_list::iterator itEnd = m_connected_slots.end();
1283
if((*it)->getdest() == pclass)
1286
m_connected_slots.erase(it);
1287
pclass->signal_disconnect(this);
1295
void slot_disconnect(has_slots<mt_policy>* pslot)
1297
lock_block<mt_policy> lock(this);
1298
typename connections_list::iterator it = m_connected_slots.begin();
1299
typename connections_list::iterator itEnd = m_connected_slots.end();
1303
typename connections_list::iterator itNext = it;
1306
if((*it)->getdest() == pslot)
1309
m_connected_slots.erase(it);
1317
connections_list m_connected_slots;
1320
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1321
class arg5_type, class arg6_type, class mt_policy>
1322
class _signal_base6 : public _signal_base<mt_policy>
1325
typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type,
1326
arg4_type, arg5_type, arg6_type, mt_policy> *> connections_list;
1333
_signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
1334
arg5_type, arg6_type, mt_policy>& s)
1335
: _signal_base<mt_policy>(s)
1337
lock_block<mt_policy> lock(this);
1338
typename connections_list::const_iterator it = s.m_connected_slots.begin();
1339
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1343
(*it)->getdest()->signal_connect(this);
1344
m_connected_slots.push_back((*it)->clone());
1350
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1352
lock_block<mt_policy> lock(this);
1353
typename connections_list::iterator it = m_connected_slots.begin();
1354
typename connections_list::iterator itEnd = m_connected_slots.end();
1358
if((*it)->getdest() == oldtarget)
1360
m_connected_slots.push_back((*it)->duplicate(newtarget));
1374
lock_block<mt_policy> lock(this);
1375
typename connections_list::const_iterator it = m_connected_slots.begin();
1376
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1380
void disconnect_all()
1382
lock_block<mt_policy> lock(this);
1383
typename connections_list::const_iterator it = m_connected_slots.begin();
1384
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1388
(*it)->getdest()->signal_disconnect(this);
1394
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1398
bool connected(has_slots<mt_policy>* pclass)
1400
lock_block<mt_policy> lock(this);
1401
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1402
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1407
if ((*it)->getdest() == pclass)
1415
void disconnect(has_slots<mt_policy>* pclass)
1417
lock_block<mt_policy> lock(this);
1418
typename connections_list::iterator it = m_connected_slots.begin();
1419
typename connections_list::iterator itEnd = m_connected_slots.end();
1423
if((*it)->getdest() == pclass)
1426
m_connected_slots.erase(it);
1427
pclass->signal_disconnect(this);
1435
void slot_disconnect(has_slots<mt_policy>* pslot)
1437
lock_block<mt_policy> lock(this);
1438
typename connections_list::iterator it = m_connected_slots.begin();
1439
typename connections_list::iterator itEnd = m_connected_slots.end();
1443
typename connections_list::iterator itNext = it;
1446
if((*it)->getdest() == pslot)
1449
m_connected_slots.erase(it);
1457
connections_list m_connected_slots;
1460
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1461
class arg5_type, class arg6_type, class arg7_type, class mt_policy>
1462
class _signal_base7 : public _signal_base<mt_policy>
1465
typedef std::list<_connection_base7<arg1_type, arg2_type, arg3_type,
1466
arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> *> connections_list;
1473
_signal_base7(const _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
1474
arg5_type, arg6_type, arg7_type, mt_policy>& s)
1475
: _signal_base<mt_policy>(s)
1477
lock_block<mt_policy> lock(this);
1478
typename connections_list::const_iterator it = s.m_connected_slots.begin();
1479
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1483
(*it)->getdest()->signal_connect(this);
1484
m_connected_slots.push_back((*it)->clone());
1490
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1492
lock_block<mt_policy> lock(this);
1493
typename connections_list::iterator it = m_connected_slots.begin();
1494
typename connections_list::iterator itEnd = m_connected_slots.end();
1498
if((*it)->getdest() == oldtarget)
1500
m_connected_slots.push_back((*it)->duplicate(newtarget));
1514
lock_block<mt_policy> lock(this);
1515
typename connections_list::const_iterator it = m_connected_slots.begin();
1516
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1520
void disconnect_all()
1522
lock_block<mt_policy> lock(this);
1523
typename connections_list::const_iterator it = m_connected_slots.begin();
1524
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1528
(*it)->getdest()->signal_disconnect(this);
1534
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1538
bool connected(has_slots<mt_policy>* pclass)
1540
lock_block<mt_policy> lock(this);
1541
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1542
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1547
if ((*it)->getdest() == pclass)
1555
void disconnect(has_slots<mt_policy>* pclass)
1557
lock_block<mt_policy> lock(this);
1558
typename connections_list::iterator it = m_connected_slots.begin();
1559
typename connections_list::iterator itEnd = m_connected_slots.end();
1563
if((*it)->getdest() == pclass)
1566
m_connected_slots.erase(it);
1567
pclass->signal_disconnect(this);
1575
void slot_disconnect(has_slots<mt_policy>* pslot)
1577
lock_block<mt_policy> lock(this);
1578
typename connections_list::iterator it = m_connected_slots.begin();
1579
typename connections_list::iterator itEnd = m_connected_slots.end();
1583
typename connections_list::iterator itNext = it;
1586
if((*it)->getdest() == pslot)
1589
m_connected_slots.erase(it);
1597
connections_list m_connected_slots;
1600
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
1601
class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy>
1602
class _signal_base8 : public _signal_base<mt_policy>
1605
typedef std::list<_connection_base8<arg1_type, arg2_type, arg3_type,
1606
arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> *>
1614
_signal_base8(const _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
1615
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
1616
: _signal_base<mt_policy>(s)
1618
lock_block<mt_policy> lock(this);
1619
typename connections_list::const_iterator it = s.m_connected_slots.begin();
1620
typename connections_list::const_iterator itEnd = s.m_connected_slots.end();
1624
(*it)->getdest()->signal_connect(this);
1625
m_connected_slots.push_back((*it)->clone());
1631
void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget)
1633
lock_block<mt_policy> lock(this);
1634
typename connections_list::iterator it = m_connected_slots.begin();
1635
typename connections_list::iterator itEnd = m_connected_slots.end();
1639
if((*it)->getdest() == oldtarget)
1641
m_connected_slots.push_back((*it)->duplicate(newtarget));
1655
lock_block<mt_policy> lock(this);
1656
typename connections_list::const_iterator it = m_connected_slots.begin();
1657
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1661
void disconnect_all()
1663
lock_block<mt_policy> lock(this);
1664
typename connections_list::const_iterator it = m_connected_slots.begin();
1665
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1669
(*it)->getdest()->signal_disconnect(this);
1675
m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end());
1679
bool connected(has_slots<mt_policy>* pclass)
1681
lock_block<mt_policy> lock(this);
1682
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
1683
typename connections_list::const_iterator itEnd = m_connected_slots.end();
1688
if ((*it)->getdest() == pclass)
1696
void disconnect(has_slots<mt_policy>* pclass)
1698
lock_block<mt_policy> lock(this);
1699
typename connections_list::iterator it = m_connected_slots.begin();
1700
typename connections_list::iterator itEnd = m_connected_slots.end();
1704
if((*it)->getdest() == pclass)
1707
m_connected_slots.erase(it);
1708
pclass->signal_disconnect(this);
1716
void slot_disconnect(has_slots<mt_policy>* pslot)
1718
lock_block<mt_policy> lock(this);
1719
typename connections_list::iterator it = m_connected_slots.begin();
1720
typename connections_list::iterator itEnd = m_connected_slots.end();
1724
typename connections_list::iterator itNext = it;
1727
if((*it)->getdest() == pslot)
1730
m_connected_slots.erase(it);
1738
connections_list m_connected_slots;
1742
template<class dest_type, class mt_policy>
1743
class _connection0 : public _connection_base0<mt_policy>
1752
_connection0(dest_type* pobject, void (dest_type::*pmemfun)())
1754
m_pobject = pobject;
1755
m_pmemfun = pmemfun;
1758
virtual ~_connection0()
1762
virtual _connection_base0<mt_policy>* clone()
1764
return new _connection0<dest_type, mt_policy>(*this);
1767
virtual _connection_base0<mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1769
return new _connection0<dest_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1774
(m_pobject->*m_pmemfun)();
1777
virtual has_slots<mt_policy>* getdest() const
1783
dest_type* m_pobject;
1784
void (dest_type::* m_pmemfun)();
1787
template<class dest_type, class arg1_type, class mt_policy>
1788
class _connection1 : public _connection_base1<arg1_type, mt_policy>
1797
_connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type))
1799
m_pobject = pobject;
1800
m_pmemfun = pmemfun;
1803
virtual ~_connection1()
1807
virtual _connection_base1<arg1_type, mt_policy>* clone()
1809
return new _connection1<dest_type, arg1_type, mt_policy>(*this);
1812
virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1814
return new _connection1<dest_type, arg1_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1817
virtual void emit(arg1_type a1)
1819
(m_pobject->*m_pmemfun)(a1);
1822
virtual has_slots<mt_policy>* getdest() const
1828
dest_type* m_pobject;
1829
void (dest_type::* m_pmemfun)(arg1_type);
1832
template<class dest_type, class arg1_type, class arg2_type, class mt_policy>
1833
class _connection2 : public _connection_base2<arg1_type, arg2_type, mt_policy>
1842
_connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1845
m_pobject = pobject;
1846
m_pmemfun = pmemfun;
1849
virtual ~_connection2()
1853
virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone()
1855
return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>(*this);
1858
virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1860
return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1863
virtual void emit(arg1_type a1, arg2_type a2)
1865
(m_pobject->*m_pmemfun)(a1, a2);
1868
virtual has_slots<mt_policy>* getdest() const
1874
dest_type* m_pobject;
1875
void (dest_type::* m_pmemfun)(arg1_type, arg2_type);
1878
template<class dest_type, class arg1_type, class arg2_type, class arg3_type, class mt_policy>
1879
class _connection3 : public _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>
1888
_connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1889
arg2_type, arg3_type))
1891
m_pobject = pobject;
1892
m_pmemfun = pmemfun;
1895
virtual ~_connection3()
1899
virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone()
1901
return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>(*this);
1904
virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1906
return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1909
virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3)
1911
(m_pobject->*m_pmemfun)(a1, a2, a3);
1914
virtual has_slots<mt_policy>* getdest() const
1920
dest_type* m_pobject;
1921
void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type);
1924
template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1925
class arg4_type, class mt_policy>
1926
class _connection4 : public _connection_base4<arg1_type, arg2_type,
1927
arg3_type, arg4_type, mt_policy>
1936
_connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1937
arg2_type, arg3_type, arg4_type))
1939
m_pobject = pobject;
1940
m_pmemfun = pmemfun;
1943
virtual ~_connection4()
1947
virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone()
1949
return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(*this);
1952
virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
1954
return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
1957
virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3,
1960
(m_pobject->*m_pmemfun)(a1, a2, a3, a4);
1963
virtual has_slots<mt_policy>* getdest() const
1969
dest_type* m_pobject;
1970
void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type,
1974
template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
1975
class arg4_type, class arg5_type, class mt_policy>
1976
class _connection5 : public _connection_base5<arg1_type, arg2_type,
1977
arg3_type, arg4_type, arg5_type, mt_policy>
1986
_connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
1987
arg2_type, arg3_type, arg4_type, arg5_type))
1989
m_pobject = pobject;
1990
m_pmemfun = pmemfun;
1993
virtual ~_connection5()
1997
virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
1998
arg5_type, mt_policy>* clone()
2000
return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2001
arg5_type, mt_policy>(*this);
2004
virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2005
arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
2007
return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2008
arg5_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2011
virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2014
(m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5);
2017
virtual has_slots<mt_policy>* getdest() const
2023
dest_type* m_pobject;
2024
void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2028
template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2029
class arg4_type, class arg5_type, class arg6_type, class mt_policy>
2030
class _connection6 : public _connection_base6<arg1_type, arg2_type,
2031
arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>
2040
_connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2041
arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
2043
m_pobject = pobject;
2044
m_pmemfun = pmemfun;
2047
virtual ~_connection6()
2051
virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2052
arg5_type, arg6_type, mt_policy>* clone()
2054
return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2055
arg5_type, arg6_type, mt_policy>(*this);
2058
virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2059
arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
2061
return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2062
arg5_type, arg6_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2065
virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2066
arg5_type a5, arg6_type a6)
2068
(m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6);
2071
virtual has_slots<mt_policy>* getdest() const
2077
dest_type* m_pobject;
2078
void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2079
arg5_type, arg6_type);
2082
template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2083
class arg4_type, class arg5_type, class arg6_type, class arg7_type, class mt_policy>
2084
class _connection7 : public _connection_base7<arg1_type, arg2_type,
2085
arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
2094
_connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2095
arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type))
2097
m_pobject = pobject;
2098
m_pmemfun = pmemfun;
2101
virtual ~_connection7()
2105
virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2106
arg5_type, arg6_type, arg7_type, mt_policy>* clone()
2108
return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2109
arg5_type, arg6_type, arg7_type, mt_policy>(*this);
2112
virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2113
arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
2115
return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2116
arg5_type, arg6_type, arg7_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2119
virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2120
arg5_type a5, arg6_type a6, arg7_type a7)
2122
(m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7);
2125
virtual has_slots<mt_policy>* getdest() const
2131
dest_type* m_pobject;
2132
void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2133
arg5_type, arg6_type, arg7_type);
2136
template<class dest_type, class arg1_type, class arg2_type, class arg3_type,
2137
class arg4_type, class arg5_type, class arg6_type, class arg7_type,
2138
class arg8_type, class mt_policy>
2139
class _connection8 : public _connection_base8<arg1_type, arg2_type,
2140
arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
2149
_connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type,
2150
arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2151
arg7_type, arg8_type))
2153
m_pobject = pobject;
2154
m_pmemfun = pmemfun;
2157
virtual ~_connection8()
2161
virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2162
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone()
2164
return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2165
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(*this);
2168
virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2169
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest)
2171
return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type,
2172
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>((dest_type *)pnewdest, m_pmemfun);
2175
virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2176
arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2178
(m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8);
2181
virtual has_slots<mt_policy>* getdest() const
2187
dest_type* m_pobject;
2188
void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type,
2189
arg5_type, arg6_type, arg7_type, arg8_type);
2192
template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2193
class signal0 : public _signal_base0<mt_policy>
2196
typedef _signal_base0<mt_policy> base;
2197
typedef typename base::connections_list connections_list;
2198
using base::m_connected_slots;
2205
signal0(const signal0<mt_policy>& s)
2206
: _signal_base0<mt_policy>(s)
2211
template<class desttype>
2212
void connect(desttype* pclass, void (desttype::*pmemfun)())
2214
lock_block<mt_policy> lock(this);
2215
_connection0<desttype, mt_policy>* conn =
2216
new _connection0<desttype, mt_policy>(pclass, pmemfun);
2217
m_connected_slots.push_back(conn);
2218
pclass->signal_connect(this);
2223
lock_block<mt_policy> lock(this);
2224
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2225
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2240
lock_block<mt_policy> lock(this);
2241
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2242
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2256
template<class arg1_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2257
class signal1 : public _signal_base1<arg1_type, mt_policy>
2260
typedef _signal_base1<arg1_type, mt_policy> base;
2261
typedef typename base::connections_list connections_list;
2262
using base::m_connected_slots;
2269
signal1(const signal1<arg1_type, mt_policy>& s)
2270
: _signal_base1<arg1_type, mt_policy>(s)
2275
template<class desttype>
2276
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type))
2278
lock_block<mt_policy> lock(this);
2279
_connection1<desttype, arg1_type, mt_policy>* conn =
2280
new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun);
2281
m_connected_slots.push_back(conn);
2282
pclass->signal_connect(this);
2285
void emit(arg1_type a1)
2287
lock_block<mt_policy> lock(this);
2288
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2289
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2302
void operator()(arg1_type a1)
2304
lock_block<mt_policy> lock(this);
2305
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2306
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2320
template<class arg1_type, class arg2_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2321
class signal2 : public _signal_base2<arg1_type, arg2_type, mt_policy>
2324
typedef _signal_base2<arg1_type, arg2_type, mt_policy> base;
2325
typedef typename base::connections_list connections_list;
2326
using base::m_connected_slots;
2333
signal2(const signal2<arg1_type, arg2_type, mt_policy>& s)
2334
: _signal_base2<arg1_type, arg2_type, mt_policy>(s)
2339
template<class desttype>
2340
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2343
lock_block<mt_policy> lock(this);
2344
_connection2<desttype, arg1_type, arg2_type, mt_policy>* conn = new
2345
_connection2<desttype, arg1_type, arg2_type, mt_policy>(pclass, pmemfun);
2346
m_connected_slots.push_back(conn);
2347
pclass->signal_connect(this);
2350
void emit(arg1_type a1, arg2_type a2)
2352
lock_block<mt_policy> lock(this);
2353
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2354
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2361
(*it)->emit(a1, a2);
2367
void operator()(arg1_type a1, arg2_type a2)
2369
lock_block<mt_policy> lock(this);
2370
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2371
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2378
(*it)->emit(a1, a2);
2385
template<class arg1_type, class arg2_type, class arg3_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2386
class signal3 : public _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>
2389
typedef _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> base;
2390
typedef typename base::connections_list connections_list;
2391
using base::m_connected_slots;
2398
signal3(const signal3<arg1_type, arg2_type, arg3_type, mt_policy>& s)
2399
: _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>(s)
2404
template<class desttype>
2405
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2406
arg2_type, arg3_type))
2408
lock_block<mt_policy> lock(this);
2409
_connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn =
2410
new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass,
2412
m_connected_slots.push_back(conn);
2413
pclass->signal_connect(this);
2416
void emit(arg1_type a1, arg2_type a2, arg3_type a3)
2418
lock_block<mt_policy> lock(this);
2419
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2420
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2427
(*it)->emit(a1, a2, a3);
2433
void operator()(arg1_type a1, arg2_type a2, arg3_type a3)
2435
lock_block<mt_policy> lock(this);
2436
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2437
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2444
(*it)->emit(a1, a2, a3);
2451
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2452
class signal4 : public _signal_base4<arg1_type, arg2_type, arg3_type,
2453
arg4_type, mt_policy>
2456
typedef _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> base;
2457
typedef typename base::connections_list connections_list;
2458
using base::m_connected_slots;
2465
signal4(const signal4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s)
2466
: _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(s)
2471
template<class desttype>
2472
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2473
arg2_type, arg3_type, arg4_type))
2475
lock_block<mt_policy> lock(this);
2476
_connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>*
2477
conn = new _connection4<desttype, arg1_type, arg2_type, arg3_type,
2478
arg4_type, mt_policy>(pclass, pmemfun);
2479
m_connected_slots.push_back(conn);
2480
pclass->signal_connect(this);
2483
void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2485
lock_block<mt_policy> lock(this);
2486
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2487
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2494
(*it)->emit(a1, a2, a3, a4);
2500
void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4)
2502
lock_block<mt_policy> lock(this);
2503
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2504
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2511
(*it)->emit(a1, a2, a3, a4);
2518
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2519
class arg5_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2520
class signal5 : public _signal_base5<arg1_type, arg2_type, arg3_type,
2521
arg4_type, arg5_type, mt_policy>
2524
typedef _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> base;
2525
typedef typename base::connections_list connections_list;
2526
using base::m_connected_slots;
2533
signal5(const signal5<arg1_type, arg2_type, arg3_type, arg4_type,
2534
arg5_type, mt_policy>& s)
2535
: _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type,
2536
arg5_type, mt_policy>(s)
2541
template<class desttype>
2542
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2543
arg2_type, arg3_type, arg4_type, arg5_type))
2545
lock_block<mt_policy> lock(this);
2546
_connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2547
arg5_type, mt_policy>* conn = new _connection5<desttype, arg1_type, arg2_type,
2548
arg3_type, arg4_type, arg5_type, mt_policy>(pclass, pmemfun);
2549
m_connected_slots.push_back(conn);
2550
pclass->signal_connect(this);
2553
void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2556
lock_block<mt_policy> lock(this);
2557
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2558
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2565
(*it)->emit(a1, a2, a3, a4, a5);
2571
void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2574
lock_block<mt_policy> lock(this);
2575
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2576
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2583
(*it)->emit(a1, a2, a3, a4, a5);
2591
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2592
class arg5_type, class arg6_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2593
class signal6 : public _signal_base6<arg1_type, arg2_type, arg3_type,
2594
arg4_type, arg5_type, arg6_type, mt_policy>
2597
typedef _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> base;
2598
typedef typename base::connections_list connections_list;
2599
using base::m_connected_slots;
2606
signal6(const signal6<arg1_type, arg2_type, arg3_type, arg4_type,
2607
arg5_type, arg6_type, mt_policy>& s)
2608
: _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type,
2609
arg5_type, arg6_type, mt_policy>(s)
2614
template<class desttype>
2615
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2616
arg2_type, arg3_type, arg4_type, arg5_type, arg6_type))
2618
lock_block<mt_policy> lock(this);
2619
_connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2620
arg5_type, arg6_type, mt_policy>* conn =
2621
new _connection6<desttype, arg1_type, arg2_type, arg3_type,
2622
arg4_type, arg5_type, arg6_type, mt_policy>(pclass, pmemfun);
2623
m_connected_slots.push_back(conn);
2624
pclass->signal_connect(this);
2627
void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2628
arg5_type a5, arg6_type a6)
2630
lock_block<mt_policy> lock(this);
2631
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2632
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2639
(*it)->emit(a1, a2, a3, a4, a5, a6);
2645
void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2646
arg5_type a5, arg6_type a6)
2648
lock_block<mt_policy> lock(this);
2649
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2650
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2657
(*it)->emit(a1, a2, a3, a4, a5, a6);
2664
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2665
class arg5_type, class arg6_type, class arg7_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2666
class signal7 : public _signal_base7<arg1_type, arg2_type, arg3_type,
2667
arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>
2670
typedef _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2671
arg5_type, arg6_type, arg7_type, mt_policy> base;
2672
typedef typename base::connections_list connections_list;
2673
using base::m_connected_slots;
2680
signal7(const signal7<arg1_type, arg2_type, arg3_type, arg4_type,
2681
arg5_type, arg6_type, arg7_type, mt_policy>& s)
2682
: _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type,
2683
arg5_type, arg6_type, arg7_type, mt_policy>(s)
2688
template<class desttype>
2689
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2690
arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2693
lock_block<mt_policy> lock(this);
2694
_connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2695
arg5_type, arg6_type, arg7_type, mt_policy>* conn =
2696
new _connection7<desttype, arg1_type, arg2_type, arg3_type,
2697
arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(pclass, pmemfun);
2698
m_connected_slots.push_back(conn);
2699
pclass->signal_connect(this);
2702
void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2703
arg5_type a5, arg6_type a6, arg7_type a7)
2705
lock_block<mt_policy> lock(this);
2706
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2707
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2714
(*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2720
void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2721
arg5_type a5, arg6_type a6, arg7_type a7)
2723
lock_block<mt_policy> lock(this);
2724
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2725
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2732
(*it)->emit(a1, a2, a3, a4, a5, a6, a7);
2739
template<class arg1_type, class arg2_type, class arg3_type, class arg4_type,
2740
class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY>
2741
class signal8 : public _signal_base8<arg1_type, arg2_type, arg3_type,
2742
arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>
2745
typedef _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2746
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> base;
2747
typedef typename base::connections_list connections_list;
2748
using base::m_connected_slots;
2755
signal8(const signal8<arg1_type, arg2_type, arg3_type, arg4_type,
2756
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s)
2757
: _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type,
2758
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(s)
2763
template<class desttype>
2764
void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type,
2765
arg2_type, arg3_type, arg4_type, arg5_type, arg6_type,
2766
arg7_type, arg8_type))
2768
lock_block<mt_policy> lock(this);
2769
_connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type,
2770
arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn =
2771
new _connection8<desttype, arg1_type, arg2_type, arg3_type,
2772
arg4_type, arg5_type, arg6_type, arg7_type,
2773
arg8_type, mt_policy>(pclass, pmemfun);
2774
m_connected_slots.push_back(conn);
2775
pclass->signal_connect(this);
2778
void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2779
arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2781
lock_block<mt_policy> lock(this);
2782
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2783
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2790
(*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2796
void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4,
2797
arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8)
2799
lock_block<mt_policy> lock(this);
2800
typename connections_list::const_iterator itNext, it = m_connected_slots.begin();
2801
typename connections_list::const_iterator itEnd = m_connected_slots.end();
2808
(*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8);
2815
}; // namespace sigslot
2817
#endif // TALK_BASE_SIGSLOT_H__