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