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