1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/mtransport/sigslot.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,2859 @@ 1.4 +// sigslot.h: Signal/Slot classes 1.5 +// 1.6 +// Written by Sarah Thompson (sarah@telergy.com) 2002. 1.7 +// 1.8 +// License: Public domain. You are free to use this code however you like, with the proviso that 1.9 +// the author takes on no responsibility or liability for any use. 1.10 +// 1.11 +// QUICK DOCUMENTATION 1.12 +// 1.13 +// (see also the full documentation at http://sigslot.sourceforge.net/) 1.14 +// 1.15 +// #define switches 1.16 +// SIGSLOT_PURE_ISO - Define this to force ISO C++ compliance. This also disables 1.17 +// all of the thread safety support on platforms where it is 1.18 +// available. 1.19 +// 1.20 +// SIGSLOT_USE_POSIX_THREADS - Force use of Posix threads when using a C++ compiler other than 1.21 +// gcc on a platform that supports Posix threads. (When using gcc, 1.22 +// this is the default - use SIGSLOT_PURE_ISO to disable this if 1.23 +// necessary) 1.24 +// 1.25 +// SIGSLOT_DEFAULT_MT_POLICY - Where thread support is enabled, this defaults to multi_threaded_global. 1.26 +// Otherwise, the default is single_threaded. #define this yourself to 1.27 +// override the default. In pure ISO mode, anything other than 1.28 +// single_threaded will cause a compiler error. 1.29 +// 1.30 +// PLATFORM NOTES 1.31 +// 1.32 +// Win32 - On Win32, the WIN32 symbol must be #defined. Most mainstream 1.33 +// compilers do this by default, but you may need to define it 1.34 +// yourself if your build environment is less standard. This causes 1.35 +// the Win32 thread support to be compiled in and used automatically. 1.36 +// 1.37 +// Unix/Linux/BSD, etc. - If you're using gcc, it is assumed that you have Posix threads 1.38 +// available, so they are used automatically. You can override this 1.39 +// (as under Windows) with the SIGSLOT_PURE_ISO switch. If you're using 1.40 +// something other than gcc but still want to use Posix threads, you 1.41 +// need to #define SIGSLOT_USE_POSIX_THREADS. 1.42 +// 1.43 +// ISO C++ - If none of the supported platforms are detected, or if 1.44 +// SIGSLOT_PURE_ISO is defined, all multithreading support is turned off, 1.45 +// along with any code that might cause a pure ISO C++ environment to 1.46 +// complain. Before you ask, gcc -ansi -pedantic won't compile this 1.47 +// library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of 1.48 +// errors that aren't really there. If you feel like investigating this, 1.49 +// please contact the author. 1.50 +// 1.51 +// 1.52 +// THREADING MODES 1.53 +// 1.54 +// single_threaded - Your program is assumed to be single threaded from the point of view 1.55 +// of signal/slot usage (i.e. all objects using signals and slots are 1.56 +// created and destroyed from a single thread). Behaviour if objects are 1.57 +// destroyed concurrently is undefined (i.e. you'll get the occasional 1.58 +// segmentation fault/memory exception). 1.59 +// 1.60 +// multi_threaded_global - Your program is assumed to be multi threaded. Objects using signals and 1.61 +// slots can be safely created and destroyed from any thread, even when 1.62 +// connections exist. In multi_threaded_global mode, this is achieved by a 1.63 +// single global mutex (actually a critical section on Windows because they 1.64 +// are faster). This option uses less OS resources, but results in more 1.65 +// opportunities for contention, possibly resulting in more context switches 1.66 +// than are strictly necessary. 1.67 +// 1.68 +// multi_threaded_local - Behaviour in this mode is essentially the same as multi_threaded_global, 1.69 +// except that each signal, and each object that inherits has_slots, all 1.70 +// have their own mutex/critical section. In practice, this means that 1.71 +// mutex collisions (and hence context switches) only happen if they are 1.72 +// absolutely essential. However, on some platforms, creating a lot of 1.73 +// mutexes can slow down the whole OS, so use this option with care. 1.74 +// 1.75 +// USING THE LIBRARY 1.76 +// 1.77 +// See the full documentation at http://sigslot.sourceforge.net/ 1.78 +// 1.79 +// 1.80 +// Libjingle specific: 1.81 +// This file has been modified such that has_slots and signalx do not have to be 1.82 +// using the same threading requirements. E.g. it is possible to connect a 1.83 +// has_slots<single_threaded> and signal0<multi_threaded_local> or 1.84 +// has_slots<multi_threaded_local> and signal0<single_threaded>. 1.85 +// If has_slots is single threaded the user must ensure that it is not trying 1.86 +// to connect or disconnect to signalx concurrently or data race may occur. 1.87 +// If signalx is single threaded the user must ensure that disconnect, connect 1.88 +// or signal is not happening concurrently or data race may occur. 1.89 + 1.90 +#ifndef TALK_BASE_SIGSLOT_H__ 1.91 +#define TALK_BASE_SIGSLOT_H__ 1.92 + 1.93 +#include <list> 1.94 +#include <set> 1.95 +#include <stdlib.h> 1.96 + 1.97 +// On our copy of sigslot.h, we set single threading as default. 1.98 +#define SIGSLOT_DEFAULT_MT_POLICY single_threaded 1.99 + 1.100 +// For now, this avoids windows.h in bindings (PeerConnectionImpl.h) on WIN32 1.101 +// TODO: wrap win32 crit section and move to another file instead (Bug 932570) 1.102 +#define SIGSLOT_LEAVE_OUT_MULTITHREADING 1 1.103 + 1.104 +#if defined(SIGSLOT_PURE_ISO) || (!defined(WIN32) && !defined(__GNUG__) && !defined(SIGSLOT_USE_POSIX_THREADS)) 1.105 +# define _SIGSLOT_SINGLE_THREADED 1.106 +#elif defined(WIN32) 1.107 +# define _SIGSLOT_HAS_WIN32_THREADS 1.108 +# ifndef SIGSLOT_LEAVE_OUT_MULTITHREADING 1.109 +# if !defined(WIN32_LEAN_AND_MEAN) 1.110 +# define WIN32_LEAN_AND_MEAN 1.111 +# endif 1.112 +# include "windows.h" 1.113 +# endif 1.114 +#elif defined(__GNUG__) || defined(SIGSLOT_USE_POSIX_THREADS) 1.115 +# define _SIGSLOT_HAS_POSIX_THREADS 1.116 +# include <pthread.h> 1.117 +#else 1.118 +# define _SIGSLOT_SINGLE_THREADED 1.119 +#endif 1.120 + 1.121 +#ifndef SIGSLOT_DEFAULT_MT_POLICY 1.122 +# ifdef _SIGSLOT_SINGLE_THREADED 1.123 +# define SIGSLOT_DEFAULT_MT_POLICY single_threaded 1.124 +# else 1.125 +# define SIGSLOT_DEFAULT_MT_POLICY multi_threaded_local 1.126 +# endif 1.127 +#endif 1.128 + 1.129 +// TODO: change this namespace to talk_base? 1.130 +namespace sigslot { 1.131 + 1.132 + class single_threaded 1.133 + { 1.134 + public: 1.135 + single_threaded() 1.136 + { 1.137 + ; 1.138 + } 1.139 + 1.140 + virtual ~single_threaded() 1.141 + { 1.142 + ; 1.143 + } 1.144 + 1.145 + virtual void lock() 1.146 + { 1.147 + ; 1.148 + } 1.149 + 1.150 + virtual void unlock() 1.151 + { 1.152 + ; 1.153 + } 1.154 + }; 1.155 + 1.156 +#ifndef SIGSLOT_LEAVE_OUT_MULTITHREADING 1.157 +# ifdef _SIGSLOT_HAS_WIN32_THREADS 1.158 + 1.159 + // The multi threading policies only get compiled in if they are enabled. 1.160 + class multi_threaded_global 1.161 + { 1.162 + public: 1.163 + multi_threaded_global() 1.164 + { 1.165 + static bool isinitialised = false; 1.166 + 1.167 + if(!isinitialised) 1.168 + { 1.169 + InitializeCriticalSection(get_critsec()); 1.170 + isinitialised = true; 1.171 + } 1.172 + } 1.173 + 1.174 + multi_threaded_global(const multi_threaded_global&) 1.175 + { 1.176 + ; 1.177 + } 1.178 + 1.179 + virtual ~multi_threaded_global() 1.180 + { 1.181 + ; 1.182 + } 1.183 + 1.184 + virtual void lock() 1.185 + { 1.186 + EnterCriticalSection(get_critsec()); 1.187 + } 1.188 + 1.189 + virtual void unlock() 1.190 + { 1.191 + LeaveCriticalSection(get_critsec()); 1.192 + } 1.193 + 1.194 + private: 1.195 + CRITICAL_SECTION* get_critsec() 1.196 + { 1.197 + static CRITICAL_SECTION g_critsec; 1.198 + return &g_critsec; 1.199 + } 1.200 + }; 1.201 + 1.202 + class multi_threaded_local 1.203 + { 1.204 + public: 1.205 + multi_threaded_local() 1.206 + { 1.207 + InitializeCriticalSection(&m_critsec); 1.208 + } 1.209 + 1.210 + multi_threaded_local(const multi_threaded_local&) 1.211 + { 1.212 + InitializeCriticalSection(&m_critsec); 1.213 + } 1.214 + 1.215 + virtual ~multi_threaded_local() 1.216 + { 1.217 + DeleteCriticalSection(&m_critsec); 1.218 + } 1.219 + 1.220 + virtual void lock() 1.221 + { 1.222 + EnterCriticalSection(&m_critsec); 1.223 + } 1.224 + 1.225 + virtual void unlock() 1.226 + { 1.227 + LeaveCriticalSection(&m_critsec); 1.228 + } 1.229 + 1.230 + private: 1.231 + CRITICAL_SECTION m_critsec; 1.232 + }; 1.233 +# endif // _SIGSLOT_HAS_WIN32_THREADS 1.234 + 1.235 +# ifdef _SIGSLOT_HAS_POSIX_THREADS 1.236 + // The multi threading policies only get compiled in if they are enabled. 1.237 + class multi_threaded_global 1.238 + { 1.239 + public: 1.240 + multi_threaded_global() 1.241 + { 1.242 + pthread_mutex_init(get_mutex(), NULL); 1.243 + } 1.244 + 1.245 + multi_threaded_global(const multi_threaded_global&) 1.246 + { 1.247 + ; 1.248 + } 1.249 + 1.250 + virtual ~multi_threaded_global() 1.251 + { 1.252 + ; 1.253 + } 1.254 + 1.255 + virtual void lock() 1.256 + { 1.257 + pthread_mutex_lock(get_mutex()); 1.258 + } 1.259 + 1.260 + virtual void unlock() 1.261 + { 1.262 + pthread_mutex_unlock(get_mutex()); 1.263 + } 1.264 + 1.265 + private: 1.266 + pthread_mutex_t* get_mutex() 1.267 + { 1.268 + static pthread_mutex_t g_mutex; 1.269 + return &g_mutex; 1.270 + } 1.271 + }; 1.272 + 1.273 + class multi_threaded_local 1.274 + { 1.275 + public: 1.276 + multi_threaded_local() 1.277 + { 1.278 + pthread_mutex_init(&m_mutex, NULL); 1.279 + } 1.280 + 1.281 + multi_threaded_local(const multi_threaded_local&) 1.282 + { 1.283 + pthread_mutex_init(&m_mutex, NULL); 1.284 + } 1.285 + 1.286 + virtual ~multi_threaded_local() 1.287 + { 1.288 + pthread_mutex_destroy(&m_mutex); 1.289 + } 1.290 + 1.291 + virtual void lock() 1.292 + { 1.293 + pthread_mutex_lock(&m_mutex); 1.294 + } 1.295 + 1.296 + virtual void unlock() 1.297 + { 1.298 + pthread_mutex_unlock(&m_mutex); 1.299 + } 1.300 + 1.301 + private: 1.302 + pthread_mutex_t m_mutex; 1.303 + }; 1.304 +# endif // _SIGSLOT_HAS_POSIX_THREADS 1.305 +#endif // SIGSLOT_LEAVE_OUT_MULTITHREADING 1.306 + 1.307 + template<class mt_policy> 1.308 + class lock_block 1.309 + { 1.310 + public: 1.311 + mt_policy *m_mutex; 1.312 + 1.313 + lock_block(mt_policy *mtx) 1.314 + : m_mutex(mtx) 1.315 + { 1.316 + m_mutex->lock(); 1.317 + } 1.318 + 1.319 + ~lock_block() 1.320 + { 1.321 + m_mutex->unlock(); 1.322 + } 1.323 + }; 1.324 + 1.325 + class has_slots_interface; 1.326 + 1.327 + template<class mt_policy> 1.328 + class _connection_base0 1.329 + { 1.330 + public: 1.331 + virtual ~_connection_base0() {} 1.332 + virtual has_slots_interface* getdest() const = 0; 1.333 + virtual void emit() = 0; 1.334 + virtual _connection_base0* clone() = 0; 1.335 + virtual _connection_base0* duplicate(has_slots_interface* pnewdest) = 0; 1.336 + }; 1.337 + 1.338 + template<class arg1_type, class mt_policy> 1.339 + class _connection_base1 1.340 + { 1.341 + public: 1.342 + virtual ~_connection_base1() {} 1.343 + virtual has_slots_interface* getdest() const = 0; 1.344 + virtual void emit(arg1_type) = 0; 1.345 + virtual _connection_base1<arg1_type, mt_policy>* clone() = 0; 1.346 + virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.347 + }; 1.348 + 1.349 + template<class arg1_type, class arg2_type, class mt_policy> 1.350 + class _connection_base2 1.351 + { 1.352 + public: 1.353 + virtual ~_connection_base2() {} 1.354 + virtual has_slots_interface* getdest() const = 0; 1.355 + virtual void emit(arg1_type, arg2_type) = 0; 1.356 + virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0; 1.357 + virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.358 + }; 1.359 + 1.360 + template<class arg1_type, class arg2_type, class arg3_type, class mt_policy> 1.361 + class _connection_base3 1.362 + { 1.363 + public: 1.364 + virtual ~_connection_base3() {} 1.365 + virtual has_slots_interface* getdest() const = 0; 1.366 + virtual void emit(arg1_type, arg2_type, arg3_type) = 0; 1.367 + virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0; 1.368 + virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.369 + }; 1.370 + 1.371 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy> 1.372 + class _connection_base4 1.373 + { 1.374 + public: 1.375 + virtual ~_connection_base4() {} 1.376 + virtual has_slots_interface* getdest() const = 0; 1.377 + virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0; 1.378 + virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0; 1.379 + virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.380 + }; 1.381 + 1.382 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.383 + class arg5_type, class mt_policy> 1.384 + class _connection_base5 1.385 + { 1.386 + public: 1.387 + virtual ~_connection_base5() {} 1.388 + virtual has_slots_interface* getdest() const = 0; 1.389 + virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, 1.390 + arg5_type) = 0; 1.391 + virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, 1.392 + arg5_type, mt_policy>* clone() = 0; 1.393 + virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, 1.394 + arg5_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.395 + }; 1.396 + 1.397 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.398 + class arg5_type, class arg6_type, class mt_policy> 1.399 + class _connection_base6 1.400 + { 1.401 + public: 1.402 + virtual ~_connection_base6() {} 1.403 + virtual has_slots_interface* getdest() const = 0; 1.404 + virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, 1.405 + arg6_type) = 0; 1.406 + virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, 1.407 + arg5_type, arg6_type, mt_policy>* clone() = 0; 1.408 + virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, 1.409 + arg5_type, arg6_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.410 + }; 1.411 + 1.412 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.413 + class arg5_type, class arg6_type, class arg7_type, class mt_policy> 1.414 + class _connection_base7 1.415 + { 1.416 + public: 1.417 + virtual ~_connection_base7() {} 1.418 + virtual has_slots_interface* getdest() const = 0; 1.419 + virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, 1.420 + arg6_type, arg7_type) = 0; 1.421 + virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, 1.422 + arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0; 1.423 + virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, 1.424 + arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.425 + }; 1.426 + 1.427 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.428 + class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy> 1.429 + class _connection_base8 1.430 + { 1.431 + public: 1.432 + virtual ~_connection_base8() {} 1.433 + virtual has_slots_interface* getdest() const = 0; 1.434 + virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, 1.435 + arg6_type, arg7_type, arg8_type) = 0; 1.436 + virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, 1.437 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0; 1.438 + virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, 1.439 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots_interface* pnewdest) = 0; 1.440 + }; 1.441 + 1.442 + class _signal_base_interface 1.443 + { 1.444 + public: 1.445 + virtual void slot_disconnect(has_slots_interface* pslot) = 0; 1.446 + virtual void slot_duplicate(const has_slots_interface* poldslot, has_slots_interface* pnewslot) = 0; 1.447 + }; 1.448 + 1.449 + template<class mt_policy> 1.450 + class _signal_base : public _signal_base_interface, public mt_policy 1.451 + { 1.452 + }; 1.453 + 1.454 + class has_slots_interface 1.455 + { 1.456 + public: 1.457 + has_slots_interface() 1.458 + { 1.459 + ; 1.460 + } 1.461 + 1.462 + virtual void signal_connect(_signal_base_interface* sender) = 0; 1.463 + 1.464 + virtual void signal_disconnect(_signal_base_interface* sender) = 0; 1.465 + 1.466 + virtual ~has_slots_interface() 1.467 + { 1.468 + } 1.469 + 1.470 + virtual void disconnect_all() = 0; 1.471 + }; 1.472 + 1.473 + template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.474 + class has_slots : public has_slots_interface, public mt_policy 1.475 + { 1.476 + private: 1.477 + typedef std::set<_signal_base_interface*> sender_set; 1.478 + typedef sender_set::const_iterator const_iterator; 1.479 + 1.480 + public: 1.481 + has_slots() 1.482 + { 1.483 + ; 1.484 + } 1.485 + 1.486 + has_slots(const has_slots& hs) 1.487 + { 1.488 + lock_block<mt_policy> lock(this); 1.489 + const_iterator it = hs.m_senders.begin(); 1.490 + const_iterator itEnd = hs.m_senders.end(); 1.491 + 1.492 + while(it != itEnd) 1.493 + { 1.494 + (*it)->slot_duplicate(&hs, this); 1.495 + m_senders.insert(*it); 1.496 + ++it; 1.497 + } 1.498 + } 1.499 + 1.500 + void signal_connect(_signal_base_interface* sender) 1.501 + { 1.502 + lock_block<mt_policy> lock(this); 1.503 + m_senders.insert(sender); 1.504 + } 1.505 + 1.506 + void signal_disconnect(_signal_base_interface* sender) 1.507 + { 1.508 + lock_block<mt_policy> lock(this); 1.509 + m_senders.erase(sender); 1.510 + } 1.511 + 1.512 + virtual ~has_slots() 1.513 + { 1.514 + disconnect_all(); 1.515 + } 1.516 + 1.517 + void disconnect_all() 1.518 + { 1.519 + lock_block<mt_policy> lock(this); 1.520 + const_iterator it = m_senders.begin(); 1.521 + const_iterator itEnd = m_senders.end(); 1.522 + 1.523 + while(it != itEnd) 1.524 + { 1.525 + (*it)->slot_disconnect(this); 1.526 + ++it; 1.527 + } 1.528 + 1.529 + m_senders.erase(m_senders.begin(), m_senders.end()); 1.530 + } 1.531 + 1.532 + private: 1.533 + sender_set m_senders; 1.534 + }; 1.535 + 1.536 + template<class mt_policy> 1.537 + class _signal_base0 : public _signal_base<mt_policy> 1.538 + { 1.539 + public: 1.540 + typedef std::list<_connection_base0<mt_policy> *> connections_list; 1.541 + 1.542 + _signal_base0() 1.543 + { 1.544 + ; 1.545 + } 1.546 + 1.547 + _signal_base0(const _signal_base0& s) 1.548 + : _signal_base<mt_policy>(s) 1.549 + { 1.550 + lock_block<mt_policy> lock(this); 1.551 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.552 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.553 + 1.554 + while(it != itEnd) 1.555 + { 1.556 + (*it)->getdest()->signal_connect(this); 1.557 + m_connected_slots.push_back((*it)->clone()); 1.558 + 1.559 + ++it; 1.560 + } 1.561 + } 1.562 + 1.563 + ~_signal_base0() 1.564 + { 1.565 + disconnect_all(); 1.566 + } 1.567 + 1.568 + bool is_empty() 1.569 + { 1.570 + lock_block<mt_policy> lock(this); 1.571 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.572 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.573 + return it == itEnd; 1.574 + } 1.575 + 1.576 + void disconnect_all() 1.577 + { 1.578 + lock_block<mt_policy> lock(this); 1.579 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.580 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.581 + 1.582 + while(it != itEnd) 1.583 + { 1.584 + (*it)->getdest()->signal_disconnect(this); 1.585 + delete *it; 1.586 + 1.587 + ++it; 1.588 + } 1.589 + 1.590 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.591 + } 1.592 + 1.593 +#ifdef _DEBUG 1.594 + bool connected(has_slots_interface* pclass) 1.595 + { 1.596 + lock_block<mt_policy> lock(this); 1.597 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.598 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.599 + while(it != itEnd) 1.600 + { 1.601 + itNext = it; 1.602 + ++itNext; 1.603 + if ((*it)->getdest() == pclass) 1.604 + return true; 1.605 + it = itNext; 1.606 + } 1.607 + return false; 1.608 + } 1.609 +#endif 1.610 + 1.611 + void disconnect(has_slots_interface* pclass) 1.612 + { 1.613 + lock_block<mt_policy> lock(this); 1.614 + typename connections_list::iterator it = m_connected_slots.begin(); 1.615 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.616 + 1.617 + while(it != itEnd) 1.618 + { 1.619 + if((*it)->getdest() == pclass) 1.620 + { 1.621 + delete *it; 1.622 + m_connected_slots.erase(it); 1.623 + pclass->signal_disconnect(this); 1.624 + return; 1.625 + } 1.626 + 1.627 + ++it; 1.628 + } 1.629 + } 1.630 + 1.631 + void slot_disconnect(has_slots_interface* pslot) 1.632 + { 1.633 + lock_block<mt_policy> lock(this); 1.634 + typename connections_list::iterator it = m_connected_slots.begin(); 1.635 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.636 + 1.637 + while(it != itEnd) 1.638 + { 1.639 + typename connections_list::iterator itNext = it; 1.640 + ++itNext; 1.641 + 1.642 + if((*it)->getdest() == pslot) 1.643 + { 1.644 + delete *it; 1.645 + m_connected_slots.erase(it); 1.646 + } 1.647 + 1.648 + it = itNext; 1.649 + } 1.650 + } 1.651 + 1.652 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.653 + { 1.654 + lock_block<mt_policy> lock(this); 1.655 + typename connections_list::iterator it = m_connected_slots.begin(); 1.656 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.657 + 1.658 + while(it != itEnd) 1.659 + { 1.660 + if((*it)->getdest() == oldtarget) 1.661 + { 1.662 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.663 + } 1.664 + 1.665 + ++it; 1.666 + } 1.667 + } 1.668 + 1.669 + protected: 1.670 + connections_list m_connected_slots; 1.671 + }; 1.672 + 1.673 + template<class arg1_type, class mt_policy> 1.674 + class _signal_base1 : public _signal_base<mt_policy> 1.675 + { 1.676 + public: 1.677 + typedef std::list<_connection_base1<arg1_type, mt_policy> *> connections_list; 1.678 + 1.679 + _signal_base1() 1.680 + { 1.681 + ; 1.682 + } 1.683 + 1.684 + _signal_base1(const _signal_base1<arg1_type, mt_policy>& s) 1.685 + : _signal_base<mt_policy>(s) 1.686 + { 1.687 + lock_block<mt_policy> lock(this); 1.688 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.689 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.690 + 1.691 + while(it != itEnd) 1.692 + { 1.693 + (*it)->getdest()->signal_connect(this); 1.694 + m_connected_slots.push_back((*it)->clone()); 1.695 + 1.696 + ++it; 1.697 + } 1.698 + } 1.699 + 1.700 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.701 + { 1.702 + lock_block<mt_policy> lock(this); 1.703 + typename connections_list::iterator it = m_connected_slots.begin(); 1.704 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.705 + 1.706 + while(it != itEnd) 1.707 + { 1.708 + if((*it)->getdest() == oldtarget) 1.709 + { 1.710 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.711 + } 1.712 + 1.713 + ++it; 1.714 + } 1.715 + } 1.716 + 1.717 + ~_signal_base1() 1.718 + { 1.719 + disconnect_all(); 1.720 + } 1.721 + 1.722 + bool is_empty() 1.723 + { 1.724 + lock_block<mt_policy> lock(this); 1.725 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.726 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.727 + return it == itEnd; 1.728 + } 1.729 + 1.730 + void disconnect_all() 1.731 + { 1.732 + lock_block<mt_policy> lock(this); 1.733 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.734 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.735 + 1.736 + while(it != itEnd) 1.737 + { 1.738 + (*it)->getdest()->signal_disconnect(this); 1.739 + delete *it; 1.740 + 1.741 + ++it; 1.742 + } 1.743 + 1.744 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.745 + } 1.746 + 1.747 +#ifdef _DEBUG 1.748 + bool connected(has_slots_interface* pclass) 1.749 + { 1.750 + lock_block<mt_policy> lock(this); 1.751 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.752 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.753 + while(it != itEnd) 1.754 + { 1.755 + itNext = it; 1.756 + ++itNext; 1.757 + if ((*it)->getdest() == pclass) 1.758 + return true; 1.759 + it = itNext; 1.760 + } 1.761 + return false; 1.762 + } 1.763 +#endif 1.764 + 1.765 + void disconnect(has_slots_interface* pclass) 1.766 + { 1.767 + lock_block<mt_policy> lock(this); 1.768 + typename connections_list::iterator it = m_connected_slots.begin(); 1.769 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.770 + 1.771 + while(it != itEnd) 1.772 + { 1.773 + if((*it)->getdest() == pclass) 1.774 + { 1.775 + delete *it; 1.776 + m_connected_slots.erase(it); 1.777 + pclass->signal_disconnect(this); 1.778 + return; 1.779 + } 1.780 + 1.781 + ++it; 1.782 + } 1.783 + } 1.784 + 1.785 + void slot_disconnect(has_slots_interface* pslot) 1.786 + { 1.787 + lock_block<mt_policy> lock(this); 1.788 + typename connections_list::iterator it = m_connected_slots.begin(); 1.789 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.790 + 1.791 + while(it != itEnd) 1.792 + { 1.793 + typename connections_list::iterator itNext = it; 1.794 + ++itNext; 1.795 + 1.796 + if((*it)->getdest() == pslot) 1.797 + { 1.798 + delete *it; 1.799 + m_connected_slots.erase(it); 1.800 + } 1.801 + 1.802 + it = itNext; 1.803 + } 1.804 + } 1.805 + 1.806 + 1.807 + protected: 1.808 + connections_list m_connected_slots; 1.809 + }; 1.810 + 1.811 + template<class arg1_type, class arg2_type, class mt_policy> 1.812 + class _signal_base2 : public _signal_base<mt_policy> 1.813 + { 1.814 + public: 1.815 + typedef std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *> 1.816 + connections_list; 1.817 + 1.818 + _signal_base2() 1.819 + { 1.820 + ; 1.821 + } 1.822 + 1.823 + _signal_base2(const _signal_base2<arg1_type, arg2_type, mt_policy>& s) 1.824 + : _signal_base<mt_policy>(s) 1.825 + { 1.826 + lock_block<mt_policy> lock(this); 1.827 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.828 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.829 + 1.830 + while(it != itEnd) 1.831 + { 1.832 + (*it)->getdest()->signal_connect(this); 1.833 + m_connected_slots.push_back((*it)->clone()); 1.834 + 1.835 + ++it; 1.836 + } 1.837 + } 1.838 + 1.839 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.840 + { 1.841 + lock_block<mt_policy> lock(this); 1.842 + typename connections_list::iterator it = m_connected_slots.begin(); 1.843 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.844 + 1.845 + while(it != itEnd) 1.846 + { 1.847 + if((*it)->getdest() == oldtarget) 1.848 + { 1.849 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.850 + } 1.851 + 1.852 + ++it; 1.853 + } 1.854 + } 1.855 + 1.856 + ~_signal_base2() 1.857 + { 1.858 + disconnect_all(); 1.859 + } 1.860 + 1.861 + bool is_empty() 1.862 + { 1.863 + lock_block<mt_policy> lock(this); 1.864 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.865 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.866 + return it == itEnd; 1.867 + } 1.868 + 1.869 + void disconnect_all() 1.870 + { 1.871 + lock_block<mt_policy> lock(this); 1.872 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.873 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.874 + 1.875 + while(it != itEnd) 1.876 + { 1.877 + (*it)->getdest()->signal_disconnect(this); 1.878 + delete *it; 1.879 + 1.880 + ++it; 1.881 + } 1.882 + 1.883 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.884 + } 1.885 + 1.886 +#ifdef _DEBUG 1.887 + bool connected(has_slots_interface* pclass) 1.888 + { 1.889 + lock_block<mt_policy> lock(this); 1.890 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.891 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.892 + while(it != itEnd) 1.893 + { 1.894 + itNext = it; 1.895 + ++itNext; 1.896 + if ((*it)->getdest() == pclass) 1.897 + return true; 1.898 + it = itNext; 1.899 + } 1.900 + return false; 1.901 + } 1.902 +#endif 1.903 + 1.904 + void disconnect(has_slots_interface* pclass) 1.905 + { 1.906 + lock_block<mt_policy> lock(this); 1.907 + typename connections_list::iterator it = m_connected_slots.begin(); 1.908 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.909 + 1.910 + while(it != itEnd) 1.911 + { 1.912 + if((*it)->getdest() == pclass) 1.913 + { 1.914 + delete *it; 1.915 + m_connected_slots.erase(it); 1.916 + pclass->signal_disconnect(this); 1.917 + return; 1.918 + } 1.919 + 1.920 + ++it; 1.921 + } 1.922 + } 1.923 + 1.924 + void slot_disconnect(has_slots_interface* pslot) 1.925 + { 1.926 + lock_block<mt_policy> lock(this); 1.927 + typename connections_list::iterator it = m_connected_slots.begin(); 1.928 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.929 + 1.930 + while(it != itEnd) 1.931 + { 1.932 + typename connections_list::iterator itNext = it; 1.933 + ++itNext; 1.934 + 1.935 + if((*it)->getdest() == pslot) 1.936 + { 1.937 + delete *it; 1.938 + m_connected_slots.erase(it); 1.939 + } 1.940 + 1.941 + it = itNext; 1.942 + } 1.943 + } 1.944 + 1.945 + protected: 1.946 + connections_list m_connected_slots; 1.947 + }; 1.948 + 1.949 + template<class arg1_type, class arg2_type, class arg3_type, class mt_policy> 1.950 + class _signal_base3 : public _signal_base<mt_policy> 1.951 + { 1.952 + public: 1.953 + typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *> 1.954 + connections_list; 1.955 + 1.956 + _signal_base3() 1.957 + { 1.958 + ; 1.959 + } 1.960 + 1.961 + _signal_base3(const _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>& s) 1.962 + : _signal_base<mt_policy>(s) 1.963 + { 1.964 + lock_block<mt_policy> lock(this); 1.965 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.966 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.967 + 1.968 + while(it != itEnd) 1.969 + { 1.970 + (*it)->getdest()->signal_connect(this); 1.971 + m_connected_slots.push_back((*it)->clone()); 1.972 + 1.973 + ++it; 1.974 + } 1.975 + } 1.976 + 1.977 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.978 + { 1.979 + lock_block<mt_policy> lock(this); 1.980 + typename connections_list::iterator it = m_connected_slots.begin(); 1.981 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.982 + 1.983 + while(it != itEnd) 1.984 + { 1.985 + if((*it)->getdest() == oldtarget) 1.986 + { 1.987 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.988 + } 1.989 + 1.990 + ++it; 1.991 + } 1.992 + } 1.993 + 1.994 + ~_signal_base3() 1.995 + { 1.996 + disconnect_all(); 1.997 + } 1.998 + 1.999 + bool is_empty() 1.1000 + { 1.1001 + lock_block<mt_policy> lock(this); 1.1002 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1003 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1004 + return it == itEnd; 1.1005 + } 1.1006 + 1.1007 + void disconnect_all() 1.1008 + { 1.1009 + lock_block<mt_policy> lock(this); 1.1010 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1011 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1012 + 1.1013 + while(it != itEnd) 1.1014 + { 1.1015 + (*it)->getdest()->signal_disconnect(this); 1.1016 + delete *it; 1.1017 + 1.1018 + ++it; 1.1019 + } 1.1020 + 1.1021 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.1022 + } 1.1023 + 1.1024 +#ifdef _DEBUG 1.1025 + bool connected(has_slots_interface* pclass) 1.1026 + { 1.1027 + lock_block<mt_policy> lock(this); 1.1028 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.1029 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1030 + while(it != itEnd) 1.1031 + { 1.1032 + itNext = it; 1.1033 + ++itNext; 1.1034 + if ((*it)->getdest() == pclass) 1.1035 + return true; 1.1036 + it = itNext; 1.1037 + } 1.1038 + return false; 1.1039 + } 1.1040 +#endif 1.1041 + 1.1042 + void disconnect(has_slots_interface* pclass) 1.1043 + { 1.1044 + lock_block<mt_policy> lock(this); 1.1045 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1046 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1047 + 1.1048 + while(it != itEnd) 1.1049 + { 1.1050 + if((*it)->getdest() == pclass) 1.1051 + { 1.1052 + delete *it; 1.1053 + m_connected_slots.erase(it); 1.1054 + pclass->signal_disconnect(this); 1.1055 + return; 1.1056 + } 1.1057 + 1.1058 + ++it; 1.1059 + } 1.1060 + } 1.1061 + 1.1062 + void slot_disconnect(has_slots_interface* pslot) 1.1063 + { 1.1064 + lock_block<mt_policy> lock(this); 1.1065 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1066 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1067 + 1.1068 + while(it != itEnd) 1.1069 + { 1.1070 + typename connections_list::iterator itNext = it; 1.1071 + ++itNext; 1.1072 + 1.1073 + if((*it)->getdest() == pslot) 1.1074 + { 1.1075 + delete *it; 1.1076 + m_connected_slots.erase(it); 1.1077 + } 1.1078 + 1.1079 + it = itNext; 1.1080 + } 1.1081 + } 1.1082 + 1.1083 + protected: 1.1084 + connections_list m_connected_slots; 1.1085 + }; 1.1086 + 1.1087 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy> 1.1088 + class _signal_base4 : public _signal_base<mt_policy> 1.1089 + { 1.1090 + public: 1.1091 + typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type, 1.1092 + arg4_type, mt_policy> *> connections_list; 1.1093 + 1.1094 + _signal_base4() 1.1095 + { 1.1096 + ; 1.1097 + } 1.1098 + 1.1099 + _signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s) 1.1100 + : _signal_base<mt_policy>(s) 1.1101 + { 1.1102 + lock_block<mt_policy> lock(this); 1.1103 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.1104 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.1105 + 1.1106 + while(it != itEnd) 1.1107 + { 1.1108 + (*it)->getdest()->signal_connect(this); 1.1109 + m_connected_slots.push_back((*it)->clone()); 1.1110 + 1.1111 + ++it; 1.1112 + } 1.1113 + } 1.1114 + 1.1115 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.1116 + { 1.1117 + lock_block<mt_policy> lock(this); 1.1118 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1119 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1120 + 1.1121 + while(it != itEnd) 1.1122 + { 1.1123 + if((*it)->getdest() == oldtarget) 1.1124 + { 1.1125 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.1126 + } 1.1127 + 1.1128 + ++it; 1.1129 + } 1.1130 + } 1.1131 + 1.1132 + ~_signal_base4() 1.1133 + { 1.1134 + disconnect_all(); 1.1135 + } 1.1136 + 1.1137 + bool is_empty() 1.1138 + { 1.1139 + lock_block<mt_policy> lock(this); 1.1140 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1141 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1142 + return it == itEnd; 1.1143 + } 1.1144 + 1.1145 + void disconnect_all() 1.1146 + { 1.1147 + lock_block<mt_policy> lock(this); 1.1148 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1149 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1150 + 1.1151 + while(it != itEnd) 1.1152 + { 1.1153 + (*it)->getdest()->signal_disconnect(this); 1.1154 + delete *it; 1.1155 + 1.1156 + ++it; 1.1157 + } 1.1158 + 1.1159 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.1160 + } 1.1161 + 1.1162 +#ifdef _DEBUG 1.1163 + bool connected(has_slots_interface* pclass) 1.1164 + { 1.1165 + lock_block<mt_policy> lock(this); 1.1166 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.1167 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1168 + while(it != itEnd) 1.1169 + { 1.1170 + itNext = it; 1.1171 + ++itNext; 1.1172 + if ((*it)->getdest() == pclass) 1.1173 + return true; 1.1174 + it = itNext; 1.1175 + } 1.1176 + return false; 1.1177 + } 1.1178 +#endif 1.1179 + 1.1180 + void disconnect(has_slots_interface* pclass) 1.1181 + { 1.1182 + lock_block<mt_policy> lock(this); 1.1183 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1184 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1185 + 1.1186 + while(it != itEnd) 1.1187 + { 1.1188 + if((*it)->getdest() == pclass) 1.1189 + { 1.1190 + delete *it; 1.1191 + m_connected_slots.erase(it); 1.1192 + pclass->signal_disconnect(this); 1.1193 + return; 1.1194 + } 1.1195 + 1.1196 + ++it; 1.1197 + } 1.1198 + } 1.1199 + 1.1200 + void slot_disconnect(has_slots_interface* pslot) 1.1201 + { 1.1202 + lock_block<mt_policy> lock(this); 1.1203 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1204 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1205 + 1.1206 + while(it != itEnd) 1.1207 + { 1.1208 + typename connections_list::iterator itNext = it; 1.1209 + ++itNext; 1.1210 + 1.1211 + if((*it)->getdest() == pslot) 1.1212 + { 1.1213 + delete *it; 1.1214 + m_connected_slots.erase(it); 1.1215 + } 1.1216 + 1.1217 + it = itNext; 1.1218 + } 1.1219 + } 1.1220 + 1.1221 + protected: 1.1222 + connections_list m_connected_slots; 1.1223 + }; 1.1224 + 1.1225 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.1226 + class arg5_type, class mt_policy> 1.1227 + class _signal_base5 : public _signal_base<mt_policy> 1.1228 + { 1.1229 + public: 1.1230 + typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type, 1.1231 + arg4_type, arg5_type, mt_policy> *> connections_list; 1.1232 + 1.1233 + _signal_base5() 1.1234 + { 1.1235 + ; 1.1236 + } 1.1237 + 1.1238 + _signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, 1.1239 + arg5_type, mt_policy>& s) 1.1240 + : _signal_base<mt_policy>(s) 1.1241 + { 1.1242 + lock_block<mt_policy> lock(this); 1.1243 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.1244 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.1245 + 1.1246 + while(it != itEnd) 1.1247 + { 1.1248 + (*it)->getdest()->signal_connect(this); 1.1249 + m_connected_slots.push_back((*it)->clone()); 1.1250 + 1.1251 + ++it; 1.1252 + } 1.1253 + } 1.1254 + 1.1255 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.1256 + { 1.1257 + lock_block<mt_policy> lock(this); 1.1258 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1259 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1260 + 1.1261 + while(it != itEnd) 1.1262 + { 1.1263 + if((*it)->getdest() == oldtarget) 1.1264 + { 1.1265 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.1266 + } 1.1267 + 1.1268 + ++it; 1.1269 + } 1.1270 + } 1.1271 + 1.1272 + ~_signal_base5() 1.1273 + { 1.1274 + disconnect_all(); 1.1275 + } 1.1276 + 1.1277 + bool is_empty() 1.1278 + { 1.1279 + lock_block<mt_policy> lock(this); 1.1280 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1281 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1282 + return it == itEnd; 1.1283 + } 1.1284 + 1.1285 + void disconnect_all() 1.1286 + { 1.1287 + lock_block<mt_policy> lock(this); 1.1288 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1289 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1290 + 1.1291 + while(it != itEnd) 1.1292 + { 1.1293 + (*it)->getdest()->signal_disconnect(this); 1.1294 + delete *it; 1.1295 + 1.1296 + ++it; 1.1297 + } 1.1298 + 1.1299 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.1300 + } 1.1301 + 1.1302 +#ifdef _DEBUG 1.1303 + bool connected(has_slots_interface* pclass) 1.1304 + { 1.1305 + lock_block<mt_policy> lock(this); 1.1306 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.1307 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1308 + while(it != itEnd) 1.1309 + { 1.1310 + itNext = it; 1.1311 + ++itNext; 1.1312 + if ((*it)->getdest() == pclass) 1.1313 + return true; 1.1314 + it = itNext; 1.1315 + } 1.1316 + return false; 1.1317 + } 1.1318 +#endif 1.1319 + 1.1320 + void disconnect(has_slots_interface* pclass) 1.1321 + { 1.1322 + lock_block<mt_policy> lock(this); 1.1323 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1324 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1325 + 1.1326 + while(it != itEnd) 1.1327 + { 1.1328 + if((*it)->getdest() == pclass) 1.1329 + { 1.1330 + delete *it; 1.1331 + m_connected_slots.erase(it); 1.1332 + pclass->signal_disconnect(this); 1.1333 + return; 1.1334 + } 1.1335 + 1.1336 + ++it; 1.1337 + } 1.1338 + } 1.1339 + 1.1340 + void slot_disconnect(has_slots_interface* pslot) 1.1341 + { 1.1342 + lock_block<mt_policy> lock(this); 1.1343 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1344 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1345 + 1.1346 + while(it != itEnd) 1.1347 + { 1.1348 + typename connections_list::iterator itNext = it; 1.1349 + ++itNext; 1.1350 + 1.1351 + if((*it)->getdest() == pslot) 1.1352 + { 1.1353 + delete *it; 1.1354 + m_connected_slots.erase(it); 1.1355 + } 1.1356 + 1.1357 + it = itNext; 1.1358 + } 1.1359 + } 1.1360 + 1.1361 + protected: 1.1362 + connections_list m_connected_slots; 1.1363 + }; 1.1364 + 1.1365 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.1366 + class arg5_type, class arg6_type, class mt_policy> 1.1367 + class _signal_base6 : public _signal_base<mt_policy> 1.1368 + { 1.1369 + public: 1.1370 + typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type, 1.1371 + arg4_type, arg5_type, arg6_type, mt_policy> *> connections_list; 1.1372 + 1.1373 + _signal_base6() 1.1374 + { 1.1375 + ; 1.1376 + } 1.1377 + 1.1378 + _signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, 1.1379 + arg5_type, arg6_type, mt_policy>& s) 1.1380 + : _signal_base<mt_policy>(s) 1.1381 + { 1.1382 + lock_block<mt_policy> lock(this); 1.1383 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.1384 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.1385 + 1.1386 + while(it != itEnd) 1.1387 + { 1.1388 + (*it)->getdest()->signal_connect(this); 1.1389 + m_connected_slots.push_back((*it)->clone()); 1.1390 + 1.1391 + ++it; 1.1392 + } 1.1393 + } 1.1394 + 1.1395 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.1396 + { 1.1397 + lock_block<mt_policy> lock(this); 1.1398 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1399 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1400 + 1.1401 + while(it != itEnd) 1.1402 + { 1.1403 + if((*it)->getdest() == oldtarget) 1.1404 + { 1.1405 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.1406 + } 1.1407 + 1.1408 + ++it; 1.1409 + } 1.1410 + } 1.1411 + 1.1412 + ~_signal_base6() 1.1413 + { 1.1414 + disconnect_all(); 1.1415 + } 1.1416 + 1.1417 + bool is_empty() 1.1418 + { 1.1419 + lock_block<mt_policy> lock(this); 1.1420 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1421 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1422 + return it == itEnd; 1.1423 + } 1.1424 + 1.1425 + void disconnect_all() 1.1426 + { 1.1427 + lock_block<mt_policy> lock(this); 1.1428 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1429 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1430 + 1.1431 + while(it != itEnd) 1.1432 + { 1.1433 + (*it)->getdest()->signal_disconnect(this); 1.1434 + delete *it; 1.1435 + 1.1436 + ++it; 1.1437 + } 1.1438 + 1.1439 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.1440 + } 1.1441 + 1.1442 +#ifdef _DEBUG 1.1443 + bool connected(has_slots_interface* pclass) 1.1444 + { 1.1445 + lock_block<mt_policy> lock(this); 1.1446 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.1447 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1448 + while(it != itEnd) 1.1449 + { 1.1450 + itNext = it; 1.1451 + ++itNext; 1.1452 + if ((*it)->getdest() == pclass) 1.1453 + return true; 1.1454 + it = itNext; 1.1455 + } 1.1456 + return false; 1.1457 + } 1.1458 +#endif 1.1459 + 1.1460 + void disconnect(has_slots_interface* pclass) 1.1461 + { 1.1462 + lock_block<mt_policy> lock(this); 1.1463 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1464 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1465 + 1.1466 + while(it != itEnd) 1.1467 + { 1.1468 + if((*it)->getdest() == pclass) 1.1469 + { 1.1470 + delete *it; 1.1471 + m_connected_slots.erase(it); 1.1472 + pclass->signal_disconnect(this); 1.1473 + return; 1.1474 + } 1.1475 + 1.1476 + ++it; 1.1477 + } 1.1478 + } 1.1479 + 1.1480 + void slot_disconnect(has_slots_interface* pslot) 1.1481 + { 1.1482 + lock_block<mt_policy> lock(this); 1.1483 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1484 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1485 + 1.1486 + while(it != itEnd) 1.1487 + { 1.1488 + typename connections_list::iterator itNext = it; 1.1489 + ++itNext; 1.1490 + 1.1491 + if((*it)->getdest() == pslot) 1.1492 + { 1.1493 + delete *it; 1.1494 + m_connected_slots.erase(it); 1.1495 + } 1.1496 + 1.1497 + it = itNext; 1.1498 + } 1.1499 + } 1.1500 + 1.1501 + protected: 1.1502 + connections_list m_connected_slots; 1.1503 + }; 1.1504 + 1.1505 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.1506 + class arg5_type, class arg6_type, class arg7_type, class mt_policy> 1.1507 + class _signal_base7 : public _signal_base<mt_policy> 1.1508 + { 1.1509 + public: 1.1510 + typedef std::list<_connection_base7<arg1_type, arg2_type, arg3_type, 1.1511 + arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> *> connections_list; 1.1512 + 1.1513 + _signal_base7() 1.1514 + { 1.1515 + ; 1.1516 + } 1.1517 + 1.1518 + _signal_base7(const _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, 1.1519 + arg5_type, arg6_type, arg7_type, mt_policy>& s) 1.1520 + : _signal_base<mt_policy>(s) 1.1521 + { 1.1522 + lock_block<mt_policy> lock(this); 1.1523 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.1524 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.1525 + 1.1526 + while(it != itEnd) 1.1527 + { 1.1528 + (*it)->getdest()->signal_connect(this); 1.1529 + m_connected_slots.push_back((*it)->clone()); 1.1530 + 1.1531 + ++it; 1.1532 + } 1.1533 + } 1.1534 + 1.1535 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.1536 + { 1.1537 + lock_block<mt_policy> lock(this); 1.1538 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1539 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1540 + 1.1541 + while(it != itEnd) 1.1542 + { 1.1543 + if((*it)->getdest() == oldtarget) 1.1544 + { 1.1545 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.1546 + } 1.1547 + 1.1548 + ++it; 1.1549 + } 1.1550 + } 1.1551 + 1.1552 + ~_signal_base7() 1.1553 + { 1.1554 + disconnect_all(); 1.1555 + } 1.1556 + 1.1557 + bool is_empty() 1.1558 + { 1.1559 + lock_block<mt_policy> lock(this); 1.1560 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1561 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1562 + return it == itEnd; 1.1563 + } 1.1564 + 1.1565 + void disconnect_all() 1.1566 + { 1.1567 + lock_block<mt_policy> lock(this); 1.1568 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1569 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1570 + 1.1571 + while(it != itEnd) 1.1572 + { 1.1573 + (*it)->getdest()->signal_disconnect(this); 1.1574 + delete *it; 1.1575 + 1.1576 + ++it; 1.1577 + } 1.1578 + 1.1579 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.1580 + } 1.1581 + 1.1582 +#ifdef _DEBUG 1.1583 + bool connected(has_slots_interface* pclass) 1.1584 + { 1.1585 + lock_block<mt_policy> lock(this); 1.1586 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.1587 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1588 + while(it != itEnd) 1.1589 + { 1.1590 + itNext = it; 1.1591 + ++itNext; 1.1592 + if ((*it)->getdest() == pclass) 1.1593 + return true; 1.1594 + it = itNext; 1.1595 + } 1.1596 + return false; 1.1597 + } 1.1598 +#endif 1.1599 + 1.1600 + void disconnect(has_slots_interface* pclass) 1.1601 + { 1.1602 + lock_block<mt_policy> lock(this); 1.1603 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1604 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1605 + 1.1606 + while(it != itEnd) 1.1607 + { 1.1608 + if((*it)->getdest() == pclass) 1.1609 + { 1.1610 + delete *it; 1.1611 + m_connected_slots.erase(it); 1.1612 + pclass->signal_disconnect(this); 1.1613 + return; 1.1614 + } 1.1615 + 1.1616 + ++it; 1.1617 + } 1.1618 + } 1.1619 + 1.1620 + void slot_disconnect(has_slots_interface* pslot) 1.1621 + { 1.1622 + lock_block<mt_policy> lock(this); 1.1623 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1624 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1625 + 1.1626 + while(it != itEnd) 1.1627 + { 1.1628 + typename connections_list::iterator itNext = it; 1.1629 + ++itNext; 1.1630 + 1.1631 + if((*it)->getdest() == pslot) 1.1632 + { 1.1633 + delete *it; 1.1634 + m_connected_slots.erase(it); 1.1635 + } 1.1636 + 1.1637 + it = itNext; 1.1638 + } 1.1639 + } 1.1640 + 1.1641 + protected: 1.1642 + connections_list m_connected_slots; 1.1643 + }; 1.1644 + 1.1645 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.1646 + class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy> 1.1647 + class _signal_base8 : public _signal_base<mt_policy> 1.1648 + { 1.1649 + public: 1.1650 + typedef std::list<_connection_base8<arg1_type, arg2_type, arg3_type, 1.1651 + arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> *> 1.1652 + connections_list; 1.1653 + 1.1654 + _signal_base8() 1.1655 + { 1.1656 + ; 1.1657 + } 1.1658 + 1.1659 + _signal_base8(const _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, 1.1660 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s) 1.1661 + : _signal_base<mt_policy>(s) 1.1662 + { 1.1663 + lock_block<mt_policy> lock(this); 1.1664 + typename connections_list::const_iterator it = s.m_connected_slots.begin(); 1.1665 + typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); 1.1666 + 1.1667 + while(it != itEnd) 1.1668 + { 1.1669 + (*it)->getdest()->signal_connect(this); 1.1670 + m_connected_slots.push_back((*it)->clone()); 1.1671 + 1.1672 + ++it; 1.1673 + } 1.1674 + } 1.1675 + 1.1676 + void slot_duplicate(const has_slots_interface* oldtarget, has_slots_interface* newtarget) 1.1677 + { 1.1678 + lock_block<mt_policy> lock(this); 1.1679 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1680 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1681 + 1.1682 + while(it != itEnd) 1.1683 + { 1.1684 + if((*it)->getdest() == oldtarget) 1.1685 + { 1.1686 + m_connected_slots.push_back((*it)->duplicate(newtarget)); 1.1687 + } 1.1688 + 1.1689 + ++it; 1.1690 + } 1.1691 + } 1.1692 + 1.1693 + ~_signal_base8() 1.1694 + { 1.1695 + disconnect_all(); 1.1696 + } 1.1697 + 1.1698 + bool is_empty() 1.1699 + { 1.1700 + lock_block<mt_policy> lock(this); 1.1701 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1702 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1703 + return it == itEnd; 1.1704 + } 1.1705 + 1.1706 + void disconnect_all() 1.1707 + { 1.1708 + lock_block<mt_policy> lock(this); 1.1709 + typename connections_list::const_iterator it = m_connected_slots.begin(); 1.1710 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1711 + 1.1712 + while(it != itEnd) 1.1713 + { 1.1714 + (*it)->getdest()->signal_disconnect(this); 1.1715 + delete *it; 1.1716 + 1.1717 + ++it; 1.1718 + } 1.1719 + 1.1720 + m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); 1.1721 + } 1.1722 + 1.1723 +#ifdef _DEBUG 1.1724 + bool connected(has_slots_interface* pclass) 1.1725 + { 1.1726 + lock_block<mt_policy> lock(this); 1.1727 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.1728 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.1729 + while(it != itEnd) 1.1730 + { 1.1731 + itNext = it; 1.1732 + ++itNext; 1.1733 + if ((*it)->getdest() == pclass) 1.1734 + return true; 1.1735 + it = itNext; 1.1736 + } 1.1737 + return false; 1.1738 + } 1.1739 +#endif 1.1740 + 1.1741 + void disconnect(has_slots_interface* pclass) 1.1742 + { 1.1743 + lock_block<mt_policy> lock(this); 1.1744 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1745 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1746 + 1.1747 + while(it != itEnd) 1.1748 + { 1.1749 + if((*it)->getdest() == pclass) 1.1750 + { 1.1751 + delete *it; 1.1752 + m_connected_slots.erase(it); 1.1753 + pclass->signal_disconnect(this); 1.1754 + return; 1.1755 + } 1.1756 + 1.1757 + ++it; 1.1758 + } 1.1759 + } 1.1760 + 1.1761 + void slot_disconnect(has_slots_interface* pslot) 1.1762 + { 1.1763 + lock_block<mt_policy> lock(this); 1.1764 + typename connections_list::iterator it = m_connected_slots.begin(); 1.1765 + typename connections_list::iterator itEnd = m_connected_slots.end(); 1.1766 + 1.1767 + while(it != itEnd) 1.1768 + { 1.1769 + typename connections_list::iterator itNext = it; 1.1770 + ++itNext; 1.1771 + 1.1772 + if((*it)->getdest() == pslot) 1.1773 + { 1.1774 + delete *it; 1.1775 + m_connected_slots.erase(it); 1.1776 + } 1.1777 + 1.1778 + it = itNext; 1.1779 + } 1.1780 + } 1.1781 + 1.1782 + protected: 1.1783 + connections_list m_connected_slots; 1.1784 + }; 1.1785 + 1.1786 + 1.1787 + template<class dest_type, class mt_policy> 1.1788 + class _connection0 : public _connection_base0<mt_policy> 1.1789 + { 1.1790 + public: 1.1791 + _connection0() 1.1792 + { 1.1793 + m_pobject = NULL; 1.1794 + m_pmemfun = NULL; 1.1795 + } 1.1796 + 1.1797 + _connection0(dest_type* pobject, void (dest_type::*pmemfun)()) 1.1798 + { 1.1799 + m_pobject = pobject; 1.1800 + m_pmemfun = pmemfun; 1.1801 + } 1.1802 + 1.1803 + virtual ~_connection0() 1.1804 + { 1.1805 + } 1.1806 + 1.1807 + virtual _connection_base0<mt_policy>* clone() 1.1808 + { 1.1809 + return new _connection0<dest_type, mt_policy>(*this); 1.1810 + } 1.1811 + 1.1812 + virtual _connection_base0<mt_policy>* duplicate(has_slots_interface* pnewdest) 1.1813 + { 1.1814 + return new _connection0<dest_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.1815 + } 1.1816 + 1.1817 + virtual void emit() 1.1818 + { 1.1819 + (m_pobject->*m_pmemfun)(); 1.1820 + } 1.1821 + 1.1822 + virtual has_slots_interface* getdest() const 1.1823 + { 1.1824 + return m_pobject; 1.1825 + } 1.1826 + 1.1827 + private: 1.1828 + dest_type* m_pobject; 1.1829 + void (dest_type::* m_pmemfun)(); 1.1830 + }; 1.1831 + 1.1832 + template<class dest_type, class arg1_type, class mt_policy> 1.1833 + class _connection1 : public _connection_base1<arg1_type, mt_policy> 1.1834 + { 1.1835 + public: 1.1836 + _connection1() 1.1837 + { 1.1838 + m_pobject = NULL; 1.1839 + m_pmemfun = NULL; 1.1840 + } 1.1841 + 1.1842 + _connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type)) 1.1843 + { 1.1844 + m_pobject = pobject; 1.1845 + m_pmemfun = pmemfun; 1.1846 + } 1.1847 + 1.1848 + virtual ~_connection1() 1.1849 + { 1.1850 + } 1.1851 + 1.1852 + virtual _connection_base1<arg1_type, mt_policy>* clone() 1.1853 + { 1.1854 + return new _connection1<dest_type, arg1_type, mt_policy>(*this); 1.1855 + } 1.1856 + 1.1857 + virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.1858 + { 1.1859 + return new _connection1<dest_type, arg1_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.1860 + } 1.1861 + 1.1862 + virtual void emit(arg1_type a1) 1.1863 + { 1.1864 + (m_pobject->*m_pmemfun)(a1); 1.1865 + } 1.1866 + 1.1867 + virtual has_slots_interface* getdest() const 1.1868 + { 1.1869 + return m_pobject; 1.1870 + } 1.1871 + 1.1872 + private: 1.1873 + dest_type* m_pobject; 1.1874 + void (dest_type::* m_pmemfun)(arg1_type); 1.1875 + }; 1.1876 + 1.1877 + template<class dest_type, class arg1_type, class arg2_type, class mt_policy> 1.1878 + class _connection2 : public _connection_base2<arg1_type, arg2_type, mt_policy> 1.1879 + { 1.1880 + public: 1.1881 + _connection2() 1.1882 + { 1.1883 + m_pobject = NULL; 1.1884 + m_pmemfun = NULL; 1.1885 + } 1.1886 + 1.1887 + _connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, 1.1888 + arg2_type)) 1.1889 + { 1.1890 + m_pobject = pobject; 1.1891 + m_pmemfun = pmemfun; 1.1892 + } 1.1893 + 1.1894 + virtual ~_connection2() 1.1895 + { 1.1896 + } 1.1897 + 1.1898 + virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() 1.1899 + { 1.1900 + return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>(*this); 1.1901 + } 1.1902 + 1.1903 + virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.1904 + { 1.1905 + return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.1906 + } 1.1907 + 1.1908 + virtual void emit(arg1_type a1, arg2_type a2) 1.1909 + { 1.1910 + (m_pobject->*m_pmemfun)(a1, a2); 1.1911 + } 1.1912 + 1.1913 + virtual has_slots_interface* getdest() const 1.1914 + { 1.1915 + return m_pobject; 1.1916 + } 1.1917 + 1.1918 + private: 1.1919 + dest_type* m_pobject; 1.1920 + void (dest_type::* m_pmemfun)(arg1_type, arg2_type); 1.1921 + }; 1.1922 + 1.1923 + template<class dest_type, class arg1_type, class arg2_type, class arg3_type, class mt_policy> 1.1924 + class _connection3 : public _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> 1.1925 + { 1.1926 + public: 1.1927 + _connection3() 1.1928 + { 1.1929 + m_pobject = NULL; 1.1930 + m_pmemfun = NULL; 1.1931 + } 1.1932 + 1.1933 + _connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, 1.1934 + arg2_type, arg3_type)) 1.1935 + { 1.1936 + m_pobject = pobject; 1.1937 + m_pmemfun = pmemfun; 1.1938 + } 1.1939 + 1.1940 + virtual ~_connection3() 1.1941 + { 1.1942 + } 1.1943 + 1.1944 + virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() 1.1945 + { 1.1946 + return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>(*this); 1.1947 + } 1.1948 + 1.1949 + virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.1950 + { 1.1951 + return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.1952 + } 1.1953 + 1.1954 + virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3) 1.1955 + { 1.1956 + (m_pobject->*m_pmemfun)(a1, a2, a3); 1.1957 + } 1.1958 + 1.1959 + virtual has_slots_interface* getdest() const 1.1960 + { 1.1961 + return m_pobject; 1.1962 + } 1.1963 + 1.1964 + private: 1.1965 + dest_type* m_pobject; 1.1966 + void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type); 1.1967 + }; 1.1968 + 1.1969 + template<class dest_type, class arg1_type, class arg2_type, class arg3_type, 1.1970 + class arg4_type, class mt_policy> 1.1971 + class _connection4 : public _connection_base4<arg1_type, arg2_type, 1.1972 + arg3_type, arg4_type, mt_policy> 1.1973 + { 1.1974 + public: 1.1975 + _connection4() 1.1976 + { 1.1977 + m_pobject = NULL; 1.1978 + m_pmemfun = NULL; 1.1979 + } 1.1980 + 1.1981 + _connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, 1.1982 + arg2_type, arg3_type, arg4_type)) 1.1983 + { 1.1984 + m_pobject = pobject; 1.1985 + m_pmemfun = pmemfun; 1.1986 + } 1.1987 + 1.1988 + virtual ~_connection4() 1.1989 + { 1.1990 + } 1.1991 + 1.1992 + virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() 1.1993 + { 1.1994 + return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(*this); 1.1995 + } 1.1996 + 1.1997 + virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.1998 + { 1.1999 + return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.2000 + } 1.2001 + 1.2002 + virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, 1.2003 + arg4_type a4) 1.2004 + { 1.2005 + (m_pobject->*m_pmemfun)(a1, a2, a3, a4); 1.2006 + } 1.2007 + 1.2008 + virtual has_slots_interface* getdest() const 1.2009 + { 1.2010 + return m_pobject; 1.2011 + } 1.2012 + 1.2013 + private: 1.2014 + dest_type* m_pobject; 1.2015 + void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, 1.2016 + arg4_type); 1.2017 + }; 1.2018 + 1.2019 + template<class dest_type, class arg1_type, class arg2_type, class arg3_type, 1.2020 + class arg4_type, class arg5_type, class mt_policy> 1.2021 + class _connection5 : public _connection_base5<arg1_type, arg2_type, 1.2022 + arg3_type, arg4_type, arg5_type, mt_policy> 1.2023 + { 1.2024 + public: 1.2025 + _connection5() 1.2026 + { 1.2027 + m_pobject = NULL; 1.2028 + m_pmemfun = NULL; 1.2029 + } 1.2030 + 1.2031 + _connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, 1.2032 + arg2_type, arg3_type, arg4_type, arg5_type)) 1.2033 + { 1.2034 + m_pobject = pobject; 1.2035 + m_pmemfun = pmemfun; 1.2036 + } 1.2037 + 1.2038 + virtual ~_connection5() 1.2039 + { 1.2040 + } 1.2041 + 1.2042 + virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, 1.2043 + arg5_type, mt_policy>* clone() 1.2044 + { 1.2045 + return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2046 + arg5_type, mt_policy>(*this); 1.2047 + } 1.2048 + 1.2049 + virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, 1.2050 + arg5_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.2051 + { 1.2052 + return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2053 + arg5_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.2054 + } 1.2055 + 1.2056 + virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2057 + arg5_type a5) 1.2058 + { 1.2059 + (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5); 1.2060 + } 1.2061 + 1.2062 + virtual has_slots_interface* getdest() const 1.2063 + { 1.2064 + return m_pobject; 1.2065 + } 1.2066 + 1.2067 + private: 1.2068 + dest_type* m_pobject; 1.2069 + void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, 1.2070 + arg5_type); 1.2071 + }; 1.2072 + 1.2073 + template<class dest_type, class arg1_type, class arg2_type, class arg3_type, 1.2074 + class arg4_type, class arg5_type, class arg6_type, class mt_policy> 1.2075 + class _connection6 : public _connection_base6<arg1_type, arg2_type, 1.2076 + arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> 1.2077 + { 1.2078 + public: 1.2079 + _connection6() 1.2080 + { 1.2081 + m_pobject = NULL; 1.2082 + m_pmemfun = NULL; 1.2083 + } 1.2084 + 1.2085 + _connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, 1.2086 + arg2_type, arg3_type, arg4_type, arg5_type, arg6_type)) 1.2087 + { 1.2088 + m_pobject = pobject; 1.2089 + m_pmemfun = pmemfun; 1.2090 + } 1.2091 + 1.2092 + virtual ~_connection6() 1.2093 + { 1.2094 + } 1.2095 + 1.2096 + virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, 1.2097 + arg5_type, arg6_type, mt_policy>* clone() 1.2098 + { 1.2099 + return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2100 + arg5_type, arg6_type, mt_policy>(*this); 1.2101 + } 1.2102 + 1.2103 + virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, 1.2104 + arg5_type, arg6_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.2105 + { 1.2106 + return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2107 + arg5_type, arg6_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.2108 + } 1.2109 + 1.2110 + virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2111 + arg5_type a5, arg6_type a6) 1.2112 + { 1.2113 + (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6); 1.2114 + } 1.2115 + 1.2116 + virtual has_slots_interface* getdest() const 1.2117 + { 1.2118 + return m_pobject; 1.2119 + } 1.2120 + 1.2121 + private: 1.2122 + dest_type* m_pobject; 1.2123 + void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, 1.2124 + arg5_type, arg6_type); 1.2125 + }; 1.2126 + 1.2127 + template<class dest_type, class arg1_type, class arg2_type, class arg3_type, 1.2128 + class arg4_type, class arg5_type, class arg6_type, class arg7_type, class mt_policy> 1.2129 + class _connection7 : public _connection_base7<arg1_type, arg2_type, 1.2130 + arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> 1.2131 + { 1.2132 + public: 1.2133 + _connection7() 1.2134 + { 1.2135 + m_pobject = NULL; 1.2136 + m_pmemfun = NULL; 1.2137 + } 1.2138 + 1.2139 + _connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, 1.2140 + arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type)) 1.2141 + { 1.2142 + m_pobject = pobject; 1.2143 + m_pmemfun = pmemfun; 1.2144 + } 1.2145 + 1.2146 + virtual ~_connection7() 1.2147 + { 1.2148 + } 1.2149 + 1.2150 + virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, 1.2151 + arg5_type, arg6_type, arg7_type, mt_policy>* clone() 1.2152 + { 1.2153 + return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2154 + arg5_type, arg6_type, arg7_type, mt_policy>(*this); 1.2155 + } 1.2156 + 1.2157 + virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, 1.2158 + arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.2159 + { 1.2160 + return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2161 + arg5_type, arg6_type, arg7_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.2162 + } 1.2163 + 1.2164 + virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2165 + arg5_type a5, arg6_type a6, arg7_type a7) 1.2166 + { 1.2167 + (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7); 1.2168 + } 1.2169 + 1.2170 + virtual has_slots_interface* getdest() const 1.2171 + { 1.2172 + return m_pobject; 1.2173 + } 1.2174 + 1.2175 + private: 1.2176 + dest_type* m_pobject; 1.2177 + void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, 1.2178 + arg5_type, arg6_type, arg7_type); 1.2179 + }; 1.2180 + 1.2181 + template<class dest_type, class arg1_type, class arg2_type, class arg3_type, 1.2182 + class arg4_type, class arg5_type, class arg6_type, class arg7_type, 1.2183 + class arg8_type, class mt_policy> 1.2184 + class _connection8 : public _connection_base8<arg1_type, arg2_type, 1.2185 + arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> 1.2186 + { 1.2187 + public: 1.2188 + _connection8() 1.2189 + { 1.2190 + m_pobject = NULL; 1.2191 + m_pmemfun = NULL; 1.2192 + } 1.2193 + 1.2194 + _connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, 1.2195 + arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, 1.2196 + arg7_type, arg8_type)) 1.2197 + { 1.2198 + m_pobject = pobject; 1.2199 + m_pmemfun = pmemfun; 1.2200 + } 1.2201 + 1.2202 + virtual ~_connection8() 1.2203 + { 1.2204 + } 1.2205 + 1.2206 + virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, 1.2207 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() 1.2208 + { 1.2209 + return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2210 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(*this); 1.2211 + } 1.2212 + 1.2213 + virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, 1.2214 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots_interface* pnewdest) 1.2215 + { 1.2216 + return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, 1.2217 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>((dest_type *)pnewdest, m_pmemfun); 1.2218 + } 1.2219 + 1.2220 + virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2221 + arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) 1.2222 + { 1.2223 + (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8); 1.2224 + } 1.2225 + 1.2226 + virtual has_slots_interface* getdest() const 1.2227 + { 1.2228 + return m_pobject; 1.2229 + } 1.2230 + 1.2231 + private: 1.2232 + dest_type* m_pobject; 1.2233 + void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, 1.2234 + arg5_type, arg6_type, arg7_type, arg8_type); 1.2235 + }; 1.2236 + 1.2237 + template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2238 + class signal0 : public _signal_base0<mt_policy> 1.2239 + { 1.2240 + public: 1.2241 + typedef _signal_base0<mt_policy> base; 1.2242 + typedef typename base::connections_list connections_list; 1.2243 + using base::m_connected_slots; 1.2244 + 1.2245 + signal0() 1.2246 + { 1.2247 + ; 1.2248 + } 1.2249 + 1.2250 + signal0(const signal0<mt_policy>& s) 1.2251 + : _signal_base0<mt_policy>(s) 1.2252 + { 1.2253 + ; 1.2254 + } 1.2255 + 1.2256 + template<class desttype> 1.2257 + void connect(desttype* pclass, void (desttype::*pmemfun)()) 1.2258 + { 1.2259 + lock_block<mt_policy> lock(this); 1.2260 + _connection0<desttype, mt_policy>* conn = 1.2261 + new _connection0<desttype, mt_policy>(pclass, pmemfun); 1.2262 + m_connected_slots.push_back(conn); 1.2263 + pclass->signal_connect(this); 1.2264 + } 1.2265 + 1.2266 + void emit() 1.2267 + { 1.2268 + lock_block<mt_policy> lock(this); 1.2269 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2270 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2271 + 1.2272 + while(it != itEnd) 1.2273 + { 1.2274 + itNext = it; 1.2275 + ++itNext; 1.2276 + 1.2277 + (*it)->emit(); 1.2278 + 1.2279 + it = itNext; 1.2280 + } 1.2281 + } 1.2282 + 1.2283 + void operator()() 1.2284 + { 1.2285 + lock_block<mt_policy> lock(this); 1.2286 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2287 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2288 + 1.2289 + while(it != itEnd) 1.2290 + { 1.2291 + itNext = it; 1.2292 + ++itNext; 1.2293 + 1.2294 + (*it)->emit(); 1.2295 + 1.2296 + it = itNext; 1.2297 + } 1.2298 + } 1.2299 + }; 1.2300 + 1.2301 + template<class arg1_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2302 + class signal1 : public _signal_base1<arg1_type, mt_policy> 1.2303 + { 1.2304 + public: 1.2305 + typedef _signal_base1<arg1_type, mt_policy> base; 1.2306 + typedef typename base::connections_list connections_list; 1.2307 + using base::m_connected_slots; 1.2308 + 1.2309 + signal1() 1.2310 + { 1.2311 + ; 1.2312 + } 1.2313 + 1.2314 + signal1(const signal1<arg1_type, mt_policy>& s) 1.2315 + : _signal_base1<arg1_type, mt_policy>(s) 1.2316 + { 1.2317 + ; 1.2318 + } 1.2319 + 1.2320 + template<class desttype> 1.2321 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type)) 1.2322 + { 1.2323 + lock_block<mt_policy> lock(this); 1.2324 + _connection1<desttype, arg1_type, mt_policy>* conn = 1.2325 + new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun); 1.2326 + m_connected_slots.push_back(conn); 1.2327 + pclass->signal_connect(this); 1.2328 + } 1.2329 + 1.2330 + void emit(arg1_type a1) 1.2331 + { 1.2332 + lock_block<mt_policy> lock(this); 1.2333 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2334 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2335 + 1.2336 + while(it != itEnd) 1.2337 + { 1.2338 + itNext = it; 1.2339 + ++itNext; 1.2340 + 1.2341 + (*it)->emit(a1); 1.2342 + 1.2343 + it = itNext; 1.2344 + } 1.2345 + } 1.2346 + 1.2347 + void operator()(arg1_type a1) 1.2348 + { 1.2349 + lock_block<mt_policy> lock(this); 1.2350 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2351 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2352 + 1.2353 + while(it != itEnd) 1.2354 + { 1.2355 + itNext = it; 1.2356 + ++itNext; 1.2357 + 1.2358 + (*it)->emit(a1); 1.2359 + 1.2360 + it = itNext; 1.2361 + } 1.2362 + } 1.2363 + }; 1.2364 + 1.2365 + template<class arg1_type, class arg2_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2366 + class signal2 : public _signal_base2<arg1_type, arg2_type, mt_policy> 1.2367 + { 1.2368 + public: 1.2369 + typedef _signal_base2<arg1_type, arg2_type, mt_policy> base; 1.2370 + typedef typename base::connections_list connections_list; 1.2371 + using base::m_connected_slots; 1.2372 + 1.2373 + signal2() 1.2374 + { 1.2375 + ; 1.2376 + } 1.2377 + 1.2378 + signal2(const signal2<arg1_type, arg2_type, mt_policy>& s) 1.2379 + : _signal_base2<arg1_type, arg2_type, mt_policy>(s) 1.2380 + { 1.2381 + ; 1.2382 + } 1.2383 + 1.2384 + template<class desttype> 1.2385 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, 1.2386 + arg2_type)) 1.2387 + { 1.2388 + lock_block<mt_policy> lock(this); 1.2389 + _connection2<desttype, arg1_type, arg2_type, mt_policy>* conn = new 1.2390 + _connection2<desttype, arg1_type, arg2_type, mt_policy>(pclass, pmemfun); 1.2391 + m_connected_slots.push_back(conn); 1.2392 + pclass->signal_connect(this); 1.2393 + } 1.2394 + 1.2395 + void emit(arg1_type a1, arg2_type a2) 1.2396 + { 1.2397 + lock_block<mt_policy> lock(this); 1.2398 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2399 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2400 + 1.2401 + while(it != itEnd) 1.2402 + { 1.2403 + itNext = it; 1.2404 + ++itNext; 1.2405 + 1.2406 + (*it)->emit(a1, a2); 1.2407 + 1.2408 + it = itNext; 1.2409 + } 1.2410 + } 1.2411 + 1.2412 + void operator()(arg1_type a1, arg2_type a2) 1.2413 + { 1.2414 + lock_block<mt_policy> lock(this); 1.2415 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2416 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2417 + 1.2418 + while(it != itEnd) 1.2419 + { 1.2420 + itNext = it; 1.2421 + ++itNext; 1.2422 + 1.2423 + (*it)->emit(a1, a2); 1.2424 + 1.2425 + it = itNext; 1.2426 + } 1.2427 + } 1.2428 + }; 1.2429 + 1.2430 + template<class arg1_type, class arg2_type, class arg3_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2431 + class signal3 : public _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> 1.2432 + { 1.2433 + public: 1.2434 + typedef _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> base; 1.2435 + typedef typename base::connections_list connections_list; 1.2436 + using base::m_connected_slots; 1.2437 + 1.2438 + signal3() 1.2439 + { 1.2440 + ; 1.2441 + } 1.2442 + 1.2443 + signal3(const signal3<arg1_type, arg2_type, arg3_type, mt_policy>& s) 1.2444 + : _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>(s) 1.2445 + { 1.2446 + ; 1.2447 + } 1.2448 + 1.2449 + template<class desttype> 1.2450 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, 1.2451 + arg2_type, arg3_type)) 1.2452 + { 1.2453 + lock_block<mt_policy> lock(this); 1.2454 + _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn = 1.2455 + new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass, 1.2456 + pmemfun); 1.2457 + m_connected_slots.push_back(conn); 1.2458 + pclass->signal_connect(this); 1.2459 + } 1.2460 + 1.2461 + void emit(arg1_type a1, arg2_type a2, arg3_type a3) 1.2462 + { 1.2463 + lock_block<mt_policy> lock(this); 1.2464 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2465 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2466 + 1.2467 + while(it != itEnd) 1.2468 + { 1.2469 + itNext = it; 1.2470 + ++itNext; 1.2471 + 1.2472 + (*it)->emit(a1, a2, a3); 1.2473 + 1.2474 + it = itNext; 1.2475 + } 1.2476 + } 1.2477 + 1.2478 + void operator()(arg1_type a1, arg2_type a2, arg3_type a3) 1.2479 + { 1.2480 + lock_block<mt_policy> lock(this); 1.2481 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2482 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2483 + 1.2484 + while(it != itEnd) 1.2485 + { 1.2486 + itNext = it; 1.2487 + ++itNext; 1.2488 + 1.2489 + (*it)->emit(a1, a2, a3); 1.2490 + 1.2491 + it = itNext; 1.2492 + } 1.2493 + } 1.2494 + }; 1.2495 + 1.2496 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2497 + class signal4 : public _signal_base4<arg1_type, arg2_type, arg3_type, 1.2498 + arg4_type, mt_policy> 1.2499 + { 1.2500 + public: 1.2501 + typedef _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy> base; 1.2502 + typedef typename base::connections_list connections_list; 1.2503 + using base::m_connected_slots; 1.2504 + 1.2505 + signal4() 1.2506 + { 1.2507 + ; 1.2508 + } 1.2509 + 1.2510 + signal4(const signal4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s) 1.2511 + : _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(s) 1.2512 + { 1.2513 + ; 1.2514 + } 1.2515 + 1.2516 + template<class desttype> 1.2517 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, 1.2518 + arg2_type, arg3_type, arg4_type)) 1.2519 + { 1.2520 + lock_block<mt_policy> lock(this); 1.2521 + _connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* 1.2522 + conn = new _connection4<desttype, arg1_type, arg2_type, arg3_type, 1.2523 + arg4_type, mt_policy>(pclass, pmemfun); 1.2524 + m_connected_slots.push_back(conn); 1.2525 + pclass->signal_connect(this); 1.2526 + } 1.2527 + 1.2528 + void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) 1.2529 + { 1.2530 + lock_block<mt_policy> lock(this); 1.2531 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2532 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2533 + 1.2534 + while(it != itEnd) 1.2535 + { 1.2536 + itNext = it; 1.2537 + ++itNext; 1.2538 + 1.2539 + (*it)->emit(a1, a2, a3, a4); 1.2540 + 1.2541 + it = itNext; 1.2542 + } 1.2543 + } 1.2544 + 1.2545 + void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) 1.2546 + { 1.2547 + lock_block<mt_policy> lock(this); 1.2548 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2549 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2550 + 1.2551 + while(it != itEnd) 1.2552 + { 1.2553 + itNext = it; 1.2554 + ++itNext; 1.2555 + 1.2556 + (*it)->emit(a1, a2, a3, a4); 1.2557 + 1.2558 + it = itNext; 1.2559 + } 1.2560 + } 1.2561 + }; 1.2562 + 1.2563 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.2564 + class arg5_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2565 + class signal5 : public _signal_base5<arg1_type, arg2_type, arg3_type, 1.2566 + arg4_type, arg5_type, mt_policy> 1.2567 + { 1.2568 + public: 1.2569 + typedef _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy> base; 1.2570 + typedef typename base::connections_list connections_list; 1.2571 + using base::m_connected_slots; 1.2572 + 1.2573 + signal5() 1.2574 + { 1.2575 + ; 1.2576 + } 1.2577 + 1.2578 + signal5(const signal5<arg1_type, arg2_type, arg3_type, arg4_type, 1.2579 + arg5_type, mt_policy>& s) 1.2580 + : _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, 1.2581 + arg5_type, mt_policy>(s) 1.2582 + { 1.2583 + ; 1.2584 + } 1.2585 + 1.2586 + template<class desttype> 1.2587 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, 1.2588 + arg2_type, arg3_type, arg4_type, arg5_type)) 1.2589 + { 1.2590 + lock_block<mt_policy> lock(this); 1.2591 + _connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type, 1.2592 + arg5_type, mt_policy>* conn = new _connection5<desttype, arg1_type, arg2_type, 1.2593 + arg3_type, arg4_type, arg5_type, mt_policy>(pclass, pmemfun); 1.2594 + m_connected_slots.push_back(conn); 1.2595 + pclass->signal_connect(this); 1.2596 + } 1.2597 + 1.2598 + void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2599 + arg5_type a5) 1.2600 + { 1.2601 + lock_block<mt_policy> lock(this); 1.2602 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2603 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2604 + 1.2605 + while(it != itEnd) 1.2606 + { 1.2607 + itNext = it; 1.2608 + ++itNext; 1.2609 + 1.2610 + (*it)->emit(a1, a2, a3, a4, a5); 1.2611 + 1.2612 + it = itNext; 1.2613 + } 1.2614 + } 1.2615 + 1.2616 + void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2617 + arg5_type a5) 1.2618 + { 1.2619 + lock_block<mt_policy> lock(this); 1.2620 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2621 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2622 + 1.2623 + while(it != itEnd) 1.2624 + { 1.2625 + itNext = it; 1.2626 + ++itNext; 1.2627 + 1.2628 + (*it)->emit(a1, a2, a3, a4, a5); 1.2629 + 1.2630 + it = itNext; 1.2631 + } 1.2632 + } 1.2633 + }; 1.2634 + 1.2635 + 1.2636 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.2637 + class arg5_type, class arg6_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2638 + class signal6 : public _signal_base6<arg1_type, arg2_type, arg3_type, 1.2639 + arg4_type, arg5_type, arg6_type, mt_policy> 1.2640 + { 1.2641 + public: 1.2642 + typedef _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> base; 1.2643 + typedef typename base::connections_list connections_list; 1.2644 + using base::m_connected_slots; 1.2645 + 1.2646 + signal6() 1.2647 + { 1.2648 + ; 1.2649 + } 1.2650 + 1.2651 + signal6(const signal6<arg1_type, arg2_type, arg3_type, arg4_type, 1.2652 + arg5_type, arg6_type, mt_policy>& s) 1.2653 + : _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, 1.2654 + arg5_type, arg6_type, mt_policy>(s) 1.2655 + { 1.2656 + ; 1.2657 + } 1.2658 + 1.2659 + template<class desttype> 1.2660 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, 1.2661 + arg2_type, arg3_type, arg4_type, arg5_type, arg6_type)) 1.2662 + { 1.2663 + lock_block<mt_policy> lock(this); 1.2664 + _connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type, 1.2665 + arg5_type, arg6_type, mt_policy>* conn = 1.2666 + new _connection6<desttype, arg1_type, arg2_type, arg3_type, 1.2667 + arg4_type, arg5_type, arg6_type, mt_policy>(pclass, pmemfun); 1.2668 + m_connected_slots.push_back(conn); 1.2669 + pclass->signal_connect(this); 1.2670 + } 1.2671 + 1.2672 + void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2673 + arg5_type a5, arg6_type a6) 1.2674 + { 1.2675 + lock_block<mt_policy> lock(this); 1.2676 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2677 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2678 + 1.2679 + while(it != itEnd) 1.2680 + { 1.2681 + itNext = it; 1.2682 + ++itNext; 1.2683 + 1.2684 + (*it)->emit(a1, a2, a3, a4, a5, a6); 1.2685 + 1.2686 + it = itNext; 1.2687 + } 1.2688 + } 1.2689 + 1.2690 + void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2691 + arg5_type a5, arg6_type a6) 1.2692 + { 1.2693 + lock_block<mt_policy> lock(this); 1.2694 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2695 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2696 + 1.2697 + while(it != itEnd) 1.2698 + { 1.2699 + itNext = it; 1.2700 + ++itNext; 1.2701 + 1.2702 + (*it)->emit(a1, a2, a3, a4, a5, a6); 1.2703 + 1.2704 + it = itNext; 1.2705 + } 1.2706 + } 1.2707 + }; 1.2708 + 1.2709 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.2710 + class arg5_type, class arg6_type, class arg7_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2711 + class signal7 : public _signal_base7<arg1_type, arg2_type, arg3_type, 1.2712 + arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> 1.2713 + { 1.2714 + public: 1.2715 + typedef _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, 1.2716 + arg5_type, arg6_type, arg7_type, mt_policy> base; 1.2717 + typedef typename base::connections_list connections_list; 1.2718 + using base::m_connected_slots; 1.2719 + 1.2720 + signal7() 1.2721 + { 1.2722 + ; 1.2723 + } 1.2724 + 1.2725 + signal7(const signal7<arg1_type, arg2_type, arg3_type, arg4_type, 1.2726 + arg5_type, arg6_type, arg7_type, mt_policy>& s) 1.2727 + : _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, 1.2728 + arg5_type, arg6_type, arg7_type, mt_policy>(s) 1.2729 + { 1.2730 + ; 1.2731 + } 1.2732 + 1.2733 + template<class desttype> 1.2734 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, 1.2735 + arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, 1.2736 + arg7_type)) 1.2737 + { 1.2738 + lock_block<mt_policy> lock(this); 1.2739 + _connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type, 1.2740 + arg5_type, arg6_type, arg7_type, mt_policy>* conn = 1.2741 + new _connection7<desttype, arg1_type, arg2_type, arg3_type, 1.2742 + arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(pclass, pmemfun); 1.2743 + m_connected_slots.push_back(conn); 1.2744 + pclass->signal_connect(this); 1.2745 + } 1.2746 + 1.2747 + void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2748 + arg5_type a5, arg6_type a6, arg7_type a7) 1.2749 + { 1.2750 + lock_block<mt_policy> lock(this); 1.2751 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2752 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2753 + 1.2754 + while(it != itEnd) 1.2755 + { 1.2756 + itNext = it; 1.2757 + ++itNext; 1.2758 + 1.2759 + (*it)->emit(a1, a2, a3, a4, a5, a6, a7); 1.2760 + 1.2761 + it = itNext; 1.2762 + } 1.2763 + } 1.2764 + 1.2765 + void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2766 + arg5_type a5, arg6_type a6, arg7_type a7) 1.2767 + { 1.2768 + lock_block<mt_policy> lock(this); 1.2769 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2770 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2771 + 1.2772 + while(it != itEnd) 1.2773 + { 1.2774 + itNext = it; 1.2775 + ++itNext; 1.2776 + 1.2777 + (*it)->emit(a1, a2, a3, a4, a5, a6, a7); 1.2778 + 1.2779 + it = itNext; 1.2780 + } 1.2781 + } 1.2782 + }; 1.2783 + 1.2784 + template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, 1.2785 + class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> 1.2786 + class signal8 : public _signal_base8<arg1_type, arg2_type, arg3_type, 1.2787 + arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> 1.2788 + { 1.2789 + public: 1.2790 + typedef _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, 1.2791 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> base; 1.2792 + typedef typename base::connections_list connections_list; 1.2793 + using base::m_connected_slots; 1.2794 + 1.2795 + signal8() 1.2796 + { 1.2797 + ; 1.2798 + } 1.2799 + 1.2800 + signal8(const signal8<arg1_type, arg2_type, arg3_type, arg4_type, 1.2801 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s) 1.2802 + : _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, 1.2803 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(s) 1.2804 + { 1.2805 + ; 1.2806 + } 1.2807 + 1.2808 + template<class desttype> 1.2809 + void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, 1.2810 + arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, 1.2811 + arg7_type, arg8_type)) 1.2812 + { 1.2813 + lock_block<mt_policy> lock(this); 1.2814 + _connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type, 1.2815 + arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn = 1.2816 + new _connection8<desttype, arg1_type, arg2_type, arg3_type, 1.2817 + arg4_type, arg5_type, arg6_type, arg7_type, 1.2818 + arg8_type, mt_policy>(pclass, pmemfun); 1.2819 + m_connected_slots.push_back(conn); 1.2820 + pclass->signal_connect(this); 1.2821 + } 1.2822 + 1.2823 + void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2824 + arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) 1.2825 + { 1.2826 + lock_block<mt_policy> lock(this); 1.2827 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2828 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2829 + 1.2830 + while(it != itEnd) 1.2831 + { 1.2832 + itNext = it; 1.2833 + ++itNext; 1.2834 + 1.2835 + (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8); 1.2836 + 1.2837 + it = itNext; 1.2838 + } 1.2839 + } 1.2840 + 1.2841 + void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, 1.2842 + arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) 1.2843 + { 1.2844 + lock_block<mt_policy> lock(this); 1.2845 + typename connections_list::const_iterator itNext, it = m_connected_slots.begin(); 1.2846 + typename connections_list::const_iterator itEnd = m_connected_slots.end(); 1.2847 + 1.2848 + while(it != itEnd) 1.2849 + { 1.2850 + itNext = it; 1.2851 + ++itNext; 1.2852 + 1.2853 + (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8); 1.2854 + 1.2855 + it = itNext; 1.2856 + } 1.2857 + } 1.2858 + }; 1.2859 + 1.2860 +} // namespace sigslot 1.2861 + 1.2862 +#endif // TALK_BASE_SIGSLOT_H__