[9361] | 1 | /** |
---|
| 2 | * @file signal.h |
---|
| 3 | * @adaption from the beautiful sigslot implementation of sarah Thompson |
---|
| 4 | */ |
---|
| 5 | |
---|
[9358] | 6 | // sigslot.h: Signal/Slot classes |
---|
| 7 | // |
---|
| 8 | // Written by Sarah Thompson (sarah@telergy.com) 2002. |
---|
| 9 | // |
---|
| 10 | // License: Public domain. You are free to use this code however you like, with the proviso that |
---|
| 11 | // the author takes on no responsibility or liability for any use. |
---|
| 12 | // |
---|
| 13 | // QUICK DOCUMENTATION |
---|
| 14 | // |
---|
[9390] | 15 | // (see also the full documentation at http://sigslot.sourceforge.net/) |
---|
[9358] | 16 | // |
---|
[9390] | 17 | // #define switches |
---|
| 18 | // SIGSLOT_PURE_ISO - Define this to force ISO C++ compliance. This also disables |
---|
| 19 | // all of the thread safety support on platforms where it is |
---|
| 20 | // available. |
---|
[9358] | 21 | // |
---|
[9390] | 22 | // SIGSLOT_USE_POSIX_THREADS - Force use of Posix threads when using a C++ compiler other than |
---|
| 23 | // gcc on a platform that supports Posix threads. (When using gcc, |
---|
| 24 | // this is the default - use SIGSLOT_PURE_ISO to disable this if |
---|
| 25 | // necessary) |
---|
[9358] | 26 | // |
---|
[9390] | 27 | // SIGSLOT_DEFAULT_MT_POLICY - Where thread support is enabled, this defaults to multi_threaded_global. |
---|
| 28 | // Otherwise, the default is single_threaded. #define this yourself to |
---|
| 29 | // override the default. In pure ISO mode, anything other than |
---|
| 30 | // single_threaded will cause a compiler error. |
---|
[9358] | 31 | // |
---|
[9390] | 32 | // PLATFORM NOTES |
---|
[9358] | 33 | // |
---|
[9390] | 34 | // Win32 - On Win32, the WIN32 symbol must be #defined. Most mainstream |
---|
| 35 | // compilers do this by default, but you may need to define it |
---|
| 36 | // yourself if your build environment is less standard. This causes |
---|
| 37 | // the Win32 thread support to be compiled in and used automatically. |
---|
[9358] | 38 | // |
---|
[9390] | 39 | // Unix/Linux/BSD, etc. - If you're using gcc, it is assumed that you have Posix threads |
---|
| 40 | // available, so they are used automatically. You can override this |
---|
| 41 | // (as under Windows) with the SIGSLOT_PURE_ISO switch. If you're using |
---|
| 42 | // something other than gcc but still want to use Posix threads, you |
---|
| 43 | // need to #define SIGSLOT_USE_POSIX_THREADS. |
---|
[9358] | 44 | // |
---|
[9390] | 45 | // ISO C++ - If none of the supported platforms are detected, or if |
---|
| 46 | // SIGSLOT_PURE_ISO is defined, all multithreading support is turned off, |
---|
| 47 | // along with any code that might cause a pure ISO C++ environment to |
---|
| 48 | // complain. Before you ask, gcc -ansi -pedantic won't compile this |
---|
| 49 | // library, but gcc -ansi is fine. Pedantic mode seems to throw a lot of |
---|
| 50 | // errors that aren't really there. If you feel like investigating this, |
---|
| 51 | // please contact the author. |
---|
[9358] | 52 | // |
---|
| 53 | // |
---|
[9390] | 54 | // THREADING MODES |
---|
[9358] | 55 | // |
---|
[9390] | 56 | // single_threaded - Your program is assumed to be single threaded from the point of view |
---|
| 57 | // of signal/slot usage (i.e. all objects using signals and slots are |
---|
| 58 | // created and destroyed from a single thread). Behaviour if objects are |
---|
| 59 | // destroyed concurrently is undefined (i.e. you'll get the occasional |
---|
| 60 | // segmentation fault/memory exception). |
---|
[9358] | 61 | // |
---|
[9390] | 62 | // multi_threaded_global - Your program is assumed to be multi threaded. Objects using signals and |
---|
| 63 | // slots can be safely created and destroyed from any thread, even when |
---|
| 64 | // connections exist. In multi_threaded_global mode, this is achieved by a |
---|
| 65 | // single global mutex (actually a critical section on Windows because they |
---|
| 66 | // are faster). This option uses less OS resources, but results in more |
---|
| 67 | // opportunities for contention, possibly resulting in more context switches |
---|
| 68 | // than are strictly necessary. |
---|
[9358] | 69 | // |
---|
[9390] | 70 | // multi_threaded_local - Behaviour in this mode is essentially the same as multi_threaded_global, |
---|
| 71 | // except that each signal, and each object that inherits has_slots, all |
---|
| 72 | // have their own mutex/critical section. In practice, this means that |
---|
| 73 | // mutex collisions (and hence context switches) only happen if they are |
---|
| 74 | // absolutely essential. However, on some platforms, creating a lot of |
---|
| 75 | // mutexes can slow down the whole OS, so use this option with care. |
---|
[9358] | 76 | // |
---|
[9390] | 77 | // USING THE LIBRARY |
---|
[9358] | 78 | // |
---|
[9390] | 79 | // See the full documentation at http://sigslot.sourceforge.net/ |
---|
[9358] | 80 | // |
---|
| 81 | // |
---|
| 82 | |
---|
[9362] | 83 | #ifndef SIGNAL_H__ |
---|
| 84 | #define SIGNAL_H__ |
---|
[9358] | 85 | |
---|
| 86 | #include <set> |
---|
| 87 | #include <list> |
---|
| 88 | |
---|
[9359] | 89 | #include "slot.h" |
---|
[9358] | 90 | |
---|
[9359] | 91 | |
---|
[9358] | 92 | namespace sigslot |
---|
| 93 | { |
---|
| 94 | template<class mt_policy> |
---|
| 95 | class _connection_base0 |
---|
| 96 | { |
---|
[9368] | 97 | public: |
---|
[9869] | 98 | virtual ~_connection_base0() {}; |
---|
[9368] | 99 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 100 | virtual void emit() = 0; |
---|
| 101 | virtual _connection_base0* clone() = 0; |
---|
| 102 | virtual _connection_base0* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 103 | }; |
---|
| 104 | |
---|
| 105 | template<class arg1_type, class mt_policy> |
---|
| 106 | class _connection_base1 |
---|
| 107 | { |
---|
[9368] | 108 | public: |
---|
[9869] | 109 | virtual ~_connection_base1() {}; |
---|
[9368] | 110 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 111 | virtual void emit(arg1_type) = 0; |
---|
| 112 | virtual _connection_base1<arg1_type, mt_policy>* clone() = 0; |
---|
| 113 | virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 114 | }; |
---|
| 115 | |
---|
| 116 | template<class arg1_type, class arg2_type, class mt_policy> |
---|
| 117 | class _connection_base2 |
---|
| 118 | { |
---|
[9368] | 119 | public: |
---|
[9869] | 120 | virtual ~_connection_base2() {}; |
---|
[9368] | 121 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 122 | virtual void emit(arg1_type, arg2_type) = 0; |
---|
| 123 | virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() = 0; |
---|
| 124 | virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 125 | }; |
---|
| 126 | |
---|
| 127 | template<class arg1_type, class arg2_type, class arg3_type, class mt_policy> |
---|
| 128 | class _connection_base3 |
---|
| 129 | { |
---|
[9368] | 130 | public: |
---|
[9869] | 131 | virtual ~_connection_base3() {}; |
---|
[9368] | 132 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 133 | virtual void emit(arg1_type, arg2_type, arg3_type) = 0; |
---|
| 134 | virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() = 0; |
---|
| 135 | virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 136 | }; |
---|
| 137 | |
---|
| 138 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy> |
---|
| 139 | class _connection_base4 |
---|
| 140 | { |
---|
[9368] | 141 | public: |
---|
[9869] | 142 | virtual ~_connection_base4() {}; |
---|
[9368] | 143 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 144 | virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type) = 0; |
---|
| 145 | virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() = 0; |
---|
| 146 | virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 147 | }; |
---|
| 148 | |
---|
| 149 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 150 | class arg5_type, class mt_policy> |
---|
| 151 | class _connection_base5 |
---|
| 152 | { |
---|
[9368] | 153 | public: |
---|
[9869] | 154 | virtual ~_connection_base5() {}; |
---|
[9368] | 155 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 156 | virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 157 | arg5_type) = 0; |
---|
| 158 | virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 159 | arg5_type, mt_policy>* clone() = 0; |
---|
| 160 | virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 161 | arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 162 | }; |
---|
| 163 | |
---|
| 164 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 165 | class arg5_type, class arg6_type, class mt_policy> |
---|
| 166 | class _connection_base6 |
---|
| 167 | { |
---|
[9368] | 168 | public: |
---|
[9869] | 169 | virtual ~_connection_base6() {}; |
---|
[9368] | 170 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 171 | virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, |
---|
| 172 | arg6_type) = 0; |
---|
| 173 | virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 174 | arg5_type, arg6_type, mt_policy>* clone() = 0; |
---|
| 175 | virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 176 | arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 177 | }; |
---|
| 178 | |
---|
| 179 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 180 | class arg5_type, class arg6_type, class arg7_type, class mt_policy> |
---|
| 181 | class _connection_base7 |
---|
| 182 | { |
---|
[9368] | 183 | public: |
---|
[9869] | 184 | virtual ~_connection_base7() {}; |
---|
[9368] | 185 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 186 | virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, |
---|
| 187 | arg6_type, arg7_type) = 0; |
---|
| 188 | virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 189 | arg5_type, arg6_type, arg7_type, mt_policy>* clone() = 0; |
---|
| 190 | virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 191 | arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 192 | }; |
---|
| 193 | |
---|
| 194 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 195 | class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy> |
---|
| 196 | class _connection_base8 |
---|
| 197 | { |
---|
[9368] | 198 | public: |
---|
[9869] | 199 | virtual ~_connection_base8() {}; |
---|
[9368] | 200 | virtual has_slots<mt_policy>* getdest() const = 0; |
---|
| 201 | virtual void emit(arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, |
---|
| 202 | arg6_type, arg7_type, arg8_type) = 0; |
---|
| 203 | virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 204 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() = 0; |
---|
| 205 | virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 206 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) = 0; |
---|
[9358] | 207 | }; |
---|
| 208 | |
---|
| 209 | template<class mt_policy> |
---|
| 210 | class _signal_base0 : public _signal_base<mt_policy> |
---|
| 211 | { |
---|
[9368] | 212 | public: |
---|
| 213 | typedef std::list<_connection_base0<mt_policy> *> connections_list; |
---|
[9358] | 214 | |
---|
[9368] | 215 | _signal_base0() |
---|
| 216 | { |
---|
| 217 | ; |
---|
| 218 | } |
---|
| 219 | |
---|
| 220 | _signal_base0(const _signal_base0& s) |
---|
| 221 | : _signal_base<mt_policy>(s) |
---|
| 222 | { |
---|
| 223 | lock_block<mt_policy> lock(this); |
---|
| 224 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 225 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 226 | |
---|
| 227 | while(it != itEnd) |
---|
[9358] | 228 | { |
---|
[9368] | 229 | (*it)->getdest()->signal_connect(this); |
---|
| 230 | m_connected_slots.push_back((*it)->clone()); |
---|
| 231 | |
---|
| 232 | ++it; |
---|
[9358] | 233 | } |
---|
[9368] | 234 | } |
---|
[9358] | 235 | |
---|
[9368] | 236 | ~_signal_base0() |
---|
| 237 | { |
---|
| 238 | disconnect_all(); |
---|
| 239 | } |
---|
[9358] | 240 | |
---|
[9368] | 241 | void disconnect_all() |
---|
| 242 | { |
---|
| 243 | lock_block<mt_policy> lock(this); |
---|
| 244 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 245 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 246 | |
---|
[9368] | 247 | while(it != itEnd) |
---|
| 248 | { |
---|
| 249 | (*it)->getdest()->signal_disconnect(this); |
---|
| 250 | delete *it; |
---|
[9358] | 251 | |
---|
[9368] | 252 | ++it; |
---|
[9358] | 253 | } |
---|
| 254 | |
---|
[9368] | 255 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 256 | } |
---|
| 257 | |
---|
| 258 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 259 | { |
---|
| 260 | lock_block<mt_policy> lock(this); |
---|
| 261 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 262 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 263 | |
---|
| 264 | while(it != itEnd) |
---|
[9358] | 265 | { |
---|
[9368] | 266 | if((*it)->getdest() == pclass) |
---|
[9358] | 267 | { |
---|
| 268 | delete *it; |
---|
[9368] | 269 | m_connected_slots.erase(it); |
---|
| 270 | pclass->signal_disconnect(this); |
---|
| 271 | return; |
---|
[9358] | 272 | } |
---|
| 273 | |
---|
[9368] | 274 | ++it; |
---|
[9358] | 275 | } |
---|
[9368] | 276 | } |
---|
[9358] | 277 | |
---|
[9368] | 278 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 279 | { |
---|
| 280 | lock_block<mt_policy> lock(this); |
---|
| 281 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 282 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 283 | |
---|
| 284 | while(it != itEnd) |
---|
[9358] | 285 | { |
---|
[9368] | 286 | typename connections_list::iterator itNext = it; |
---|
| 287 | ++itNext; |
---|
[9358] | 288 | |
---|
[9368] | 289 | if((*it)->getdest() == pslot) |
---|
[9358] | 290 | { |
---|
[9368] | 291 | m_connected_slots.erase(it); |
---|
[9390] | 292 | // delete *it; |
---|
[9368] | 293 | } |
---|
[9358] | 294 | |
---|
[9368] | 295 | it = itNext; |
---|
[9358] | 296 | } |
---|
[9368] | 297 | } |
---|
[9358] | 298 | |
---|
[9368] | 299 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 300 | { |
---|
| 301 | lock_block<mt_policy> lock(this); |
---|
| 302 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 303 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 304 | |
---|
| 305 | while(it != itEnd) |
---|
[9358] | 306 | { |
---|
[9368] | 307 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 308 | { |
---|
[9368] | 309 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
[9358] | 310 | } |
---|
| 311 | |
---|
[9368] | 312 | ++it; |
---|
[9358] | 313 | } |
---|
[9368] | 314 | } |
---|
[9358] | 315 | |
---|
[9368] | 316 | protected: |
---|
| 317 | connections_list m_connected_slots; |
---|
[9358] | 318 | }; |
---|
| 319 | |
---|
| 320 | template<class arg1_type, class mt_policy> |
---|
| 321 | class _signal_base1 : public _signal_base<mt_policy> |
---|
| 322 | { |
---|
[9368] | 323 | public: |
---|
| 324 | typedef std::list<_connection_base1<arg1_type, mt_policy> *> connections_list; |
---|
[9358] | 325 | |
---|
[9368] | 326 | _signal_base1() |
---|
| 327 | { |
---|
| 328 | ; |
---|
| 329 | } |
---|
| 330 | |
---|
| 331 | _signal_base1(const _signal_base1<arg1_type, mt_policy>& s) |
---|
| 332 | : _signal_base<mt_policy>(s) |
---|
| 333 | { |
---|
| 334 | lock_block<mt_policy> lock(this); |
---|
| 335 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 336 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 337 | |
---|
| 338 | while(it != itEnd) |
---|
[9358] | 339 | { |
---|
[9368] | 340 | (*it)->getdest()->signal_connect(this); |
---|
| 341 | m_connected_slots.push_back((*it)->clone()); |
---|
| 342 | |
---|
| 343 | ++it; |
---|
[9358] | 344 | } |
---|
[9368] | 345 | } |
---|
[9358] | 346 | |
---|
[9368] | 347 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 348 | { |
---|
| 349 | lock_block<mt_policy> lock(this); |
---|
| 350 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 351 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 352 | |
---|
| 353 | while(it != itEnd) |
---|
[9358] | 354 | { |
---|
[9368] | 355 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 356 | { |
---|
[9368] | 357 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 358 | } |
---|
[9358] | 359 | |
---|
[9368] | 360 | ++it; |
---|
[9358] | 361 | } |
---|
[9368] | 362 | } |
---|
[9358] | 363 | |
---|
[9368] | 364 | ~_signal_base1() |
---|
| 365 | { |
---|
| 366 | disconnect_all(); |
---|
| 367 | } |
---|
[9358] | 368 | |
---|
[9368] | 369 | void disconnect_all() |
---|
| 370 | { |
---|
| 371 | lock_block<mt_policy> lock(this); |
---|
| 372 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 373 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 374 | |
---|
[9368] | 375 | while(it != itEnd) |
---|
| 376 | { |
---|
| 377 | (*it)->getdest()->signal_disconnect(this); |
---|
| 378 | delete *it; |
---|
[9358] | 379 | |
---|
[9368] | 380 | ++it; |
---|
[9358] | 381 | } |
---|
| 382 | |
---|
[9368] | 383 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 384 | } |
---|
| 385 | |
---|
| 386 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 387 | { |
---|
| 388 | lock_block<mt_policy> lock(this); |
---|
| 389 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 390 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 391 | |
---|
| 392 | while(it != itEnd) |
---|
[9358] | 393 | { |
---|
[9368] | 394 | if((*it)->getdest() == pclass) |
---|
[9358] | 395 | { |
---|
| 396 | delete *it; |
---|
[9368] | 397 | m_connected_slots.erase(it); |
---|
| 398 | pclass->signal_disconnect(this); |
---|
| 399 | return; |
---|
[9358] | 400 | } |
---|
| 401 | |
---|
[9368] | 402 | ++it; |
---|
[9358] | 403 | } |
---|
[9368] | 404 | } |
---|
[9358] | 405 | |
---|
[9368] | 406 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 407 | { |
---|
| 408 | lock_block<mt_policy> lock(this); |
---|
| 409 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 410 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 411 | |
---|
| 412 | while(it != itEnd) |
---|
[9358] | 413 | { |
---|
[9368] | 414 | typename connections_list::iterator itNext = it; |
---|
| 415 | ++itNext; |
---|
[9358] | 416 | |
---|
[9368] | 417 | if((*it)->getdest() == pslot) |
---|
[9358] | 418 | { |
---|
[9368] | 419 | m_connected_slots.erase(it); |
---|
[9390] | 420 | // delete *it; |
---|
[9358] | 421 | } |
---|
| 422 | |
---|
[9368] | 423 | it = itNext; |
---|
[9358] | 424 | } |
---|
[9368] | 425 | } |
---|
[9358] | 426 | |
---|
| 427 | |
---|
[9368] | 428 | protected: |
---|
| 429 | connections_list m_connected_slots; |
---|
[9358] | 430 | }; |
---|
| 431 | |
---|
| 432 | template<class arg1_type, class arg2_type, class mt_policy> |
---|
| 433 | class _signal_base2 : public _signal_base<mt_policy> |
---|
| 434 | { |
---|
[9368] | 435 | public: |
---|
| 436 | typedef std::list<_connection_base2<arg1_type, arg2_type, mt_policy> *> |
---|
| 437 | connections_list; |
---|
[9358] | 438 | |
---|
[9368] | 439 | _signal_base2() |
---|
| 440 | { |
---|
| 441 | ; |
---|
| 442 | } |
---|
| 443 | |
---|
| 444 | _signal_base2(const _signal_base2<arg1_type, arg2_type, mt_policy>& s) |
---|
| 445 | : _signal_base<mt_policy>(s) |
---|
| 446 | { |
---|
| 447 | lock_block<mt_policy> lock(this); |
---|
| 448 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 449 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 450 | |
---|
| 451 | while(it != itEnd) |
---|
[9358] | 452 | { |
---|
[9368] | 453 | (*it)->getdest()->signal_connect(this); |
---|
| 454 | m_connected_slots.push_back((*it)->clone()); |
---|
| 455 | |
---|
| 456 | ++it; |
---|
[9358] | 457 | } |
---|
[9368] | 458 | } |
---|
[9358] | 459 | |
---|
[9368] | 460 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 461 | { |
---|
| 462 | lock_block<mt_policy> lock(this); |
---|
| 463 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 464 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 465 | |
---|
| 466 | while(it != itEnd) |
---|
[9358] | 467 | { |
---|
[9368] | 468 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 469 | { |
---|
[9368] | 470 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 471 | } |
---|
[9358] | 472 | |
---|
[9368] | 473 | ++it; |
---|
[9358] | 474 | } |
---|
[9368] | 475 | } |
---|
[9358] | 476 | |
---|
[9368] | 477 | ~_signal_base2() |
---|
| 478 | { |
---|
| 479 | disconnect_all(); |
---|
| 480 | } |
---|
[9358] | 481 | |
---|
[9368] | 482 | void disconnect_all() |
---|
| 483 | { |
---|
| 484 | lock_block<mt_policy> lock(this); |
---|
| 485 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 486 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 487 | |
---|
[9368] | 488 | while(it != itEnd) |
---|
| 489 | { |
---|
| 490 | (*it)->getdest()->signal_disconnect(this); |
---|
| 491 | delete *it; |
---|
[9358] | 492 | |
---|
[9368] | 493 | ++it; |
---|
[9358] | 494 | } |
---|
| 495 | |
---|
[9368] | 496 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 497 | } |
---|
| 498 | |
---|
| 499 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 500 | { |
---|
| 501 | lock_block<mt_policy> lock(this); |
---|
| 502 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 503 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 504 | |
---|
| 505 | while(it != itEnd) |
---|
[9358] | 506 | { |
---|
[9368] | 507 | if((*it)->getdest() == pclass) |
---|
[9358] | 508 | { |
---|
| 509 | delete *it; |
---|
[9368] | 510 | m_connected_slots.erase(it); |
---|
| 511 | pclass->signal_disconnect(this); |
---|
| 512 | return; |
---|
[9358] | 513 | } |
---|
| 514 | |
---|
[9368] | 515 | ++it; |
---|
[9358] | 516 | } |
---|
[9368] | 517 | } |
---|
[9358] | 518 | |
---|
[9368] | 519 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 520 | { |
---|
| 521 | lock_block<mt_policy> lock(this); |
---|
| 522 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 523 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 524 | |
---|
| 525 | while(it != itEnd) |
---|
[9358] | 526 | { |
---|
[9368] | 527 | typename connections_list::iterator itNext = it; |
---|
| 528 | ++itNext; |
---|
[9358] | 529 | |
---|
[9368] | 530 | if((*it)->getdest() == pslot) |
---|
[9358] | 531 | { |
---|
[9368] | 532 | m_connected_slots.erase(it); |
---|
[9390] | 533 | // delete *it; |
---|
[9358] | 534 | } |
---|
| 535 | |
---|
[9368] | 536 | it = itNext; |
---|
[9358] | 537 | } |
---|
[9368] | 538 | } |
---|
[9358] | 539 | |
---|
[9368] | 540 | protected: |
---|
| 541 | connections_list m_connected_slots; |
---|
[9358] | 542 | }; |
---|
| 543 | |
---|
| 544 | template<class arg1_type, class arg2_type, class arg3_type, class mt_policy> |
---|
| 545 | class _signal_base3 : public _signal_base<mt_policy> |
---|
| 546 | { |
---|
[9368] | 547 | public: |
---|
| 548 | typedef std::list<_connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> *> |
---|
| 549 | connections_list; |
---|
[9358] | 550 | |
---|
[9368] | 551 | _signal_base3() |
---|
| 552 | { |
---|
| 553 | ; |
---|
| 554 | } |
---|
| 555 | |
---|
| 556 | _signal_base3(const _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>& s) |
---|
| 557 | : _signal_base<mt_policy>(s) |
---|
| 558 | { |
---|
| 559 | lock_block<mt_policy> lock(this); |
---|
| 560 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 561 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 562 | |
---|
| 563 | while(it != itEnd) |
---|
[9358] | 564 | { |
---|
[9368] | 565 | (*it)->getdest()->signal_connect(this); |
---|
| 566 | m_connected_slots.push_back((*it)->clone()); |
---|
| 567 | |
---|
| 568 | ++it; |
---|
[9358] | 569 | } |
---|
[9368] | 570 | } |
---|
[9358] | 571 | |
---|
[9368] | 572 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 573 | { |
---|
| 574 | lock_block<mt_policy> lock(this); |
---|
| 575 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 576 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 577 | |
---|
| 578 | while(it != itEnd) |
---|
[9358] | 579 | { |
---|
[9368] | 580 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 581 | { |
---|
[9368] | 582 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 583 | } |
---|
[9358] | 584 | |
---|
[9368] | 585 | ++it; |
---|
[9358] | 586 | } |
---|
[9368] | 587 | } |
---|
[9358] | 588 | |
---|
[9368] | 589 | ~_signal_base3() |
---|
| 590 | { |
---|
| 591 | disconnect_all(); |
---|
| 592 | } |
---|
[9358] | 593 | |
---|
[9368] | 594 | void disconnect_all() |
---|
| 595 | { |
---|
| 596 | lock_block<mt_policy> lock(this); |
---|
| 597 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 598 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 599 | |
---|
[9368] | 600 | while(it != itEnd) |
---|
| 601 | { |
---|
| 602 | (*it)->getdest()->signal_disconnect(this); |
---|
| 603 | delete *it; |
---|
[9358] | 604 | |
---|
[9368] | 605 | ++it; |
---|
[9358] | 606 | } |
---|
| 607 | |
---|
[9368] | 608 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 609 | } |
---|
| 610 | |
---|
| 611 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 612 | { |
---|
| 613 | lock_block<mt_policy> lock(this); |
---|
| 614 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 615 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 616 | |
---|
| 617 | while(it != itEnd) |
---|
[9358] | 618 | { |
---|
[9368] | 619 | if((*it)->getdest() == pclass) |
---|
[9358] | 620 | { |
---|
| 621 | delete *it; |
---|
[9368] | 622 | m_connected_slots.erase(it); |
---|
| 623 | pclass->signal_disconnect(this); |
---|
| 624 | return; |
---|
[9358] | 625 | } |
---|
| 626 | |
---|
[9368] | 627 | ++it; |
---|
[9358] | 628 | } |
---|
[9368] | 629 | } |
---|
[9358] | 630 | |
---|
[9368] | 631 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 632 | { |
---|
| 633 | lock_block<mt_policy> lock(this); |
---|
| 634 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 635 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 636 | |
---|
| 637 | while(it != itEnd) |
---|
[9358] | 638 | { |
---|
[9368] | 639 | typename connections_list::iterator itNext = it; |
---|
| 640 | ++itNext; |
---|
[9358] | 641 | |
---|
[9368] | 642 | if((*it)->getdest() == pslot) |
---|
[9358] | 643 | { |
---|
[9368] | 644 | m_connected_slots.erase(it); |
---|
[9390] | 645 | // delete *it; |
---|
[9358] | 646 | } |
---|
| 647 | |
---|
[9368] | 648 | it = itNext; |
---|
[9358] | 649 | } |
---|
[9368] | 650 | } |
---|
[9358] | 651 | |
---|
[9368] | 652 | protected: |
---|
| 653 | connections_list m_connected_slots; |
---|
[9358] | 654 | }; |
---|
| 655 | |
---|
| 656 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy> |
---|
| 657 | class _signal_base4 : public _signal_base<mt_policy> |
---|
| 658 | { |
---|
[9368] | 659 | public: |
---|
| 660 | typedef std::list<_connection_base4<arg1_type, arg2_type, arg3_type, |
---|
| 661 | arg4_type, mt_policy> *> connections_list; |
---|
[9358] | 662 | |
---|
[9368] | 663 | _signal_base4() |
---|
| 664 | { |
---|
| 665 | ; |
---|
| 666 | } |
---|
| 667 | |
---|
| 668 | _signal_base4(const _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s) |
---|
| 669 | : _signal_base<mt_policy>(s) |
---|
| 670 | { |
---|
| 671 | lock_block<mt_policy> lock(this); |
---|
| 672 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 673 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 674 | |
---|
| 675 | while(it != itEnd) |
---|
[9358] | 676 | { |
---|
[9368] | 677 | (*it)->getdest()->signal_connect(this); |
---|
| 678 | m_connected_slots.push_back((*it)->clone()); |
---|
| 679 | |
---|
| 680 | ++it; |
---|
[9358] | 681 | } |
---|
[9368] | 682 | } |
---|
[9358] | 683 | |
---|
[9368] | 684 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 685 | { |
---|
| 686 | lock_block<mt_policy> lock(this); |
---|
| 687 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 688 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 689 | |
---|
| 690 | while(it != itEnd) |
---|
[9358] | 691 | { |
---|
[9368] | 692 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 693 | { |
---|
[9368] | 694 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 695 | } |
---|
[9358] | 696 | |
---|
[9368] | 697 | ++it; |
---|
[9358] | 698 | } |
---|
[9368] | 699 | } |
---|
[9358] | 700 | |
---|
[9368] | 701 | ~_signal_base4() |
---|
| 702 | { |
---|
| 703 | disconnect_all(); |
---|
| 704 | } |
---|
[9358] | 705 | |
---|
[9368] | 706 | void disconnect_all() |
---|
| 707 | { |
---|
| 708 | lock_block<mt_policy> lock(this); |
---|
| 709 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 710 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 711 | |
---|
[9368] | 712 | while(it != itEnd) |
---|
| 713 | { |
---|
| 714 | (*it)->getdest()->signal_disconnect(this); |
---|
| 715 | delete *it; |
---|
[9358] | 716 | |
---|
[9368] | 717 | ++it; |
---|
[9358] | 718 | } |
---|
| 719 | |
---|
[9368] | 720 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 721 | } |
---|
| 722 | |
---|
| 723 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 724 | { |
---|
| 725 | lock_block<mt_policy> lock(this); |
---|
| 726 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 727 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 728 | |
---|
| 729 | while(it != itEnd) |
---|
[9358] | 730 | { |
---|
[9368] | 731 | if((*it)->getdest() == pclass) |
---|
[9358] | 732 | { |
---|
| 733 | delete *it; |
---|
[9368] | 734 | m_connected_slots.erase(it); |
---|
| 735 | pclass->signal_disconnect(this); |
---|
| 736 | return; |
---|
[9358] | 737 | } |
---|
| 738 | |
---|
[9368] | 739 | ++it; |
---|
[9358] | 740 | } |
---|
[9368] | 741 | } |
---|
[9358] | 742 | |
---|
[9368] | 743 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 744 | { |
---|
| 745 | lock_block<mt_policy> lock(this); |
---|
| 746 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 747 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 748 | |
---|
| 749 | while(it != itEnd) |
---|
[9358] | 750 | { |
---|
[9368] | 751 | typename connections_list::iterator itNext = it; |
---|
| 752 | ++itNext; |
---|
[9358] | 753 | |
---|
[9368] | 754 | if((*it)->getdest() == pslot) |
---|
[9358] | 755 | { |
---|
[9368] | 756 | m_connected_slots.erase(it); |
---|
[9390] | 757 | // delete *it; |
---|
[9358] | 758 | } |
---|
| 759 | |
---|
[9368] | 760 | it = itNext; |
---|
[9358] | 761 | } |
---|
[9368] | 762 | } |
---|
[9358] | 763 | |
---|
[9368] | 764 | protected: |
---|
| 765 | connections_list m_connected_slots; |
---|
[9358] | 766 | }; |
---|
| 767 | |
---|
| 768 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 769 | class arg5_type, class mt_policy> |
---|
| 770 | class _signal_base5 : public _signal_base<mt_policy> |
---|
| 771 | { |
---|
[9368] | 772 | public: |
---|
| 773 | typedef std::list<_connection_base5<arg1_type, arg2_type, arg3_type, |
---|
| 774 | arg4_type, arg5_type, mt_policy> *> connections_list; |
---|
[9358] | 775 | |
---|
[9368] | 776 | _signal_base5() |
---|
| 777 | { |
---|
| 778 | ; |
---|
| 779 | } |
---|
| 780 | |
---|
| 781 | _signal_base5(const _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 782 | arg5_type, mt_policy>& s) |
---|
| 783 | : _signal_base<mt_policy>(s) |
---|
| 784 | { |
---|
| 785 | lock_block<mt_policy> lock(this); |
---|
| 786 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 787 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 788 | |
---|
| 789 | while(it != itEnd) |
---|
[9358] | 790 | { |
---|
[9368] | 791 | (*it)->getdest()->signal_connect(this); |
---|
| 792 | m_connected_slots.push_back((*it)->clone()); |
---|
| 793 | |
---|
| 794 | ++it; |
---|
[9358] | 795 | } |
---|
[9368] | 796 | } |
---|
[9358] | 797 | |
---|
[9368] | 798 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 799 | { |
---|
| 800 | lock_block<mt_policy> lock(this); |
---|
| 801 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 802 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 803 | |
---|
| 804 | while(it != itEnd) |
---|
[9358] | 805 | { |
---|
[9368] | 806 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 807 | { |
---|
[9368] | 808 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 809 | } |
---|
[9358] | 810 | |
---|
[9368] | 811 | ++it; |
---|
[9358] | 812 | } |
---|
[9368] | 813 | } |
---|
[9358] | 814 | |
---|
[9368] | 815 | ~_signal_base5() |
---|
| 816 | { |
---|
| 817 | disconnect_all(); |
---|
| 818 | } |
---|
[9358] | 819 | |
---|
[9368] | 820 | void disconnect_all() |
---|
| 821 | { |
---|
| 822 | lock_block<mt_policy> lock(this); |
---|
| 823 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 824 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 825 | |
---|
[9368] | 826 | while(it != itEnd) |
---|
| 827 | { |
---|
| 828 | (*it)->getdest()->signal_disconnect(this); |
---|
| 829 | delete *it; |
---|
[9358] | 830 | |
---|
[9368] | 831 | ++it; |
---|
[9358] | 832 | } |
---|
| 833 | |
---|
[9368] | 834 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 835 | } |
---|
| 836 | |
---|
| 837 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 838 | { |
---|
| 839 | lock_block<mt_policy> lock(this); |
---|
| 840 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 841 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 842 | |
---|
| 843 | while(it != itEnd) |
---|
[9358] | 844 | { |
---|
[9368] | 845 | if((*it)->getdest() == pclass) |
---|
[9358] | 846 | { |
---|
| 847 | delete *it; |
---|
[9368] | 848 | m_connected_slots.erase(it); |
---|
| 849 | pclass->signal_disconnect(this); |
---|
| 850 | return; |
---|
[9358] | 851 | } |
---|
| 852 | |
---|
[9368] | 853 | ++it; |
---|
[9358] | 854 | } |
---|
[9368] | 855 | } |
---|
[9358] | 856 | |
---|
[9368] | 857 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 858 | { |
---|
| 859 | lock_block<mt_policy> lock(this); |
---|
| 860 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 861 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 862 | |
---|
| 863 | while(it != itEnd) |
---|
[9358] | 864 | { |
---|
[9368] | 865 | typename connections_list::iterator itNext = it; |
---|
| 866 | ++itNext; |
---|
[9358] | 867 | |
---|
[9368] | 868 | if((*it)->getdest() == pslot) |
---|
[9358] | 869 | { |
---|
[9368] | 870 | m_connected_slots.erase(it); |
---|
[9390] | 871 | // delete *it; |
---|
[9358] | 872 | } |
---|
| 873 | |
---|
[9368] | 874 | it = itNext; |
---|
[9358] | 875 | } |
---|
[9368] | 876 | } |
---|
[9358] | 877 | |
---|
[9368] | 878 | protected: |
---|
| 879 | connections_list m_connected_slots; |
---|
[9358] | 880 | }; |
---|
| 881 | |
---|
| 882 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 883 | class arg5_type, class arg6_type, class mt_policy> |
---|
| 884 | class _signal_base6 : public _signal_base<mt_policy> |
---|
| 885 | { |
---|
[9368] | 886 | public: |
---|
| 887 | typedef std::list<_connection_base6<arg1_type, arg2_type, arg3_type, |
---|
| 888 | arg4_type, arg5_type, arg6_type, mt_policy> *> connections_list; |
---|
[9358] | 889 | |
---|
[9368] | 890 | _signal_base6() |
---|
| 891 | { |
---|
| 892 | ; |
---|
| 893 | } |
---|
| 894 | |
---|
| 895 | _signal_base6(const _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 896 | arg5_type, arg6_type, mt_policy>& s) |
---|
| 897 | : _signal_base<mt_policy>(s) |
---|
| 898 | { |
---|
| 899 | lock_block<mt_policy> lock(this); |
---|
| 900 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 901 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 902 | |
---|
| 903 | while(it != itEnd) |
---|
[9358] | 904 | { |
---|
[9368] | 905 | (*it)->getdest()->signal_connect(this); |
---|
| 906 | m_connected_slots.push_back((*it)->clone()); |
---|
| 907 | |
---|
| 908 | ++it; |
---|
[9358] | 909 | } |
---|
[9368] | 910 | } |
---|
[9358] | 911 | |
---|
[9368] | 912 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 913 | { |
---|
| 914 | lock_block<mt_policy> lock(this); |
---|
| 915 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 916 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 917 | |
---|
| 918 | while(it != itEnd) |
---|
[9358] | 919 | { |
---|
[9368] | 920 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 921 | { |
---|
[9368] | 922 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 923 | } |
---|
[9358] | 924 | |
---|
[9368] | 925 | ++it; |
---|
[9358] | 926 | } |
---|
[9368] | 927 | } |
---|
[9358] | 928 | |
---|
[9368] | 929 | ~_signal_base6() |
---|
| 930 | { |
---|
| 931 | disconnect_all(); |
---|
| 932 | } |
---|
[9358] | 933 | |
---|
[9368] | 934 | void disconnect_all() |
---|
| 935 | { |
---|
| 936 | lock_block<mt_policy> lock(this); |
---|
| 937 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 938 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 939 | |
---|
[9368] | 940 | while(it != itEnd) |
---|
| 941 | { |
---|
| 942 | (*it)->getdest()->signal_disconnect(this); |
---|
| 943 | delete *it; |
---|
[9358] | 944 | |
---|
[9368] | 945 | ++it; |
---|
[9358] | 946 | } |
---|
| 947 | |
---|
[9368] | 948 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 949 | } |
---|
| 950 | |
---|
| 951 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 952 | { |
---|
| 953 | lock_block<mt_policy> lock(this); |
---|
| 954 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 955 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 956 | |
---|
| 957 | while(it != itEnd) |
---|
[9358] | 958 | { |
---|
[9368] | 959 | if((*it)->getdest() == pclass) |
---|
[9358] | 960 | { |
---|
| 961 | delete *it; |
---|
[9368] | 962 | m_connected_slots.erase(it); |
---|
| 963 | pclass->signal_disconnect(this); |
---|
| 964 | return; |
---|
[9358] | 965 | } |
---|
| 966 | |
---|
[9368] | 967 | ++it; |
---|
[9358] | 968 | } |
---|
[9368] | 969 | } |
---|
[9358] | 970 | |
---|
[9368] | 971 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 972 | { |
---|
| 973 | lock_block<mt_policy> lock(this); |
---|
| 974 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 975 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 976 | |
---|
| 977 | while(it != itEnd) |
---|
[9358] | 978 | { |
---|
[9368] | 979 | typename connections_list::iterator itNext = it; |
---|
| 980 | ++itNext; |
---|
[9358] | 981 | |
---|
[9368] | 982 | if((*it)->getdest() == pslot) |
---|
[9358] | 983 | { |
---|
[9368] | 984 | m_connected_slots.erase(it); |
---|
[9390] | 985 | // delete *it; |
---|
[9358] | 986 | } |
---|
| 987 | |
---|
[9368] | 988 | it = itNext; |
---|
[9358] | 989 | } |
---|
[9368] | 990 | } |
---|
[9358] | 991 | |
---|
[9368] | 992 | protected: |
---|
| 993 | connections_list m_connected_slots; |
---|
[9358] | 994 | }; |
---|
| 995 | |
---|
| 996 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 997 | class arg5_type, class arg6_type, class arg7_type, class mt_policy> |
---|
| 998 | class _signal_base7 : public _signal_base<mt_policy> |
---|
| 999 | { |
---|
[9368] | 1000 | public: |
---|
| 1001 | typedef std::list<_connection_base7<arg1_type, arg2_type, arg3_type, |
---|
| 1002 | arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> *> connections_list; |
---|
[9358] | 1003 | |
---|
[9368] | 1004 | _signal_base7() |
---|
| 1005 | { |
---|
| 1006 | ; |
---|
| 1007 | } |
---|
| 1008 | |
---|
| 1009 | _signal_base7(const _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1010 | arg5_type, arg6_type, arg7_type, mt_policy>& s) |
---|
| 1011 | : _signal_base<mt_policy>(s) |
---|
| 1012 | { |
---|
| 1013 | lock_block<mt_policy> lock(this); |
---|
| 1014 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 1015 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 1016 | |
---|
| 1017 | while(it != itEnd) |
---|
[9358] | 1018 | { |
---|
[9368] | 1019 | (*it)->getdest()->signal_connect(this); |
---|
| 1020 | m_connected_slots.push_back((*it)->clone()); |
---|
| 1021 | |
---|
| 1022 | ++it; |
---|
[9358] | 1023 | } |
---|
[9368] | 1024 | } |
---|
[9358] | 1025 | |
---|
[9368] | 1026 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 1027 | { |
---|
| 1028 | lock_block<mt_policy> lock(this); |
---|
| 1029 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 1030 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 1031 | |
---|
| 1032 | while(it != itEnd) |
---|
[9358] | 1033 | { |
---|
[9368] | 1034 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 1035 | { |
---|
[9368] | 1036 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 1037 | } |
---|
[9358] | 1038 | |
---|
[9368] | 1039 | ++it; |
---|
[9358] | 1040 | } |
---|
[9368] | 1041 | } |
---|
[9358] | 1042 | |
---|
[9368] | 1043 | ~_signal_base7() |
---|
| 1044 | { |
---|
| 1045 | disconnect_all(); |
---|
| 1046 | } |
---|
[9358] | 1047 | |
---|
[9368] | 1048 | void disconnect_all() |
---|
| 1049 | { |
---|
| 1050 | lock_block<mt_policy> lock(this); |
---|
| 1051 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 1052 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 1053 | |
---|
[9368] | 1054 | while(it != itEnd) |
---|
| 1055 | { |
---|
| 1056 | (*it)->getdest()->signal_disconnect(this); |
---|
| 1057 | delete *it; |
---|
[9358] | 1058 | |
---|
[9368] | 1059 | ++it; |
---|
[9358] | 1060 | } |
---|
| 1061 | |
---|
[9368] | 1062 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 1063 | } |
---|
| 1064 | |
---|
| 1065 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 1066 | { |
---|
| 1067 | lock_block<mt_policy> lock(this); |
---|
| 1068 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 1069 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 1070 | |
---|
| 1071 | while(it != itEnd) |
---|
[9358] | 1072 | { |
---|
[9368] | 1073 | if((*it)->getdest() == pclass) |
---|
[9358] | 1074 | { |
---|
| 1075 | delete *it; |
---|
[9368] | 1076 | m_connected_slots.erase(it); |
---|
| 1077 | pclass->signal_disconnect(this); |
---|
| 1078 | return; |
---|
[9358] | 1079 | } |
---|
| 1080 | |
---|
[9368] | 1081 | ++it; |
---|
[9358] | 1082 | } |
---|
[9368] | 1083 | } |
---|
[9358] | 1084 | |
---|
[9368] | 1085 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 1086 | { |
---|
| 1087 | lock_block<mt_policy> lock(this); |
---|
| 1088 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 1089 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 1090 | |
---|
| 1091 | while(it != itEnd) |
---|
[9358] | 1092 | { |
---|
[9368] | 1093 | typename connections_list::iterator itNext = it; |
---|
| 1094 | ++itNext; |
---|
[9358] | 1095 | |
---|
[9368] | 1096 | if((*it)->getdest() == pslot) |
---|
[9358] | 1097 | { |
---|
[9368] | 1098 | m_connected_slots.erase(it); |
---|
[9390] | 1099 | // delete *it; |
---|
[9358] | 1100 | } |
---|
| 1101 | |
---|
[9368] | 1102 | it = itNext; |
---|
[9358] | 1103 | } |
---|
[9368] | 1104 | } |
---|
[9358] | 1105 | |
---|
[9368] | 1106 | protected: |
---|
| 1107 | connections_list m_connected_slots; |
---|
[9358] | 1108 | }; |
---|
| 1109 | |
---|
| 1110 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 1111 | class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy> |
---|
| 1112 | class _signal_base8 : public _signal_base<mt_policy> |
---|
| 1113 | { |
---|
[9368] | 1114 | public: |
---|
| 1115 | typedef std::list<_connection_base8<arg1_type, arg2_type, arg3_type, |
---|
| 1116 | arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> *> |
---|
| 1117 | connections_list; |
---|
[9358] | 1118 | |
---|
[9368] | 1119 | _signal_base8() |
---|
| 1120 | { |
---|
| 1121 | ; |
---|
| 1122 | } |
---|
| 1123 | |
---|
| 1124 | _signal_base8(const _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1125 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s) |
---|
| 1126 | : _signal_base<mt_policy>(s) |
---|
| 1127 | { |
---|
| 1128 | lock_block<mt_policy> lock(this); |
---|
| 1129 | typename connections_list::const_iterator it = s.m_connected_slots.begin(); |
---|
| 1130 | typename connections_list::const_iterator itEnd = s.m_connected_slots.end(); |
---|
| 1131 | |
---|
| 1132 | while(it != itEnd) |
---|
[9358] | 1133 | { |
---|
[9368] | 1134 | (*it)->getdest()->signal_connect(this); |
---|
| 1135 | m_connected_slots.push_back((*it)->clone()); |
---|
| 1136 | |
---|
| 1137 | ++it; |
---|
[9358] | 1138 | } |
---|
[9368] | 1139 | } |
---|
[9358] | 1140 | |
---|
[9368] | 1141 | void slot_duplicate(const has_slots<mt_policy>* oldtarget, has_slots<mt_policy>* newtarget) |
---|
| 1142 | { |
---|
| 1143 | lock_block<mt_policy> lock(this); |
---|
| 1144 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 1145 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 1146 | |
---|
| 1147 | while(it != itEnd) |
---|
[9358] | 1148 | { |
---|
[9368] | 1149 | if((*it)->getdest() == oldtarget) |
---|
[9358] | 1150 | { |
---|
[9368] | 1151 | m_connected_slots.push_back((*it)->duplicate(newtarget)); |
---|
| 1152 | } |
---|
[9358] | 1153 | |
---|
[9368] | 1154 | ++it; |
---|
[9358] | 1155 | } |
---|
[9368] | 1156 | } |
---|
[9358] | 1157 | |
---|
[9368] | 1158 | ~_signal_base8() |
---|
| 1159 | { |
---|
| 1160 | disconnect_all(); |
---|
| 1161 | } |
---|
[9358] | 1162 | |
---|
[9368] | 1163 | void disconnect_all() |
---|
| 1164 | { |
---|
| 1165 | lock_block<mt_policy> lock(this); |
---|
| 1166 | typename connections_list::const_iterator it = m_connected_slots.begin(); |
---|
| 1167 | typename connections_list::const_iterator itEnd = m_connected_slots.end(); |
---|
[9358] | 1168 | |
---|
[9368] | 1169 | while(it != itEnd) |
---|
| 1170 | { |
---|
| 1171 | (*it)->getdest()->signal_disconnect(this); |
---|
| 1172 | delete *it; |
---|
[9358] | 1173 | |
---|
[9368] | 1174 | ++it; |
---|
[9358] | 1175 | } |
---|
| 1176 | |
---|
[9368] | 1177 | m_connected_slots.erase(m_connected_slots.begin(), m_connected_slots.end()); |
---|
| 1178 | } |
---|
| 1179 | |
---|
| 1180 | void disconnect(has_slots<mt_policy>* pclass) |
---|
| 1181 | { |
---|
| 1182 | lock_block<mt_policy> lock(this); |
---|
| 1183 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 1184 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 1185 | |
---|
| 1186 | while(it != itEnd) |
---|
[9358] | 1187 | { |
---|
[9368] | 1188 | if((*it)->getdest() == pclass) |
---|
[9358] | 1189 | { |
---|
| 1190 | delete *it; |
---|
[9368] | 1191 | m_connected_slots.erase(it); |
---|
| 1192 | pclass->signal_disconnect(this); |
---|
| 1193 | return; |
---|
[9358] | 1194 | } |
---|
| 1195 | |
---|
[9368] | 1196 | ++it; |
---|
[9358] | 1197 | } |
---|
[9368] | 1198 | } |
---|
[9358] | 1199 | |
---|
[9368] | 1200 | void slot_disconnect(has_slots<mt_policy>* pslot) |
---|
| 1201 | { |
---|
| 1202 | lock_block<mt_policy> lock(this); |
---|
| 1203 | typename connections_list::iterator it = m_connected_slots.begin(); |
---|
| 1204 | typename connections_list::iterator itEnd = m_connected_slots.end(); |
---|
| 1205 | |
---|
| 1206 | while(it != itEnd) |
---|
[9358] | 1207 | { |
---|
[9368] | 1208 | typename connections_list::iterator itNext = it; |
---|
| 1209 | ++itNext; |
---|
[9358] | 1210 | |
---|
[9368] | 1211 | if((*it)->getdest() == pslot) |
---|
[9358] | 1212 | { |
---|
[9368] | 1213 | m_connected_slots.erase(it); |
---|
[9390] | 1214 | // delete *it; |
---|
[9358] | 1215 | } |
---|
| 1216 | |
---|
[9368] | 1217 | it = itNext; |
---|
[9358] | 1218 | } |
---|
[9368] | 1219 | } |
---|
[9358] | 1220 | |
---|
[9368] | 1221 | protected: |
---|
| 1222 | connections_list m_connected_slots; |
---|
[9358] | 1223 | }; |
---|
| 1224 | |
---|
| 1225 | |
---|
| 1226 | template<class dest_type, class mt_policy> |
---|
| 1227 | class _connection0 : public _connection_base0<mt_policy> |
---|
| 1228 | { |
---|
[9368] | 1229 | public: |
---|
| 1230 | _connection0() |
---|
| 1231 | { |
---|
| 1232 | m_pobject = NULL; |
---|
| 1233 | m_pmemfun = NULL; |
---|
| 1234 | } |
---|
[9358] | 1235 | |
---|
[9368] | 1236 | _connection0(dest_type* pobject, void (dest_type::*pmemfun)()) |
---|
| 1237 | { |
---|
| 1238 | m_pobject = pobject; |
---|
| 1239 | m_pmemfun = pmemfun; |
---|
| 1240 | } |
---|
[9358] | 1241 | |
---|
[9368] | 1242 | virtual _connection_base0<mt_policy>* clone() |
---|
| 1243 | { |
---|
| 1244 | return new _connection0<dest_type, mt_policy>(*this); |
---|
| 1245 | } |
---|
[9358] | 1246 | |
---|
[9368] | 1247 | virtual _connection_base0<mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1248 | { |
---|
[9369] | 1249 | return new _connection0<dest_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1250 | } |
---|
[9358] | 1251 | |
---|
[9368] | 1252 | virtual void emit() |
---|
| 1253 | { |
---|
| 1254 | (m_pobject->*m_pmemfun)(); |
---|
| 1255 | } |
---|
[9358] | 1256 | |
---|
[9368] | 1257 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1258 | { |
---|
| 1259 | return m_pobject; |
---|
| 1260 | } |
---|
[9358] | 1261 | |
---|
[9368] | 1262 | private: |
---|
| 1263 | dest_type* m_pobject; |
---|
| 1264 | void (dest_type::* m_pmemfun)(); |
---|
[9358] | 1265 | }; |
---|
| 1266 | |
---|
| 1267 | template<class dest_type, class arg1_type, class mt_policy> |
---|
| 1268 | class _connection1 : public _connection_base1<arg1_type, mt_policy> |
---|
| 1269 | { |
---|
[9368] | 1270 | public: |
---|
| 1271 | _connection1() |
---|
| 1272 | { |
---|
| 1273 | m_pobject = NULL; |
---|
| 1274 | m_pmemfun = NULL; |
---|
| 1275 | } |
---|
[9358] | 1276 | |
---|
[9368] | 1277 | _connection1(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type)) |
---|
| 1278 | { |
---|
| 1279 | m_pobject = pobject; |
---|
| 1280 | m_pmemfun = pmemfun; |
---|
| 1281 | } |
---|
[9358] | 1282 | |
---|
[9368] | 1283 | virtual _connection_base1<arg1_type, mt_policy>* clone() |
---|
| 1284 | { |
---|
| 1285 | return new _connection1<dest_type, arg1_type, mt_policy>(*this); |
---|
| 1286 | } |
---|
[9358] | 1287 | |
---|
[9368] | 1288 | virtual _connection_base1<arg1_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1289 | { |
---|
[9369] | 1290 | return new _connection1<dest_type, arg1_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1291 | } |
---|
[9358] | 1292 | |
---|
[9368] | 1293 | virtual void emit(arg1_type a1) |
---|
| 1294 | { |
---|
| 1295 | (m_pobject->*m_pmemfun)(a1); |
---|
| 1296 | } |
---|
[9358] | 1297 | |
---|
[9368] | 1298 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1299 | { |
---|
| 1300 | return m_pobject; |
---|
| 1301 | } |
---|
[9358] | 1302 | |
---|
[9368] | 1303 | private: |
---|
| 1304 | dest_type* m_pobject; |
---|
| 1305 | void (dest_type::* m_pmemfun)(arg1_type); |
---|
[9358] | 1306 | }; |
---|
| 1307 | |
---|
| 1308 | template<class dest_type, class arg1_type, class arg2_type, class mt_policy> |
---|
| 1309 | class _connection2 : public _connection_base2<arg1_type, arg2_type, mt_policy> |
---|
| 1310 | { |
---|
[9368] | 1311 | public: |
---|
| 1312 | _connection2() |
---|
| 1313 | { |
---|
| 1314 | m_pobject = NULL; |
---|
| 1315 | m_pmemfun = NULL; |
---|
| 1316 | } |
---|
[9358] | 1317 | |
---|
[9368] | 1318 | _connection2(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, |
---|
| 1319 | arg2_type)) |
---|
| 1320 | { |
---|
| 1321 | m_pobject = pobject; |
---|
| 1322 | m_pmemfun = pmemfun; |
---|
| 1323 | } |
---|
[9358] | 1324 | |
---|
[9368] | 1325 | virtual _connection_base2<arg1_type, arg2_type, mt_policy>* clone() |
---|
| 1326 | { |
---|
| 1327 | return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>(*this); |
---|
| 1328 | } |
---|
[9358] | 1329 | |
---|
[9368] | 1330 | virtual _connection_base2<arg1_type, arg2_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1331 | { |
---|
[9369] | 1332 | return new _connection2<dest_type, arg1_type, arg2_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1333 | } |
---|
[9358] | 1334 | |
---|
[9368] | 1335 | virtual void emit(arg1_type a1, arg2_type a2) |
---|
| 1336 | { |
---|
| 1337 | (m_pobject->*m_pmemfun)(a1, a2); |
---|
| 1338 | } |
---|
[9358] | 1339 | |
---|
[9368] | 1340 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1341 | { |
---|
| 1342 | return m_pobject; |
---|
| 1343 | } |
---|
[9358] | 1344 | |
---|
[9368] | 1345 | private: |
---|
| 1346 | dest_type* m_pobject; |
---|
| 1347 | void (dest_type::* m_pmemfun)(arg1_type, arg2_type); |
---|
[9358] | 1348 | }; |
---|
| 1349 | |
---|
| 1350 | template<class dest_type, class arg1_type, class arg2_type, class arg3_type, class mt_policy> |
---|
| 1351 | class _connection3 : public _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy> |
---|
| 1352 | { |
---|
[9368] | 1353 | public: |
---|
| 1354 | _connection3() |
---|
| 1355 | { |
---|
| 1356 | m_pobject = NULL; |
---|
| 1357 | m_pmemfun = NULL; |
---|
| 1358 | } |
---|
[9358] | 1359 | |
---|
[9368] | 1360 | _connection3(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, |
---|
| 1361 | arg2_type, arg3_type)) |
---|
| 1362 | { |
---|
| 1363 | m_pobject = pobject; |
---|
| 1364 | m_pmemfun = pmemfun; |
---|
| 1365 | } |
---|
[9358] | 1366 | |
---|
[9368] | 1367 | virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* clone() |
---|
| 1368 | { |
---|
| 1369 | return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>(*this); |
---|
| 1370 | } |
---|
[9358] | 1371 | |
---|
[9368] | 1372 | virtual _connection_base3<arg1_type, arg2_type, arg3_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1373 | { |
---|
[9369] | 1374 | return new _connection3<dest_type, arg1_type, arg2_type, arg3_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1375 | } |
---|
[9358] | 1376 | |
---|
[9368] | 1377 | virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3) |
---|
| 1378 | { |
---|
| 1379 | (m_pobject->*m_pmemfun)(a1, a2, a3); |
---|
| 1380 | } |
---|
[9358] | 1381 | |
---|
[9368] | 1382 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1383 | { |
---|
| 1384 | return m_pobject; |
---|
| 1385 | } |
---|
[9358] | 1386 | |
---|
[9368] | 1387 | private: |
---|
| 1388 | dest_type* m_pobject; |
---|
| 1389 | void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type); |
---|
[9358] | 1390 | }; |
---|
| 1391 | |
---|
| 1392 | template<class dest_type, class arg1_type, class arg2_type, class arg3_type, |
---|
| 1393 | class arg4_type, class mt_policy> |
---|
| 1394 | class _connection4 : public _connection_base4<arg1_type, arg2_type, |
---|
| 1395 | arg3_type, arg4_type, mt_policy> |
---|
| 1396 | { |
---|
[9368] | 1397 | public: |
---|
| 1398 | _connection4() |
---|
| 1399 | { |
---|
| 1400 | m_pobject = NULL; |
---|
| 1401 | m_pmemfun = NULL; |
---|
| 1402 | } |
---|
[9358] | 1403 | |
---|
[9368] | 1404 | _connection4(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, |
---|
| 1405 | arg2_type, arg3_type, arg4_type)) |
---|
| 1406 | { |
---|
| 1407 | m_pobject = pobject; |
---|
| 1408 | m_pmemfun = pmemfun; |
---|
| 1409 | } |
---|
[9358] | 1410 | |
---|
[9368] | 1411 | virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* clone() |
---|
| 1412 | { |
---|
| 1413 | return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(*this); |
---|
| 1414 | } |
---|
[9358] | 1415 | |
---|
[9368] | 1416 | virtual _connection_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1417 | { |
---|
[9369] | 1418 | return new _connection4<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1419 | } |
---|
[9358] | 1420 | |
---|
[9368] | 1421 | virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, |
---|
| 1422 | arg4_type a4) |
---|
| 1423 | { |
---|
| 1424 | (m_pobject->*m_pmemfun)(a1, a2, a3, a4); |
---|
| 1425 | } |
---|
[9358] | 1426 | |
---|
[9368] | 1427 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1428 | { |
---|
| 1429 | return m_pobject; |
---|
| 1430 | } |
---|
[9358] | 1431 | |
---|
[9368] | 1432 | private: |
---|
| 1433 | dest_type* m_pobject; |
---|
| 1434 | void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, |
---|
| 1435 | arg4_type); |
---|
[9358] | 1436 | }; |
---|
| 1437 | |
---|
| 1438 | template<class dest_type, class arg1_type, class arg2_type, class arg3_type, |
---|
| 1439 | class arg4_type, class arg5_type, class mt_policy> |
---|
| 1440 | class _connection5 : public _connection_base5<arg1_type, arg2_type, |
---|
| 1441 | arg3_type, arg4_type, arg5_type, mt_policy> |
---|
| 1442 | { |
---|
[9368] | 1443 | public: |
---|
| 1444 | _connection5() |
---|
| 1445 | { |
---|
| 1446 | m_pobject = NULL; |
---|
| 1447 | m_pmemfun = NULL; |
---|
| 1448 | } |
---|
[9358] | 1449 | |
---|
[9368] | 1450 | _connection5(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, |
---|
| 1451 | arg2_type, arg3_type, arg4_type, arg5_type)) |
---|
| 1452 | { |
---|
| 1453 | m_pobject = pobject; |
---|
| 1454 | m_pmemfun = pmemfun; |
---|
| 1455 | } |
---|
[9358] | 1456 | |
---|
[9368] | 1457 | virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1458 | arg5_type, mt_policy>* clone() |
---|
| 1459 | { |
---|
| 1460 | return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1461 | arg5_type, mt_policy>(*this); |
---|
| 1462 | } |
---|
[9358] | 1463 | |
---|
[9368] | 1464 | virtual _connection_base5<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1465 | arg5_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1466 | { |
---|
| 1467 | return new _connection5<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
[9369] | 1468 | arg5_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1469 | } |
---|
[9358] | 1470 | |
---|
[9368] | 1471 | virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 1472 | arg5_type a5) |
---|
| 1473 | { |
---|
| 1474 | (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5); |
---|
| 1475 | } |
---|
[9358] | 1476 | |
---|
[9368] | 1477 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1478 | { |
---|
| 1479 | return m_pobject; |
---|
| 1480 | } |
---|
[9358] | 1481 | |
---|
[9368] | 1482 | private: |
---|
| 1483 | dest_type* m_pobject; |
---|
| 1484 | void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1485 | arg5_type); |
---|
[9358] | 1486 | }; |
---|
| 1487 | |
---|
| 1488 | template<class dest_type, class arg1_type, class arg2_type, class arg3_type, |
---|
| 1489 | class arg4_type, class arg5_type, class arg6_type, class mt_policy> |
---|
| 1490 | class _connection6 : public _connection_base6<arg1_type, arg2_type, |
---|
| 1491 | arg3_type, arg4_type, arg5_type, arg6_type, mt_policy> |
---|
| 1492 | { |
---|
[9368] | 1493 | public: |
---|
| 1494 | _connection6() |
---|
| 1495 | { |
---|
| 1496 | m_pobject = NULL; |
---|
| 1497 | m_pmemfun = NULL; |
---|
| 1498 | } |
---|
[9358] | 1499 | |
---|
[9368] | 1500 | _connection6(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, |
---|
| 1501 | arg2_type, arg3_type, arg4_type, arg5_type, arg6_type)) |
---|
| 1502 | { |
---|
| 1503 | m_pobject = pobject; |
---|
| 1504 | m_pmemfun = pmemfun; |
---|
| 1505 | } |
---|
[9358] | 1506 | |
---|
[9368] | 1507 | virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1508 | arg5_type, arg6_type, mt_policy>* clone() |
---|
| 1509 | { |
---|
| 1510 | return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1511 | arg5_type, arg6_type, mt_policy>(*this); |
---|
| 1512 | } |
---|
[9358] | 1513 | |
---|
[9368] | 1514 | virtual _connection_base6<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1515 | arg5_type, arg6_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1516 | { |
---|
| 1517 | return new _connection6<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
[9369] | 1518 | arg5_type, arg6_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1519 | } |
---|
[9358] | 1520 | |
---|
[9368] | 1521 | virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 1522 | arg5_type a5, arg6_type a6) |
---|
| 1523 | { |
---|
| 1524 | (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6); |
---|
| 1525 | } |
---|
[9358] | 1526 | |
---|
[9368] | 1527 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1528 | { |
---|
| 1529 | return m_pobject; |
---|
| 1530 | } |
---|
[9358] | 1531 | |
---|
[9368] | 1532 | private: |
---|
| 1533 | dest_type* m_pobject; |
---|
| 1534 | void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1535 | arg5_type, arg6_type); |
---|
[9358] | 1536 | }; |
---|
| 1537 | |
---|
| 1538 | template<class dest_type, class arg1_type, class arg2_type, class arg3_type, |
---|
| 1539 | class arg4_type, class arg5_type, class arg6_type, class arg7_type, class mt_policy> |
---|
| 1540 | class _connection7 : public _connection_base7<arg1_type, arg2_type, |
---|
| 1541 | arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> |
---|
| 1542 | { |
---|
[9368] | 1543 | public: |
---|
| 1544 | _connection7() |
---|
| 1545 | { |
---|
| 1546 | m_pobject = NULL; |
---|
| 1547 | m_pmemfun = NULL; |
---|
| 1548 | } |
---|
[9358] | 1549 | |
---|
[9368] | 1550 | _connection7(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, |
---|
| 1551 | arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type)) |
---|
| 1552 | { |
---|
| 1553 | m_pobject = pobject; |
---|
| 1554 | m_pmemfun = pmemfun; |
---|
| 1555 | } |
---|
[9358] | 1556 | |
---|
[9368] | 1557 | virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1558 | arg5_type, arg6_type, arg7_type, mt_policy>* clone() |
---|
| 1559 | { |
---|
| 1560 | return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1561 | arg5_type, arg6_type, arg7_type, mt_policy>(*this); |
---|
| 1562 | } |
---|
[9358] | 1563 | |
---|
[9368] | 1564 | virtual _connection_base7<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1565 | arg5_type, arg6_type, arg7_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1566 | { |
---|
| 1567 | return new _connection7<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
[9369] | 1568 | arg5_type, arg6_type, arg7_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1569 | } |
---|
[9358] | 1570 | |
---|
[9368] | 1571 | virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 1572 | arg5_type a5, arg6_type a6, arg7_type a7) |
---|
| 1573 | { |
---|
| 1574 | (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7); |
---|
| 1575 | } |
---|
[9358] | 1576 | |
---|
[9368] | 1577 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1578 | { |
---|
| 1579 | return m_pobject; |
---|
| 1580 | } |
---|
[9358] | 1581 | |
---|
[9368] | 1582 | private: |
---|
| 1583 | dest_type* m_pobject; |
---|
| 1584 | void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1585 | arg5_type, arg6_type, arg7_type); |
---|
[9358] | 1586 | }; |
---|
| 1587 | |
---|
| 1588 | template<class dest_type, class arg1_type, class arg2_type, class arg3_type, |
---|
| 1589 | class arg4_type, class arg5_type, class arg6_type, class arg7_type, |
---|
| 1590 | class arg8_type, class mt_policy> |
---|
| 1591 | class _connection8 : public _connection_base8<arg1_type, arg2_type, |
---|
| 1592 | arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> |
---|
| 1593 | { |
---|
[9368] | 1594 | public: |
---|
| 1595 | _connection8() |
---|
| 1596 | { |
---|
| 1597 | m_pobject = NULL; |
---|
| 1598 | m_pmemfun = NULL; |
---|
| 1599 | } |
---|
[9358] | 1600 | |
---|
[9368] | 1601 | _connection8(dest_type* pobject, void (dest_type::*pmemfun)(arg1_type, |
---|
| 1602 | arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, |
---|
| 1603 | arg7_type, arg8_type)) |
---|
| 1604 | { |
---|
| 1605 | m_pobject = pobject; |
---|
| 1606 | m_pmemfun = pmemfun; |
---|
| 1607 | } |
---|
[9358] | 1608 | |
---|
[9368] | 1609 | virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1610 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* clone() |
---|
| 1611 | { |
---|
| 1612 | return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1613 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(*this); |
---|
| 1614 | } |
---|
[9358] | 1615 | |
---|
[9368] | 1616 | virtual _connection_base8<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1617 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* duplicate(has_slots<mt_policy>* pnewdest) |
---|
| 1618 | { |
---|
| 1619 | return new _connection8<dest_type, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
[9369] | 1620 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(dynamic_cast<dest_type*>(pnewdest), m_pmemfun); |
---|
[9368] | 1621 | } |
---|
[9358] | 1622 | |
---|
[9368] | 1623 | virtual void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 1624 | arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) |
---|
| 1625 | { |
---|
| 1626 | (m_pobject->*m_pmemfun)(a1, a2, a3, a4, a5, a6, a7, a8); |
---|
| 1627 | } |
---|
[9358] | 1628 | |
---|
[9368] | 1629 | virtual has_slots<mt_policy>* getdest() const |
---|
| 1630 | { |
---|
| 1631 | return m_pobject; |
---|
| 1632 | } |
---|
[9358] | 1633 | |
---|
[9368] | 1634 | private: |
---|
| 1635 | dest_type* m_pobject; |
---|
| 1636 | void (dest_type::* m_pmemfun)(arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1637 | arg5_type, arg6_type, arg7_type, arg8_type); |
---|
[9358] | 1638 | }; |
---|
| 1639 | |
---|
| 1640 | template<class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 1641 | class signal0 : public _signal_base0<mt_policy> |
---|
| 1642 | { |
---|
[9368] | 1643 | public: |
---|
| 1644 | signal0() |
---|
| 1645 | { |
---|
| 1646 | ; |
---|
| 1647 | } |
---|
[9358] | 1648 | |
---|
[9368] | 1649 | signal0(const signal0<mt_policy>& s) |
---|
| 1650 | : _signal_base0<mt_policy>(s) |
---|
| 1651 | { |
---|
| 1652 | ; |
---|
| 1653 | } |
---|
[9358] | 1654 | |
---|
[9368] | 1655 | template<class desttype> |
---|
| 1656 | void connect(desttype* pclass, void (desttype::*pmemfun)()) |
---|
| 1657 | { |
---|
| 1658 | lock_block<mt_policy> lock(this); |
---|
| 1659 | _connection0<desttype, mt_policy>* conn = |
---|
| 1660 | new _connection0<desttype, mt_policy>(pclass, pmemfun); |
---|
| 1661 | this->m_connected_slots.push_back(conn); |
---|
| 1662 | pclass->signal_connect(this); |
---|
| 1663 | } |
---|
[9358] | 1664 | |
---|
[9368] | 1665 | void emit() |
---|
| 1666 | { |
---|
| 1667 | lock_block<mt_policy> lock(this); |
---|
| 1668 | typename _signal_base0<mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1669 | typename _signal_base0<mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1670 | |
---|
| 1671 | while(it != itEnd) |
---|
[9358] | 1672 | { |
---|
[9368] | 1673 | itNext = it; |
---|
| 1674 | ++itNext; |
---|
[9358] | 1675 | |
---|
[9368] | 1676 | (*it)->emit(); |
---|
[9358] | 1677 | |
---|
[9368] | 1678 | it = itNext; |
---|
[9358] | 1679 | } |
---|
[9368] | 1680 | } |
---|
[9358] | 1681 | |
---|
[9368] | 1682 | void operator()() |
---|
| 1683 | { |
---|
| 1684 | lock_block<mt_policy> lock(this); |
---|
| 1685 | typename _signal_base0<mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1686 | typename _signal_base0<mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1687 | |
---|
| 1688 | while(it != itEnd) |
---|
[9358] | 1689 | { |
---|
[9368] | 1690 | itNext = it; |
---|
| 1691 | ++itNext; |
---|
[9358] | 1692 | |
---|
[9368] | 1693 | (*it)->emit(); |
---|
[9358] | 1694 | |
---|
[9368] | 1695 | it = itNext; |
---|
[9358] | 1696 | } |
---|
[9368] | 1697 | } |
---|
[9358] | 1698 | }; |
---|
| 1699 | |
---|
| 1700 | template<class arg1_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 1701 | class signal1 : public _signal_base1<arg1_type, mt_policy> |
---|
| 1702 | { |
---|
[9368] | 1703 | public: |
---|
| 1704 | signal1() |
---|
| 1705 | { |
---|
| 1706 | ; |
---|
| 1707 | } |
---|
[9358] | 1708 | |
---|
[9368] | 1709 | signal1(const signal1<arg1_type, mt_policy>& s) |
---|
| 1710 | : _signal_base1<arg1_type, mt_policy>(s) |
---|
| 1711 | { |
---|
| 1712 | ; |
---|
| 1713 | } |
---|
[9358] | 1714 | |
---|
[9368] | 1715 | template<class desttype> |
---|
| 1716 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type)) |
---|
| 1717 | { |
---|
| 1718 | lock_block<mt_policy> lock(this); |
---|
| 1719 | _connection1<desttype, arg1_type, mt_policy>* conn = |
---|
| 1720 | new _connection1<desttype, arg1_type, mt_policy>(pclass, pmemfun); |
---|
| 1721 | this->m_connected_slots.push_back(conn); |
---|
| 1722 | pclass->signal_connect(this); |
---|
| 1723 | } |
---|
[9358] | 1724 | |
---|
[9368] | 1725 | void emit(arg1_type a1) |
---|
| 1726 | { |
---|
| 1727 | lock_block<mt_policy> lock(this); |
---|
| 1728 | typename _signal_base1<arg1_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1729 | typename _signal_base1<arg1_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1730 | |
---|
| 1731 | while(it != itEnd) |
---|
[9358] | 1732 | { |
---|
[9368] | 1733 | itNext = it; |
---|
| 1734 | ++itNext; |
---|
[9358] | 1735 | |
---|
[9368] | 1736 | (*it)->emit(a1); |
---|
[9358] | 1737 | |
---|
[9368] | 1738 | it = itNext; |
---|
[9358] | 1739 | } |
---|
[9368] | 1740 | } |
---|
[9358] | 1741 | |
---|
[9368] | 1742 | void operator()(arg1_type a1) |
---|
| 1743 | { |
---|
| 1744 | lock_block<mt_policy> lock(this); |
---|
| 1745 | typename _signal_base1<arg1_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1746 | typename _signal_base1<arg1_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1747 | |
---|
| 1748 | while(it != itEnd) |
---|
[9358] | 1749 | { |
---|
[9368] | 1750 | itNext = it; |
---|
| 1751 | ++itNext; |
---|
[9358] | 1752 | |
---|
[9368] | 1753 | (*it)->emit(a1); |
---|
[9358] | 1754 | |
---|
[9368] | 1755 | it = itNext; |
---|
[9358] | 1756 | } |
---|
[9368] | 1757 | } |
---|
[9358] | 1758 | }; |
---|
| 1759 | |
---|
| 1760 | template<class arg1_type, class arg2_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 1761 | class signal2 : public _signal_base2<arg1_type, arg2_type, mt_policy> |
---|
| 1762 | { |
---|
[9368] | 1763 | public: |
---|
| 1764 | signal2() |
---|
| 1765 | { |
---|
| 1766 | ; |
---|
| 1767 | } |
---|
[9358] | 1768 | |
---|
[9368] | 1769 | signal2(const signal2<arg1_type, arg2_type, mt_policy>& s) |
---|
| 1770 | : _signal_base2<arg1_type, arg2_type, mt_policy>(s) |
---|
| 1771 | { |
---|
| 1772 | ; |
---|
| 1773 | } |
---|
[9358] | 1774 | |
---|
[9368] | 1775 | template<class desttype> |
---|
| 1776 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, |
---|
| 1777 | arg2_type)) |
---|
| 1778 | { |
---|
| 1779 | lock_block<mt_policy> lock(this); |
---|
| 1780 | _connection2<desttype, arg1_type, arg2_type, mt_policy>* conn = new |
---|
| 1781 | _connection2<desttype, arg1_type, arg2_type, mt_policy>(pclass, pmemfun); |
---|
| 1782 | this->m_connected_slots.push_back(conn); |
---|
| 1783 | pclass->signal_connect(this); |
---|
| 1784 | } |
---|
[9358] | 1785 | |
---|
[9368] | 1786 | void emit(arg1_type a1, arg2_type a2) |
---|
| 1787 | { |
---|
| 1788 | lock_block<mt_policy> lock(this); |
---|
| 1789 | typename _signal_base2<arg1_type, arg2_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1790 | typename _signal_base2<arg1_type, arg2_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1791 | |
---|
| 1792 | while(it != itEnd) |
---|
[9358] | 1793 | { |
---|
[9368] | 1794 | itNext = it; |
---|
| 1795 | ++itNext; |
---|
[9358] | 1796 | |
---|
[9368] | 1797 | (*it)->emit(a1, a2); |
---|
[9358] | 1798 | |
---|
[9368] | 1799 | it = itNext; |
---|
[9358] | 1800 | } |
---|
[9368] | 1801 | } |
---|
[9358] | 1802 | |
---|
[9368] | 1803 | void operator()(arg1_type a1, arg2_type a2) |
---|
| 1804 | { |
---|
| 1805 | lock_block<mt_policy> lock(this); |
---|
| 1806 | typename _signal_base2<arg1_type, arg2_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1807 | typename _signal_base2<arg1_type, arg2_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1808 | |
---|
| 1809 | while(it != itEnd) |
---|
[9358] | 1810 | { |
---|
[9368] | 1811 | itNext = it; |
---|
| 1812 | ++itNext; |
---|
[9358] | 1813 | |
---|
[9368] | 1814 | (*it)->emit(a1, a2); |
---|
[9358] | 1815 | |
---|
[9368] | 1816 | it = itNext; |
---|
[9358] | 1817 | } |
---|
[9368] | 1818 | } |
---|
[9358] | 1819 | }; |
---|
| 1820 | |
---|
| 1821 | template<class arg1_type, class arg2_type, class arg3_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 1822 | class signal3 : public _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy> |
---|
| 1823 | { |
---|
[9368] | 1824 | public: |
---|
| 1825 | signal3() |
---|
| 1826 | { |
---|
| 1827 | ; |
---|
| 1828 | } |
---|
[9358] | 1829 | |
---|
[9368] | 1830 | signal3(const signal3<arg1_type, arg2_type, arg3_type, mt_policy>& s) |
---|
| 1831 | : _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>(s) |
---|
| 1832 | { |
---|
| 1833 | ; |
---|
| 1834 | } |
---|
[9358] | 1835 | |
---|
[9368] | 1836 | template<class desttype> |
---|
| 1837 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, |
---|
| 1838 | arg2_type, arg3_type)) |
---|
| 1839 | { |
---|
| 1840 | lock_block<mt_policy> lock(this); |
---|
| 1841 | _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>* conn = |
---|
| 1842 | new _connection3<desttype, arg1_type, arg2_type, arg3_type, mt_policy>(pclass, |
---|
| 1843 | pmemfun); |
---|
| 1844 | this->m_connected_slots.push_back(conn); |
---|
| 1845 | pclass->signal_connect(this); |
---|
| 1846 | } |
---|
[9358] | 1847 | |
---|
[9368] | 1848 | void emit(arg1_type a1, arg2_type a2, arg3_type a3) |
---|
| 1849 | { |
---|
| 1850 | lock_block<mt_policy> lock(this); |
---|
| 1851 | typename _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1852 | typename _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1853 | |
---|
| 1854 | while(it != itEnd) |
---|
[9358] | 1855 | { |
---|
[9368] | 1856 | itNext = it; |
---|
| 1857 | ++itNext; |
---|
[9358] | 1858 | |
---|
[9368] | 1859 | (*it)->emit(a1, a2, a3); |
---|
[9358] | 1860 | |
---|
[9368] | 1861 | it = itNext; |
---|
[9358] | 1862 | } |
---|
[9368] | 1863 | } |
---|
[9358] | 1864 | |
---|
[9368] | 1865 | void operator()(arg1_type a1, arg2_type a2, arg3_type a3) |
---|
| 1866 | { |
---|
| 1867 | lock_block<mt_policy> lock(this); |
---|
| 1868 | typename _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1869 | typename _signal_base3<arg1_type, arg2_type, arg3_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1870 | |
---|
| 1871 | while(it != itEnd) |
---|
[9358] | 1872 | { |
---|
[9368] | 1873 | itNext = it; |
---|
| 1874 | ++itNext; |
---|
[9358] | 1875 | |
---|
[9368] | 1876 | (*it)->emit(a1, a2, a3); |
---|
[9358] | 1877 | |
---|
[9368] | 1878 | it = itNext; |
---|
[9358] | 1879 | } |
---|
[9368] | 1880 | } |
---|
[9358] | 1881 | }; |
---|
| 1882 | |
---|
| 1883 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 1884 | class signal4 : public _signal_base4<arg1_type, arg2_type, arg3_type, |
---|
| 1885 | arg4_type, mt_policy> |
---|
| 1886 | { |
---|
[9368] | 1887 | public: |
---|
| 1888 | signal4() |
---|
| 1889 | { |
---|
| 1890 | ; |
---|
| 1891 | } |
---|
[9358] | 1892 | |
---|
[9368] | 1893 | signal4(const signal4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>& s) |
---|
| 1894 | : _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>(s) |
---|
| 1895 | { |
---|
| 1896 | ; |
---|
| 1897 | } |
---|
[9358] | 1898 | |
---|
[9368] | 1899 | template<class desttype> |
---|
| 1900 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, |
---|
| 1901 | arg2_type, arg3_type, arg4_type)) |
---|
| 1902 | { |
---|
| 1903 | lock_block<mt_policy> lock(this); |
---|
| 1904 | _connection4<desttype, arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>* |
---|
| 1905 | conn = new _connection4<desttype, arg1_type, arg2_type, arg3_type, |
---|
| 1906 | arg4_type, mt_policy>(pclass, pmemfun); |
---|
| 1907 | this->m_connected_slots.push_back(conn); |
---|
| 1908 | pclass->signal_connect(this); |
---|
| 1909 | } |
---|
[9358] | 1910 | |
---|
[9368] | 1911 | void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) |
---|
| 1912 | { |
---|
| 1913 | lock_block<mt_policy> lock(this); |
---|
| 1914 | typename _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1915 | typename _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1916 | |
---|
| 1917 | while(it != itEnd) |
---|
[9358] | 1918 | { |
---|
[9368] | 1919 | itNext = it; |
---|
| 1920 | ++itNext; |
---|
[9358] | 1921 | |
---|
[9368] | 1922 | (*it)->emit(a1, a2, a3, a4); |
---|
[9358] | 1923 | |
---|
[9368] | 1924 | it = itNext; |
---|
[9358] | 1925 | } |
---|
[9368] | 1926 | } |
---|
[9358] | 1927 | |
---|
[9368] | 1928 | void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4) |
---|
| 1929 | { |
---|
| 1930 | lock_block<mt_policy> lock(this); |
---|
| 1931 | typename _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1932 | typename _signal_base4<arg1_type, arg2_type, arg3_type, arg4_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1933 | |
---|
| 1934 | while(it != itEnd) |
---|
[9358] | 1935 | { |
---|
[9368] | 1936 | itNext = it; |
---|
| 1937 | ++itNext; |
---|
[9358] | 1938 | |
---|
[9368] | 1939 | (*it)->emit(a1, a2, a3, a4); |
---|
[9358] | 1940 | |
---|
[9368] | 1941 | it = itNext; |
---|
[9358] | 1942 | } |
---|
[9368] | 1943 | } |
---|
[9358] | 1944 | }; |
---|
| 1945 | |
---|
| 1946 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 1947 | class arg5_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 1948 | class signal5 : public _signal_base5<arg1_type, arg2_type, arg3_type, |
---|
| 1949 | arg4_type, arg5_type, mt_policy> |
---|
| 1950 | { |
---|
[9368] | 1951 | public: |
---|
| 1952 | signal5() |
---|
| 1953 | { |
---|
| 1954 | ; |
---|
| 1955 | } |
---|
[9358] | 1956 | |
---|
[9368] | 1957 | signal5(const signal5<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1958 | arg5_type, mt_policy>& s) |
---|
| 1959 | : _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1960 | arg5_type, mt_policy>(s) |
---|
| 1961 | { |
---|
| 1962 | ; |
---|
| 1963 | } |
---|
[9358] | 1964 | |
---|
[9368] | 1965 | template<class desttype> |
---|
| 1966 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, |
---|
| 1967 | arg2_type, arg3_type, arg4_type, arg5_type)) |
---|
| 1968 | { |
---|
| 1969 | lock_block<mt_policy> lock(this); |
---|
| 1970 | _connection5<desttype, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 1971 | arg5_type, mt_policy>* conn = new _connection5<desttype, arg1_type, arg2_type, |
---|
| 1972 | arg3_type, arg4_type, arg5_type, mt_policy>(pclass, pmemfun); |
---|
| 1973 | this->m_connected_slots.push_back(conn); |
---|
| 1974 | pclass->signal_connect(this); |
---|
| 1975 | } |
---|
[9358] | 1976 | |
---|
[9368] | 1977 | void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 1978 | arg5_type a5) |
---|
| 1979 | { |
---|
| 1980 | lock_block<mt_policy> lock(this); |
---|
| 1981 | typename _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 1982 | typename _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 1983 | |
---|
| 1984 | while(it != itEnd) |
---|
[9358] | 1985 | { |
---|
[9368] | 1986 | itNext = it; |
---|
| 1987 | ++itNext; |
---|
[9358] | 1988 | |
---|
[9368] | 1989 | (*it)->emit(a1, a2, a3, a4, a5); |
---|
[9358] | 1990 | |
---|
[9368] | 1991 | it = itNext; |
---|
[9358] | 1992 | } |
---|
[9368] | 1993 | } |
---|
[9358] | 1994 | |
---|
[9368] | 1995 | void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 1996 | arg5_type a5) |
---|
| 1997 | { |
---|
| 1998 | lock_block<mt_policy> lock(this); |
---|
| 1999 | typename _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 2000 | typename _signal_base5<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 2001 | |
---|
| 2002 | while(it != itEnd) |
---|
[9358] | 2003 | { |
---|
[9368] | 2004 | itNext = it; |
---|
| 2005 | ++itNext; |
---|
[9358] | 2006 | |
---|
[9368] | 2007 | (*it)->emit(a1, a2, a3, a4, a5); |
---|
[9358] | 2008 | |
---|
[9368] | 2009 | it = itNext; |
---|
[9358] | 2010 | } |
---|
[9368] | 2011 | } |
---|
[9358] | 2012 | }; |
---|
| 2013 | |
---|
| 2014 | |
---|
| 2015 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 2016 | class arg5_type, class arg6_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 2017 | class signal6 : public _signal_base6<arg1_type, arg2_type, arg3_type, |
---|
| 2018 | arg4_type, arg5_type, arg6_type, mt_policy> |
---|
| 2019 | { |
---|
[9368] | 2020 | public: |
---|
| 2021 | signal6() |
---|
| 2022 | { |
---|
| 2023 | ; |
---|
| 2024 | } |
---|
[9358] | 2025 | |
---|
[9368] | 2026 | signal6(const signal6<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2027 | arg5_type, arg6_type, mt_policy>& s) |
---|
| 2028 | : _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2029 | arg5_type, arg6_type, mt_policy>(s) |
---|
| 2030 | { |
---|
| 2031 | ; |
---|
| 2032 | } |
---|
[9358] | 2033 | |
---|
[9368] | 2034 | template<class desttype> |
---|
| 2035 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, |
---|
| 2036 | arg2_type, arg3_type, arg4_type, arg5_type, arg6_type)) |
---|
| 2037 | { |
---|
| 2038 | lock_block<mt_policy> lock(this); |
---|
| 2039 | _connection6<desttype, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2040 | arg5_type, arg6_type, mt_policy>* conn = |
---|
| 2041 | new _connection6<desttype, arg1_type, arg2_type, arg3_type, |
---|
| 2042 | arg4_type, arg5_type, arg6_type, mt_policy>(pclass, pmemfun); |
---|
| 2043 | this->m_connected_slots.push_back(conn); |
---|
| 2044 | pclass->signal_connect(this); |
---|
| 2045 | } |
---|
[9358] | 2046 | |
---|
[9368] | 2047 | void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 2048 | arg5_type a5, arg6_type a6) |
---|
| 2049 | { |
---|
| 2050 | lock_block<mt_policy> lock(this); |
---|
| 2051 | typename _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 2052 | typename _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 2053 | |
---|
| 2054 | while(it != itEnd) |
---|
[9358] | 2055 | { |
---|
[9368] | 2056 | itNext = it; |
---|
| 2057 | ++itNext; |
---|
[9358] | 2058 | |
---|
[9368] | 2059 | (*it)->emit(a1, a2, a3, a4, a5, a6); |
---|
[9358] | 2060 | |
---|
[9368] | 2061 | it = itNext; |
---|
[9358] | 2062 | } |
---|
[9368] | 2063 | } |
---|
[9358] | 2064 | |
---|
[9368] | 2065 | void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 2066 | arg5_type a5, arg6_type a6) |
---|
| 2067 | { |
---|
| 2068 | lock_block<mt_policy> lock(this); |
---|
| 2069 | typename _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 2070 | typename _signal_base6<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 2071 | |
---|
| 2072 | while(it != itEnd) |
---|
[9358] | 2073 | { |
---|
[9368] | 2074 | itNext = it; |
---|
| 2075 | ++itNext; |
---|
[9358] | 2076 | |
---|
[9368] | 2077 | (*it)->emit(a1, a2, a3, a4, a5, a6); |
---|
[9358] | 2078 | |
---|
[9368] | 2079 | it = itNext; |
---|
[9358] | 2080 | } |
---|
[9368] | 2081 | } |
---|
[9358] | 2082 | }; |
---|
| 2083 | |
---|
| 2084 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 2085 | class arg5_type, class arg6_type, class arg7_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 2086 | class signal7 : public _signal_base7<arg1_type, arg2_type, arg3_type, |
---|
| 2087 | arg4_type, arg5_type, arg6_type, arg7_type, mt_policy> |
---|
| 2088 | { |
---|
[9368] | 2089 | public: |
---|
| 2090 | signal7() |
---|
| 2091 | { |
---|
| 2092 | ; |
---|
| 2093 | } |
---|
[9358] | 2094 | |
---|
[9368] | 2095 | signal7(const signal7<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2096 | arg5_type, arg6_type, arg7_type, mt_policy>& s) |
---|
| 2097 | : _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2098 | arg5_type, arg6_type, arg7_type, mt_policy>(s) |
---|
| 2099 | { |
---|
| 2100 | ; |
---|
| 2101 | } |
---|
[9358] | 2102 | |
---|
[9368] | 2103 | template<class desttype> |
---|
| 2104 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, |
---|
| 2105 | arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, |
---|
| 2106 | arg7_type)) |
---|
| 2107 | { |
---|
| 2108 | lock_block<mt_policy> lock(this); |
---|
| 2109 | _connection7<desttype, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2110 | arg5_type, arg6_type, arg7_type, mt_policy>* conn = |
---|
| 2111 | new _connection7<desttype, arg1_type, arg2_type, arg3_type, |
---|
| 2112 | arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>(pclass, pmemfun); |
---|
| 2113 | this->m_connected_slots.push_back(conn); |
---|
| 2114 | pclass->signal_connect(this); |
---|
| 2115 | } |
---|
[9358] | 2116 | |
---|
[9368] | 2117 | void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 2118 | arg5_type a5, arg6_type a6, arg7_type a7) |
---|
| 2119 | { |
---|
| 2120 | lock_block<mt_policy> lock(this); |
---|
| 2121 | typename _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 2122 | typename _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 2123 | |
---|
| 2124 | while(it != itEnd) |
---|
[9358] | 2125 | { |
---|
[9368] | 2126 | itNext = it; |
---|
| 2127 | ++itNext; |
---|
[9358] | 2128 | |
---|
[9368] | 2129 | (*it)->emit(a1, a2, a3, a4, a5, a6, a7); |
---|
[9358] | 2130 | |
---|
[9368] | 2131 | it = itNext; |
---|
[9358] | 2132 | } |
---|
[9368] | 2133 | } |
---|
[9358] | 2134 | |
---|
[9368] | 2135 | void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 2136 | arg5_type a5, arg6_type a6, arg7_type a7) |
---|
| 2137 | { |
---|
| 2138 | lock_block<mt_policy> lock(this); |
---|
| 2139 | typename _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 2140 | typename _signal_base7<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 2141 | |
---|
| 2142 | while(it != itEnd) |
---|
[9358] | 2143 | { |
---|
[9368] | 2144 | itNext = it; |
---|
| 2145 | ++itNext; |
---|
[9358] | 2146 | |
---|
[9368] | 2147 | (*it)->emit(a1, a2, a3, a4, a5, a6, a7); |
---|
[9358] | 2148 | |
---|
[9368] | 2149 | it = itNext; |
---|
[9358] | 2150 | } |
---|
[9368] | 2151 | } |
---|
[9358] | 2152 | }; |
---|
| 2153 | |
---|
| 2154 | template<class arg1_type, class arg2_type, class arg3_type, class arg4_type, |
---|
| 2155 | class arg5_type, class arg6_type, class arg7_type, class arg8_type, class mt_policy = SIGSLOT_DEFAULT_MT_POLICY> |
---|
| 2156 | class signal8 : public _signal_base8<arg1_type, arg2_type, arg3_type, |
---|
| 2157 | arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy> |
---|
| 2158 | { |
---|
[9368] | 2159 | public: |
---|
| 2160 | signal8() |
---|
| 2161 | { |
---|
| 2162 | ; |
---|
| 2163 | } |
---|
[9358] | 2164 | |
---|
[9368] | 2165 | signal8(const signal8<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2166 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>& s) |
---|
| 2167 | : _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2168 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>(s) |
---|
| 2169 | { |
---|
| 2170 | ; |
---|
| 2171 | } |
---|
[9358] | 2172 | |
---|
[9368] | 2173 | template<class desttype> |
---|
| 2174 | void connect(desttype* pclass, void (desttype::*pmemfun)(arg1_type, |
---|
| 2175 | arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, |
---|
| 2176 | arg7_type, arg8_type)) |
---|
| 2177 | { |
---|
| 2178 | lock_block<mt_policy> lock(this); |
---|
| 2179 | _connection8<desttype, arg1_type, arg2_type, arg3_type, arg4_type, |
---|
| 2180 | arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>* conn = |
---|
| 2181 | new _connection8<desttype, arg1_type, arg2_type, arg3_type, |
---|
| 2182 | arg4_type, arg5_type, arg6_type, arg7_type, |
---|
| 2183 | arg8_type, mt_policy>(pclass, pmemfun); |
---|
| 2184 | this->m_connected_slots.push_back(conn); |
---|
| 2185 | pclass->signal_connect(this); |
---|
| 2186 | } |
---|
[9358] | 2187 | |
---|
[9368] | 2188 | void emit(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 2189 | arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) |
---|
| 2190 | { |
---|
| 2191 | lock_block<mt_policy> lock(this); |
---|
| 2192 | typename _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 2193 | typename _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 2194 | |
---|
| 2195 | while(it != itEnd) |
---|
[9358] | 2196 | { |
---|
[9368] | 2197 | itNext = it; |
---|
| 2198 | ++itNext; |
---|
[9358] | 2199 | |
---|
[9368] | 2200 | (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8); |
---|
[9358] | 2201 | |
---|
[9368] | 2202 | it = itNext; |
---|
[9358] | 2203 | } |
---|
[9368] | 2204 | } |
---|
[9358] | 2205 | |
---|
[9368] | 2206 | void operator()(arg1_type a1, arg2_type a2, arg3_type a3, arg4_type a4, |
---|
| 2207 | arg5_type a5, arg6_type a6, arg7_type a7, arg8_type a8) |
---|
| 2208 | { |
---|
| 2209 | lock_block<mt_policy> lock(this); |
---|
| 2210 | typename _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>::connections_list::const_iterator itNext, it = this->m_connected_slots.begin(); |
---|
| 2211 | typename _signal_base8<arg1_type, arg2_type, arg3_type, arg4_type, arg5_type, arg6_type, arg7_type, arg8_type, mt_policy>::connections_list::const_iterator itEnd = this->m_connected_slots.end(); |
---|
| 2212 | |
---|
| 2213 | while(it != itEnd) |
---|
[9358] | 2214 | { |
---|
[9368] | 2215 | itNext = it; |
---|
| 2216 | ++itNext; |
---|
[9358] | 2217 | |
---|
[9368] | 2218 | (*it)->emit(a1, a2, a3, a4, a5, a6, a7, a8); |
---|
[9358] | 2219 | |
---|
[9368] | 2220 | it = itNext; |
---|
[9358] | 2221 | } |
---|
[9368] | 2222 | } |
---|
[9358] | 2223 | }; |
---|
| 2224 | |
---|
| 2225 | } |
---|
| 2226 | ; // namespace sigslot |
---|
| 2227 | |
---|
[9362] | 2228 | #endif /* SIGNAL_H__ */ |
---|
[9358] | 2229 | |
---|