diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-08 22:58:28 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-08 22:58:28 +0000 |
commit | 52be1ef0d126f09ba943c7afcf367e7d9347f2fd (patch) | |
tree | fd4b0dd148751c3c6c1b95296c3b82cb86051b83 /bootstrap | |
parent | 795d0737fed40d88a7801b451b7750ba90802345 (diff) | |
download | build-52be1ef0d126f09ba943c7afcf367e7d9347f2fd.tar.gz build-52be1ef0d126f09ba943c7afcf367e7d9347f2fd.tar.bz2 build-52be1ef0d126f09ba943c7afcf367e7d9347f2fd.tar.xz build-52be1ef0d126f09ba943c7afcf367e7d9347f2fd.zip |
tabconv: it's all spaces now.
Diffstat (limited to '')
-rw-r--r-- | bootstrap/signals.h | 2290 |
1 files changed, 1145 insertions, 1145 deletions
diff --git a/bootstrap/signals.h b/bootstrap/signals.h index 47ddad4..875f16e 100644 --- a/bootstrap/signals.h +++ b/bootstrap/signals.h | |||
@@ -13,1194 +13,1194 @@ | |||
13 | 13 | ||
14 | namespace Bu | 14 | namespace Bu |
15 | { | 15 | { |
16 | subExceptionDecl( SignalException ); | 16 | subExceptionDecl( SignalException ); |
17 | 17 | ||
18 | #ifndef BU_SIGNAL_PARAM_COUNT_0 | 18 | #ifndef BU_SIGNAL_PARAM_COUNT_0 |
19 | #define BU_SIGNAL_PARAM_COUNT_0 | 19 | #define BU_SIGNAL_PARAM_COUNT_0 |
20 | // | 20 | // |
21 | // 0 Parameter(s) | 21 | // 0 Parameter(s) |
22 | // | 22 | // |
23 | template<typename ret> | 23 | template<typename ret> |
24 | class _Slot0 | 24 | class _Slot0 |
25 | { | 25 | { |
26 | public: | 26 | public: |
27 | _Slot0() { } | 27 | _Slot0() { } |
28 | virtual ~_Slot0() { } | 28 | virtual ~_Slot0() { } |
29 | virtual ret operator()( )=0; | 29 | virtual ret operator()( )=0; |
30 | virtual _Slot0<ret> *clone() const=0; | 30 | virtual _Slot0<ret> *clone() const=0; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | template<typename cls, typename ret> | 33 | template<typename cls, typename ret> |
34 | class __Slot0 : public _Slot0<ret> | 34 | class __Slot0 : public _Slot0<ret> |
35 | { | 35 | { |
36 | public: | 36 | public: |
37 | __Slot0( cls *pCls, ret (cls::*pFnc)( ) ) : | 37 | __Slot0( cls *pCls, ret (cls::*pFnc)( ) ) : |
38 | pCls( pCls ), pFnc( pFnc ) { } | 38 | pCls( pCls ), pFnc( pFnc ) { } |
39 | virtual ~__Slot0() { } | 39 | virtual ~__Slot0() { } |
40 | 40 | ||
41 | virtual ret operator()( ) | 41 | virtual ret operator()( ) |
42 | { | 42 | { |
43 | return (pCls->*pFnc)( ); | 43 | return (pCls->*pFnc)( ); |
44 | } | 44 | } |
45 | 45 | ||
46 | virtual _Slot0<ret> *clone() const | 46 | virtual _Slot0<ret> *clone() const |
47 | { | 47 | { |
48 | return new __Slot0<cls, ret>( pCls, pFnc ); | 48 | return new __Slot0<cls, ret>( pCls, pFnc ); |
49 | } | 49 | } |
50 | 50 | ||
51 | private: | 51 | private: |
52 | cls *pCls; | 52 | cls *pCls; |
53 | ret (cls::*pFnc)( ); | 53 | ret (cls::*pFnc)( ); |
54 | }; | 54 | }; |
55 | 55 | ||
56 | template<typename ret> | 56 | template<typename ret> |
57 | class __Slot0F : public _Slot0<ret> | 57 | class __Slot0F : public _Slot0<ret> |
58 | { | 58 | { |
59 | public: | 59 | public: |
60 | __Slot0F( ret (*pFnc)( ) ) : | 60 | __Slot0F( ret (*pFnc)( ) ) : |
61 | pFnc( pFnc ) { } | 61 | pFnc( pFnc ) { } |
62 | virtual ~__Slot0F() { } | 62 | virtual ~__Slot0F() { } |
63 | 63 | ||
64 | virtual ret operator()( ) | 64 | virtual ret operator()( ) |
65 | { | 65 | { |
66 | return (*pFnc)( ); | 66 | return (*pFnc)( ); |
67 | } | 67 | } |
68 | 68 | ||
69 | virtual _Slot0<ret> *clone() const | 69 | virtual _Slot0<ret> *clone() const |
70 | { | 70 | { |
71 | return new __Slot0F<ret>( pFnc ); | 71 | return new __Slot0F<ret>( pFnc ); |
72 | } | 72 | } |
73 | 73 | ||
74 | private: | 74 | private: |
75 | ret (*pFnc)( ); | 75 | ret (*pFnc)( ); |
76 | }; | 76 | }; |
77 | 77 | ||
78 | template<typename ret> | 78 | template<typename ret> |
79 | class Signal0 | 79 | class Signal0 |
80 | { | 80 | { |
81 | public: | 81 | public: |
82 | Signal0() : pCb( NULL ) { } | 82 | Signal0() : pCb( NULL ) { } |
83 | Signal0( _Slot0<ret> *pCb ) : pCb( pCb ) { } | 83 | Signal0( _Slot0<ret> *pCb ) : pCb( pCb ) { } |
84 | Signal0( const Signal0<ret> &rSrc ) : | 84 | Signal0( const Signal0<ret> &rSrc ) : |
85 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 85 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
86 | virtual ~Signal0() { delete pCb; pCb = NULL; } | 86 | virtual ~Signal0() { delete pCb; pCb = NULL; } |
87 | 87 | ||
88 | ret operator()( ) | 88 | ret operator()( ) |
89 | { | 89 | { |
90 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 90 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
91 | return (*pCb)( ); | 91 | return (*pCb)( ); |
92 | } | 92 | } |
93 | 93 | ||
94 | bool isSet() const { return pCb != NULL; } | 94 | bool isSet() const { return pCb != NULL; } |
95 | operator bool() const { return isSet(); } | 95 | operator bool() const { return isSet(); } |
96 | 96 | ||
97 | Signal0<ret> &operator=( const Signal0<ret> &rhs ) | 97 | Signal0<ret> &operator=( const Signal0<ret> &rhs ) |
98 | { | 98 | { |
99 | pCb = rhs.pCb->clone(); | 99 | pCb = rhs.pCb->clone(); |
100 | return *this; | 100 | return *this; |
101 | } | 101 | } |
102 | 102 | ||
103 | private: | 103 | private: |
104 | _Slot0<ret> *pCb; | 104 | _Slot0<ret> *pCb; |
105 | }; | 105 | }; |
106 | 106 | ||
107 | template<typename cls, typename ret> | 107 | template<typename cls, typename ret> |
108 | Signal0<ret> slot( cls *pCls, ret (cls::*pFnc)( ) ) | 108 | Signal0<ret> slot( cls *pCls, ret (cls::*pFnc)( ) ) |
109 | { | 109 | { |
110 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 110 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
111 | return Signal0<ret>( | 111 | return Signal0<ret>( |
112 | new __Slot0<cls, ret>( pCls, pFnc ) | 112 | new __Slot0<cls, ret>( pCls, pFnc ) |
113 | ); | 113 | ); |
114 | } | 114 | } |
115 | 115 | ||
116 | template<typename ret> | 116 | template<typename ret> |
117 | Signal0<ret> slot( ret (*pFnc)( ) ) | 117 | Signal0<ret> slot( ret (*pFnc)( ) ) |
118 | { | 118 | { |
119 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 119 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
120 | return Signal0<ret>( | 120 | return Signal0<ret>( |
121 | new __Slot0F<ret>( pFnc ) | 121 | new __Slot0F<ret>( pFnc ) |
122 | ); | 122 | ); |
123 | } | 123 | } |
124 | #endif // BU_SIGNAL_PARAM_COUNT_0 | 124 | #endif // BU_SIGNAL_PARAM_COUNT_0 |
125 | 125 | ||
126 | #ifndef BU_SIGNAL_PARAM_COUNT_1 | 126 | #ifndef BU_SIGNAL_PARAM_COUNT_1 |
127 | #define BU_SIGNAL_PARAM_COUNT_1 | 127 | #define BU_SIGNAL_PARAM_COUNT_1 |
128 | // | 128 | // |
129 | // 1 Parameter(s) | 129 | // 1 Parameter(s) |
130 | // | 130 | // |
131 | template<typename ret, typename p1t> | 131 | template<typename ret, typename p1t> |
132 | class _Slot1 | 132 | class _Slot1 |
133 | { | 133 | { |
134 | public: | 134 | public: |
135 | _Slot1() { } | 135 | _Slot1() { } |
136 | virtual ~_Slot1() { } | 136 | virtual ~_Slot1() { } |
137 | virtual ret operator()( p1t p1 )=0; | 137 | virtual ret operator()( p1t p1 )=0; |
138 | virtual _Slot1<ret, p1t> *clone() const=0; | 138 | virtual _Slot1<ret, p1t> *clone() const=0; |
139 | }; | 139 | }; |
140 | 140 | ||
141 | template<typename cls, typename ret, typename p1t> | 141 | template<typename cls, typename ret, typename p1t> |
142 | class __Slot1 : public _Slot1<ret, p1t> | 142 | class __Slot1 : public _Slot1<ret, p1t> |
143 | { | 143 | { |
144 | public: | 144 | public: |
145 | __Slot1( cls *pCls, ret (cls::*pFnc)( p1t ) ) : | 145 | __Slot1( cls *pCls, ret (cls::*pFnc)( p1t ) ) : |
146 | pCls( pCls ), pFnc( pFnc ) { } | 146 | pCls( pCls ), pFnc( pFnc ) { } |
147 | virtual ~__Slot1() { } | 147 | virtual ~__Slot1() { } |
148 | 148 | ||
149 | virtual ret operator()( p1t p1 ) | 149 | virtual ret operator()( p1t p1 ) |
150 | { | 150 | { |
151 | return (pCls->*pFnc)( p1 ); | 151 | return (pCls->*pFnc)( p1 ); |
152 | } | 152 | } |
153 | 153 | ||
154 | virtual _Slot1<ret, p1t> *clone() const | 154 | virtual _Slot1<ret, p1t> *clone() const |
155 | { | 155 | { |
156 | return new __Slot1<cls, ret, p1t>( pCls, pFnc ); | 156 | return new __Slot1<cls, ret, p1t>( pCls, pFnc ); |
157 | } | 157 | } |
158 | 158 | ||
159 | private: | 159 | private: |
160 | cls *pCls; | 160 | cls *pCls; |
161 | ret (cls::*pFnc)( p1t ); | 161 | ret (cls::*pFnc)( p1t ); |
162 | }; | 162 | }; |
163 | 163 | ||
164 | template<typename ret, typename p1t> | 164 | template<typename ret, typename p1t> |
165 | class __Slot1F : public _Slot1<ret, p1t> | 165 | class __Slot1F : public _Slot1<ret, p1t> |
166 | { | 166 | { |
167 | public: | 167 | public: |
168 | __Slot1F( ret (*pFnc)( p1t ) ) : | 168 | __Slot1F( ret (*pFnc)( p1t ) ) : |
169 | pFnc( pFnc ) { } | 169 | pFnc( pFnc ) { } |
170 | virtual ~__Slot1F() { } | 170 | virtual ~__Slot1F() { } |
171 | 171 | ||
172 | virtual ret operator()( p1t p1 ) | 172 | virtual ret operator()( p1t p1 ) |
173 | { | 173 | { |
174 | return (*pFnc)( p1 ); | 174 | return (*pFnc)( p1 ); |
175 | } | 175 | } |
176 | 176 | ||
177 | virtual _Slot1<ret, p1t> *clone() const | 177 | virtual _Slot1<ret, p1t> *clone() const |
178 | { | 178 | { |
179 | return new __Slot1F<ret, p1t>( pFnc ); | 179 | return new __Slot1F<ret, p1t>( pFnc ); |
180 | } | 180 | } |
181 | 181 | ||
182 | private: | 182 | private: |
183 | ret (*pFnc)( p1t ); | 183 | ret (*pFnc)( p1t ); |
184 | }; | 184 | }; |
185 | 185 | ||
186 | template<typename ret, typename p1t> | 186 | template<typename ret, typename p1t> |
187 | class Signal1 | 187 | class Signal1 |
188 | { | 188 | { |
189 | public: | 189 | public: |
190 | Signal1() : pCb( NULL ) { } | 190 | Signal1() : pCb( NULL ) { } |
191 | Signal1( _Slot1<ret, p1t> *pCb ) : pCb( pCb ) { } | 191 | Signal1( _Slot1<ret, p1t> *pCb ) : pCb( pCb ) { } |
192 | Signal1( const Signal1<ret, p1t> &rSrc ) : | 192 | Signal1( const Signal1<ret, p1t> &rSrc ) : |
193 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 193 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
194 | virtual ~Signal1() { delete pCb; pCb = NULL; } | 194 | virtual ~Signal1() { delete pCb; pCb = NULL; } |
195 | 195 | ||
196 | ret operator()( p1t p1 ) | 196 | ret operator()( p1t p1 ) |
197 | { | 197 | { |
198 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 198 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
199 | return (*pCb)( p1 ); | 199 | return (*pCb)( p1 ); |
200 | } | 200 | } |
201 | 201 | ||
202 | bool isSet() const { return pCb != NULL; } | 202 | bool isSet() const { return pCb != NULL; } |
203 | operator bool() const { return isSet(); } | 203 | operator bool() const { return isSet(); } |
204 | 204 | ||
205 | Signal1<ret, p1t> &operator=( const Signal1<ret, p1t> &rhs ) | 205 | Signal1<ret, p1t> &operator=( const Signal1<ret, p1t> &rhs ) |
206 | { | 206 | { |
207 | pCb = rhs.pCb->clone(); | 207 | pCb = rhs.pCb->clone(); |
208 | return *this; | 208 | return *this; |
209 | } | 209 | } |
210 | 210 | ||
211 | private: | 211 | private: |
212 | _Slot1<ret, p1t> *pCb; | 212 | _Slot1<ret, p1t> *pCb; |
213 | }; | 213 | }; |
214 | 214 | ||
215 | template<typename cls, typename ret, typename p1t> | 215 | template<typename cls, typename ret, typename p1t> |
216 | Signal1<ret, p1t> slot( cls *pCls, ret (cls::*pFnc)( p1t ) ) | 216 | Signal1<ret, p1t> slot( cls *pCls, ret (cls::*pFnc)( p1t ) ) |
217 | { | 217 | { |
218 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 218 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
219 | return Signal1<ret, p1t>( | 219 | return Signal1<ret, p1t>( |
220 | new __Slot1<cls, ret, p1t>( pCls, pFnc ) | 220 | new __Slot1<cls, ret, p1t>( pCls, pFnc ) |
221 | ); | 221 | ); |
222 | } | 222 | } |
223 | 223 | ||
224 | template<typename ret, typename p1t> | 224 | template<typename ret, typename p1t> |
225 | Signal1<ret, p1t> slot( ret (*pFnc)( p1t ) ) | 225 | Signal1<ret, p1t> slot( ret (*pFnc)( p1t ) ) |
226 | { | 226 | { |
227 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 227 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
228 | return Signal1<ret, p1t>( | 228 | return Signal1<ret, p1t>( |
229 | new __Slot1F<ret, p1t>( pFnc ) | 229 | new __Slot1F<ret, p1t>( pFnc ) |
230 | ); | 230 | ); |
231 | } | 231 | } |
232 | #endif // BU_SIGNAL_PARAM_COUNT_1 | 232 | #endif // BU_SIGNAL_PARAM_COUNT_1 |
233 | 233 | ||
234 | #ifndef BU_SIGNAL_PARAM_COUNT_2 | 234 | #ifndef BU_SIGNAL_PARAM_COUNT_2 |
235 | #define BU_SIGNAL_PARAM_COUNT_2 | 235 | #define BU_SIGNAL_PARAM_COUNT_2 |
236 | // | 236 | // |
237 | // 2 Parameter(s) | 237 | // 2 Parameter(s) |
238 | // | 238 | // |
239 | template<typename ret, typename p1t, typename p2t> | 239 | template<typename ret, typename p1t, typename p2t> |
240 | class _Slot2 | 240 | class _Slot2 |
241 | { | 241 | { |
242 | public: | 242 | public: |
243 | _Slot2() { } | 243 | _Slot2() { } |
244 | virtual ~_Slot2() { } | 244 | virtual ~_Slot2() { } |
245 | virtual ret operator()( p1t p1, p2t p2 )=0; | 245 | virtual ret operator()( p1t p1, p2t p2 )=0; |
246 | virtual _Slot2<ret, p1t, p2t> *clone() const=0; | 246 | virtual _Slot2<ret, p1t, p2t> *clone() const=0; |
247 | }; | 247 | }; |
248 | 248 | ||
249 | template<typename cls, typename ret, typename p1t, typename p2t> | 249 | template<typename cls, typename ret, typename p1t, typename p2t> |
250 | class __Slot2 : public _Slot2<ret, p1t, p2t> | 250 | class __Slot2 : public _Slot2<ret, p1t, p2t> |
251 | { | 251 | { |
252 | public: | 252 | public: |
253 | __Slot2( cls *pCls, ret (cls::*pFnc)( p1t, p2t ) ) : | 253 | __Slot2( cls *pCls, ret (cls::*pFnc)( p1t, p2t ) ) : |
254 | pCls( pCls ), pFnc( pFnc ) { } | 254 | pCls( pCls ), pFnc( pFnc ) { } |
255 | virtual ~__Slot2() { } | 255 | virtual ~__Slot2() { } |
256 | 256 | ||
257 | virtual ret operator()( p1t p1, p2t p2 ) | 257 | virtual ret operator()( p1t p1, p2t p2 ) |
258 | { | 258 | { |
259 | return (pCls->*pFnc)( p1, p2 ); | 259 | return (pCls->*pFnc)( p1, p2 ); |
260 | } | 260 | } |
261 | 261 | ||
262 | virtual _Slot2<ret, p1t, p2t> *clone() const | 262 | virtual _Slot2<ret, p1t, p2t> *clone() const |
263 | { | 263 | { |
264 | return new __Slot2<cls, ret, p1t, p2t>( pCls, pFnc ); | 264 | return new __Slot2<cls, ret, p1t, p2t>( pCls, pFnc ); |
265 | } | 265 | } |
266 | 266 | ||
267 | private: | 267 | private: |
268 | cls *pCls; | 268 | cls *pCls; |
269 | ret (cls::*pFnc)( p1t, p2t ); | 269 | ret (cls::*pFnc)( p1t, p2t ); |
270 | }; | 270 | }; |
271 | 271 | ||
272 | template<typename ret, typename p1t, typename p2t> | 272 | template<typename ret, typename p1t, typename p2t> |
273 | class __Slot2F : public _Slot2<ret, p1t, p2t> | 273 | class __Slot2F : public _Slot2<ret, p1t, p2t> |
274 | { | 274 | { |
275 | public: | 275 | public: |
276 | __Slot2F( ret (*pFnc)( p1t, p2t ) ) : | 276 | __Slot2F( ret (*pFnc)( p1t, p2t ) ) : |
277 | pFnc( pFnc ) { } | 277 | pFnc( pFnc ) { } |
278 | virtual ~__Slot2F() { } | 278 | virtual ~__Slot2F() { } |
279 | 279 | ||
280 | virtual ret operator()( p1t p1, p2t p2 ) | 280 | virtual ret operator()( p1t p1, p2t p2 ) |
281 | { | 281 | { |
282 | return (*pFnc)( p1, p2 ); | 282 | return (*pFnc)( p1, p2 ); |
283 | } | 283 | } |
284 | 284 | ||
285 | virtual _Slot2<ret, p1t, p2t> *clone() const | 285 | virtual _Slot2<ret, p1t, p2t> *clone() const |
286 | { | 286 | { |
287 | return new __Slot2F<ret, p1t, p2t>( pFnc ); | 287 | return new __Slot2F<ret, p1t, p2t>( pFnc ); |
288 | } | 288 | } |
289 | 289 | ||
290 | private: | 290 | private: |
291 | ret (*pFnc)( p1t, p2t ); | 291 | ret (*pFnc)( p1t, p2t ); |
292 | }; | 292 | }; |
293 | 293 | ||
294 | template<typename ret, typename p1t, typename p2t> | 294 | template<typename ret, typename p1t, typename p2t> |
295 | class Signal2 | 295 | class Signal2 |
296 | { | 296 | { |
297 | public: | 297 | public: |
298 | Signal2() : pCb( NULL ) { } | 298 | Signal2() : pCb( NULL ) { } |
299 | Signal2( _Slot2<ret, p1t, p2t> *pCb ) : pCb( pCb ) { } | 299 | Signal2( _Slot2<ret, p1t, p2t> *pCb ) : pCb( pCb ) { } |
300 | Signal2( const Signal2<ret, p1t, p2t> &rSrc ) : | 300 | Signal2( const Signal2<ret, p1t, p2t> &rSrc ) : |
301 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 301 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
302 | virtual ~Signal2() { delete pCb; pCb = NULL; } | 302 | virtual ~Signal2() { delete pCb; pCb = NULL; } |
303 | 303 | ||
304 | ret operator()( p1t p1, p2t p2 ) | 304 | ret operator()( p1t p1, p2t p2 ) |
305 | { | 305 | { |
306 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 306 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
307 | return (*pCb)( p1, p2 ); | 307 | return (*pCb)( p1, p2 ); |
308 | } | 308 | } |
309 | 309 | ||
310 | bool isSet() const { return pCb != NULL; } | 310 | bool isSet() const { return pCb != NULL; } |
311 | operator bool() const { return isSet(); } | 311 | operator bool() const { return isSet(); } |
312 | 312 | ||
313 | Signal2<ret, p1t, p2t> &operator=( const Signal2<ret, p1t, p2t> &rhs ) | 313 | Signal2<ret, p1t, p2t> &operator=( const Signal2<ret, p1t, p2t> &rhs ) |
314 | { | 314 | { |
315 | pCb = rhs.pCb->clone(); | 315 | pCb = rhs.pCb->clone(); |
316 | return *this; | 316 | return *this; |
317 | } | 317 | } |
318 | 318 | ||
319 | private: | 319 | private: |
320 | _Slot2<ret, p1t, p2t> *pCb; | 320 | _Slot2<ret, p1t, p2t> *pCb; |
321 | }; | 321 | }; |
322 | 322 | ||
323 | template<typename cls, typename ret, typename p1t, typename p2t> | 323 | template<typename cls, typename ret, typename p1t, typename p2t> |
324 | Signal2<ret, p1t, p2t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t ) ) | 324 | Signal2<ret, p1t, p2t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t ) ) |
325 | { | 325 | { |
326 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 326 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
327 | return Signal2<ret, p1t, p2t>( | 327 | return Signal2<ret, p1t, p2t>( |
328 | new __Slot2<cls, ret, p1t, p2t>( pCls, pFnc ) | 328 | new __Slot2<cls, ret, p1t, p2t>( pCls, pFnc ) |
329 | ); | 329 | ); |
330 | } | 330 | } |
331 | 331 | ||
332 | template<typename ret, typename p1t, typename p2t> | 332 | template<typename ret, typename p1t, typename p2t> |
333 | Signal2<ret, p1t, p2t> slot( ret (*pFnc)( p1t, p2t ) ) | 333 | Signal2<ret, p1t, p2t> slot( ret (*pFnc)( p1t, p2t ) ) |
334 | { | 334 | { |
335 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 335 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
336 | return Signal2<ret, p1t, p2t>( | 336 | return Signal2<ret, p1t, p2t>( |
337 | new __Slot2F<ret, p1t, p2t>( pFnc ) | 337 | new __Slot2F<ret, p1t, p2t>( pFnc ) |
338 | ); | 338 | ); |
339 | } | 339 | } |
340 | #endif // BU_SIGNAL_PARAM_COUNT_2 | 340 | #endif // BU_SIGNAL_PARAM_COUNT_2 |
341 | 341 | ||
342 | #ifndef BU_SIGNAL_PARAM_COUNT_3 | 342 | #ifndef BU_SIGNAL_PARAM_COUNT_3 |
343 | #define BU_SIGNAL_PARAM_COUNT_3 | 343 | #define BU_SIGNAL_PARAM_COUNT_3 |
344 | // | 344 | // |
345 | // 3 Parameter(s) | 345 | // 3 Parameter(s) |
346 | // | 346 | // |
347 | template<typename ret, typename p1t, typename p2t, typename p3t> | 347 | template<typename ret, typename p1t, typename p2t, typename p3t> |
348 | class _Slot3 | 348 | class _Slot3 |
349 | { | 349 | { |
350 | public: | 350 | public: |
351 | _Slot3() { } | 351 | _Slot3() { } |
352 | virtual ~_Slot3() { } | 352 | virtual ~_Slot3() { } |
353 | virtual ret operator()( p1t p1, p2t p2, p3t p3 )=0; | 353 | virtual ret operator()( p1t p1, p2t p2, p3t p3 )=0; |
354 | virtual _Slot3<ret, p1t, p2t, p3t> *clone() const=0; | 354 | virtual _Slot3<ret, p1t, p2t, p3t> *clone() const=0; |
355 | }; | 355 | }; |
356 | 356 | ||
357 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t> | 357 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t> |
358 | class __Slot3 : public _Slot3<ret, p1t, p2t, p3t> | 358 | class __Slot3 : public _Slot3<ret, p1t, p2t, p3t> |
359 | { | 359 | { |
360 | public: | 360 | public: |
361 | __Slot3( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t ) ) : | 361 | __Slot3( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t ) ) : |
362 | pCls( pCls ), pFnc( pFnc ) { } | 362 | pCls( pCls ), pFnc( pFnc ) { } |
363 | virtual ~__Slot3() { } | 363 | virtual ~__Slot3() { } |
364 | 364 | ||
365 | virtual ret operator()( p1t p1, p2t p2, p3t p3 ) | 365 | virtual ret operator()( p1t p1, p2t p2, p3t p3 ) |
366 | { | 366 | { |
367 | return (pCls->*pFnc)( p1, p2, p3 ); | 367 | return (pCls->*pFnc)( p1, p2, p3 ); |
368 | } | 368 | } |
369 | 369 | ||
370 | virtual _Slot3<ret, p1t, p2t, p3t> *clone() const | 370 | virtual _Slot3<ret, p1t, p2t, p3t> *clone() const |
371 | { | 371 | { |
372 | return new __Slot3<cls, ret, p1t, p2t, p3t>( pCls, pFnc ); | 372 | return new __Slot3<cls, ret, p1t, p2t, p3t>( pCls, pFnc ); |
373 | } | 373 | } |
374 | 374 | ||
375 | private: | 375 | private: |
376 | cls *pCls; | 376 | cls *pCls; |
377 | ret (cls::*pFnc)( p1t, p2t, p3t ); | 377 | ret (cls::*pFnc)( p1t, p2t, p3t ); |
378 | }; | 378 | }; |
379 | 379 | ||
380 | template<typename ret, typename p1t, typename p2t, typename p3t> | 380 | template<typename ret, typename p1t, typename p2t, typename p3t> |
381 | class __Slot3F : public _Slot3<ret, p1t, p2t, p3t> | 381 | class __Slot3F : public _Slot3<ret, p1t, p2t, p3t> |
382 | { | 382 | { |
383 | public: | 383 | public: |
384 | __Slot3F( ret (*pFnc)( p1t, p2t, p3t ) ) : | 384 | __Slot3F( ret (*pFnc)( p1t, p2t, p3t ) ) : |
385 | pFnc( pFnc ) { } | 385 | pFnc( pFnc ) { } |
386 | virtual ~__Slot3F() { } | 386 | virtual ~__Slot3F() { } |
387 | 387 | ||
388 | virtual ret operator()( p1t p1, p2t p2, p3t p3 ) | 388 | virtual ret operator()( p1t p1, p2t p2, p3t p3 ) |
389 | { | 389 | { |
390 | return (*pFnc)( p1, p2, p3 ); | 390 | return (*pFnc)( p1, p2, p3 ); |
391 | } | 391 | } |
392 | 392 | ||
393 | virtual _Slot3<ret, p1t, p2t, p3t> *clone() const | 393 | virtual _Slot3<ret, p1t, p2t, p3t> *clone() const |
394 | { | 394 | { |
395 | return new __Slot3F<ret, p1t, p2t, p3t>( pFnc ); | 395 | return new __Slot3F<ret, p1t, p2t, p3t>( pFnc ); |
396 | } | 396 | } |
397 | 397 | ||
398 | private: | 398 | private: |
399 | ret (*pFnc)( p1t, p2t, p3t ); | 399 | ret (*pFnc)( p1t, p2t, p3t ); |
400 | }; | 400 | }; |
401 | 401 | ||
402 | template<typename ret, typename p1t, typename p2t, typename p3t> | 402 | template<typename ret, typename p1t, typename p2t, typename p3t> |
403 | class Signal3 | 403 | class Signal3 |
404 | { | 404 | { |
405 | public: | 405 | public: |
406 | Signal3() : pCb( NULL ) { } | 406 | Signal3() : pCb( NULL ) { } |
407 | Signal3( _Slot3<ret, p1t, p2t, p3t> *pCb ) : pCb( pCb ) { } | 407 | Signal3( _Slot3<ret, p1t, p2t, p3t> *pCb ) : pCb( pCb ) { } |
408 | Signal3( const Signal3<ret, p1t, p2t, p3t> &rSrc ) : | 408 | Signal3( const Signal3<ret, p1t, p2t, p3t> &rSrc ) : |
409 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 409 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
410 | virtual ~Signal3() { delete pCb; pCb = NULL; } | 410 | virtual ~Signal3() { delete pCb; pCb = NULL; } |
411 | 411 | ||
412 | ret operator()( p1t p1, p2t p2, p3t p3 ) | 412 | ret operator()( p1t p1, p2t p2, p3t p3 ) |
413 | { | 413 | { |
414 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 414 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
415 | return (*pCb)( p1, p2, p3 ); | 415 | return (*pCb)( p1, p2, p3 ); |
416 | } | 416 | } |
417 | 417 | ||
418 | bool isSet() const { return pCb != NULL; } | 418 | bool isSet() const { return pCb != NULL; } |
419 | operator bool() const { return isSet(); } | 419 | operator bool() const { return isSet(); } |
420 | 420 | ||
421 | Signal3<ret, p1t, p2t, p3t> &operator=( const Signal3<ret, p1t, p2t, p3t> &rhs ) | 421 | Signal3<ret, p1t, p2t, p3t> &operator=( const Signal3<ret, p1t, p2t, p3t> &rhs ) |
422 | { | 422 | { |
423 | pCb = rhs.pCb->clone(); | 423 | pCb = rhs.pCb->clone(); |
424 | return *this; | 424 | return *this; |
425 | } | 425 | } |
426 | 426 | ||
427 | private: | 427 | private: |
428 | _Slot3<ret, p1t, p2t, p3t> *pCb; | 428 | _Slot3<ret, p1t, p2t, p3t> *pCb; |
429 | }; | 429 | }; |
430 | 430 | ||
431 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t> | 431 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t> |
432 | Signal3<ret, p1t, p2t, p3t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t ) ) | 432 | Signal3<ret, p1t, p2t, p3t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t ) ) |
433 | { | 433 | { |
434 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 434 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
435 | return Signal3<ret, p1t, p2t, p3t>( | 435 | return Signal3<ret, p1t, p2t, p3t>( |
436 | new __Slot3<cls, ret, p1t, p2t, p3t>( pCls, pFnc ) | 436 | new __Slot3<cls, ret, p1t, p2t, p3t>( pCls, pFnc ) |
437 | ); | 437 | ); |
438 | } | 438 | } |
439 | 439 | ||
440 | template<typename ret, typename p1t, typename p2t, typename p3t> | 440 | template<typename ret, typename p1t, typename p2t, typename p3t> |
441 | Signal3<ret, p1t, p2t, p3t> slot( ret (*pFnc)( p1t, p2t, p3t ) ) | 441 | Signal3<ret, p1t, p2t, p3t> slot( ret (*pFnc)( p1t, p2t, p3t ) ) |
442 | { | 442 | { |
443 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 443 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
444 | return Signal3<ret, p1t, p2t, p3t>( | 444 | return Signal3<ret, p1t, p2t, p3t>( |
445 | new __Slot3F<ret, p1t, p2t, p3t>( pFnc ) | 445 | new __Slot3F<ret, p1t, p2t, p3t>( pFnc ) |
446 | ); | 446 | ); |
447 | } | 447 | } |
448 | #endif // BU_SIGNAL_PARAM_COUNT_3 | 448 | #endif // BU_SIGNAL_PARAM_COUNT_3 |
449 | 449 | ||
450 | #ifndef BU_SIGNAL_PARAM_COUNT_4 | 450 | #ifndef BU_SIGNAL_PARAM_COUNT_4 |
451 | #define BU_SIGNAL_PARAM_COUNT_4 | 451 | #define BU_SIGNAL_PARAM_COUNT_4 |
452 | // | 452 | // |
453 | // 4 Parameter(s) | 453 | // 4 Parameter(s) |
454 | // | 454 | // |
455 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> | 455 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> |
456 | class _Slot4 | 456 | class _Slot4 |
457 | { | 457 | { |
458 | public: | 458 | public: |
459 | _Slot4() { } | 459 | _Slot4() { } |
460 | virtual ~_Slot4() { } | 460 | virtual ~_Slot4() { } |
461 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 )=0; | 461 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 )=0; |
462 | virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const=0; | 462 | virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const=0; |
463 | }; | 463 | }; |
464 | 464 | ||
465 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t> | 465 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t> |
466 | class __Slot4 : public _Slot4<ret, p1t, p2t, p3t, p4t> | 466 | class __Slot4 : public _Slot4<ret, p1t, p2t, p3t, p4t> |
467 | { | 467 | { |
468 | public: | 468 | public: |
469 | __Slot4( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t ) ) : | 469 | __Slot4( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t ) ) : |
470 | pCls( pCls ), pFnc( pFnc ) { } | 470 | pCls( pCls ), pFnc( pFnc ) { } |
471 | virtual ~__Slot4() { } | 471 | virtual ~__Slot4() { } |
472 | 472 | ||
473 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) | 473 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) |
474 | { | 474 | { |
475 | return (pCls->*pFnc)( p1, p2, p3, p4 ); | 475 | return (pCls->*pFnc)( p1, p2, p3, p4 ); |
476 | } | 476 | } |
477 | 477 | ||
478 | virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const | 478 | virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const |
479 | { | 479 | { |
480 | return new __Slot4<cls, ret, p1t, p2t, p3t, p4t>( pCls, pFnc ); | 480 | return new __Slot4<cls, ret, p1t, p2t, p3t, p4t>( pCls, pFnc ); |
481 | } | 481 | } |
482 | 482 | ||
483 | private: | 483 | private: |
484 | cls *pCls; | 484 | cls *pCls; |
485 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t ); | 485 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t ); |
486 | }; | 486 | }; |
487 | 487 | ||
488 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> | 488 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> |
489 | class __Slot4F : public _Slot4<ret, p1t, p2t, p3t, p4t> | 489 | class __Slot4F : public _Slot4<ret, p1t, p2t, p3t, p4t> |
490 | { | 490 | { |
491 | public: | 491 | public: |
492 | __Slot4F( ret (*pFnc)( p1t, p2t, p3t, p4t ) ) : | 492 | __Slot4F( ret (*pFnc)( p1t, p2t, p3t, p4t ) ) : |
493 | pFnc( pFnc ) { } | 493 | pFnc( pFnc ) { } |
494 | virtual ~__Slot4F() { } | 494 | virtual ~__Slot4F() { } |
495 | 495 | ||
496 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) | 496 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) |
497 | { | 497 | { |
498 | return (*pFnc)( p1, p2, p3, p4 ); | 498 | return (*pFnc)( p1, p2, p3, p4 ); |
499 | } | 499 | } |
500 | 500 | ||
501 | virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const | 501 | virtual _Slot4<ret, p1t, p2t, p3t, p4t> *clone() const |
502 | { | 502 | { |
503 | return new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc ); | 503 | return new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc ); |
504 | } | 504 | } |
505 | 505 | ||
506 | private: | 506 | private: |
507 | ret (*pFnc)( p1t, p2t, p3t, p4t ); | 507 | ret (*pFnc)( p1t, p2t, p3t, p4t ); |
508 | }; | 508 | }; |
509 | 509 | ||
510 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> | 510 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> |
511 | class Signal4 | 511 | class Signal4 |
512 | { | 512 | { |
513 | public: | 513 | public: |
514 | Signal4() : pCb( NULL ) { } | 514 | Signal4() : pCb( NULL ) { } |
515 | Signal4( _Slot4<ret, p1t, p2t, p3t, p4t> *pCb ) : pCb( pCb ) { } | 515 | Signal4( _Slot4<ret, p1t, p2t, p3t, p4t> *pCb ) : pCb( pCb ) { } |
516 | Signal4( const Signal4<ret, p1t, p2t, p3t, p4t> &rSrc ) : | 516 | Signal4( const Signal4<ret, p1t, p2t, p3t, p4t> &rSrc ) : |
517 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 517 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
518 | virtual ~Signal4() { delete pCb; pCb = NULL; } | 518 | virtual ~Signal4() { delete pCb; pCb = NULL; } |
519 | 519 | ||
520 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) | 520 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4 ) |
521 | { | 521 | { |
522 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 522 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
523 | return (*pCb)( p1, p2, p3, p4 ); | 523 | return (*pCb)( p1, p2, p3, p4 ); |
524 | } | 524 | } |
525 | 525 | ||
526 | bool isSet() const { return pCb != NULL; } | 526 | bool isSet() const { return pCb != NULL; } |
527 | operator bool() const { return isSet(); } | 527 | operator bool() const { return isSet(); } |
528 | 528 | ||
529 | Signal4<ret, p1t, p2t, p3t, p4t> &operator=( const Signal4<ret, p1t, p2t, p3t, p4t> &rhs ) | 529 | Signal4<ret, p1t, p2t, p3t, p4t> &operator=( const Signal4<ret, p1t, p2t, p3t, p4t> &rhs ) |
530 | { | 530 | { |
531 | pCb = rhs.pCb->clone(); | 531 | pCb = rhs.pCb->clone(); |
532 | return *this; | 532 | return *this; |
533 | } | 533 | } |
534 | 534 | ||
535 | private: | 535 | private: |
536 | _Slot4<ret, p1t, p2t, p3t, p4t> *pCb; | 536 | _Slot4<ret, p1t, p2t, p3t, p4t> *pCb; |
537 | }; | 537 | }; |
538 | 538 | ||
539 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t> | 539 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t> |
540 | Signal4<ret, p1t, p2t, p3t, p4t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t ) ) | 540 | Signal4<ret, p1t, p2t, p3t, p4t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t ) ) |
541 | { | 541 | { |
542 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 542 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
543 | return Signal4<ret, p1t, p2t, p3t, p4t>( | 543 | return Signal4<ret, p1t, p2t, p3t, p4t>( |
544 | new __Slot4<cls, ret, p1t, p2t, p3t, p4t>( pCls, pFnc ) | 544 | new __Slot4<cls, ret, p1t, p2t, p3t, p4t>( pCls, pFnc ) |
545 | ); | 545 | ); |
546 | } | 546 | } |
547 | 547 | ||
548 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> | 548 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t> |
549 | Signal4<ret, p1t, p2t, p3t, p4t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t ) ) | 549 | Signal4<ret, p1t, p2t, p3t, p4t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t ) ) |
550 | { | 550 | { |
551 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 551 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
552 | return Signal4<ret, p1t, p2t, p3t, p4t>( | 552 | return Signal4<ret, p1t, p2t, p3t, p4t>( |
553 | new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc ) | 553 | new __Slot4F<ret, p1t, p2t, p3t, p4t>( pFnc ) |
554 | ); | 554 | ); |
555 | } | 555 | } |
556 | #endif // BU_SIGNAL_PARAM_COUNT_4 | 556 | #endif // BU_SIGNAL_PARAM_COUNT_4 |
557 | 557 | ||
558 | #ifndef BU_SIGNAL_PARAM_COUNT_5 | 558 | #ifndef BU_SIGNAL_PARAM_COUNT_5 |
559 | #define BU_SIGNAL_PARAM_COUNT_5 | 559 | #define BU_SIGNAL_PARAM_COUNT_5 |
560 | // | 560 | // |
561 | // 5 Parameter(s) | 561 | // 5 Parameter(s) |
562 | // | 562 | // |
563 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> | 563 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> |
564 | class _Slot5 | 564 | class _Slot5 |
565 | { | 565 | { |
566 | public: | 566 | public: |
567 | _Slot5() { } | 567 | _Slot5() { } |
568 | virtual ~_Slot5() { } | 568 | virtual ~_Slot5() { } |
569 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )=0; | 569 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 )=0; |
570 | virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const=0; | 570 | virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const=0; |
571 | }; | 571 | }; |
572 | 572 | ||
573 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> | 573 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> |
574 | class __Slot5 : public _Slot5<ret, p1t, p2t, p3t, p4t, p5t> | 574 | class __Slot5 : public _Slot5<ret, p1t, p2t, p3t, p4t, p5t> |
575 | { | 575 | { |
576 | public: | 576 | public: |
577 | __Slot5( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) : | 577 | __Slot5( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) : |
578 | pCls( pCls ), pFnc( pFnc ) { } | 578 | pCls( pCls ), pFnc( pFnc ) { } |
579 | virtual ~__Slot5() { } | 579 | virtual ~__Slot5() { } |
580 | 580 | ||
581 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) | 581 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) |
582 | { | 582 | { |
583 | return (pCls->*pFnc)( p1, p2, p3, p4, p5 ); | 583 | return (pCls->*pFnc)( p1, p2, p3, p4, p5 ); |
584 | } | 584 | } |
585 | 585 | ||
586 | virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const | 586 | virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const |
587 | { | 587 | { |
588 | return new __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t>( pCls, pFnc ); | 588 | return new __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t>( pCls, pFnc ); |
589 | } | 589 | } |
590 | 590 | ||
591 | private: | 591 | private: |
592 | cls *pCls; | 592 | cls *pCls; |
593 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ); | 593 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ); |
594 | }; | 594 | }; |
595 | 595 | ||
596 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> | 596 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> |
597 | class __Slot5F : public _Slot5<ret, p1t, p2t, p3t, p4t, p5t> | 597 | class __Slot5F : public _Slot5<ret, p1t, p2t, p3t, p4t, p5t> |
598 | { | 598 | { |
599 | public: | 599 | public: |
600 | __Slot5F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) : | 600 | __Slot5F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) : |
601 | pFnc( pFnc ) { } | 601 | pFnc( pFnc ) { } |
602 | virtual ~__Slot5F() { } | 602 | virtual ~__Slot5F() { } |
603 | 603 | ||
604 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) | 604 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) |
605 | { | 605 | { |
606 | return (*pFnc)( p1, p2, p3, p4, p5 ); | 606 | return (*pFnc)( p1, p2, p3, p4, p5 ); |
607 | } | 607 | } |
608 | 608 | ||
609 | virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const | 609 | virtual _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *clone() const |
610 | { | 610 | { |
611 | return new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc ); | 611 | return new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc ); |
612 | } | 612 | } |
613 | 613 | ||
614 | private: | 614 | private: |
615 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ); | 615 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ); |
616 | }; | 616 | }; |
617 | 617 | ||
618 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> | 618 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> |
619 | class Signal5 | 619 | class Signal5 |
620 | { | 620 | { |
621 | public: | 621 | public: |
622 | Signal5() : pCb( NULL ) { } | 622 | Signal5() : pCb( NULL ) { } |
623 | Signal5( _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *pCb ) : pCb( pCb ) { } | 623 | Signal5( _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *pCb ) : pCb( pCb ) { } |
624 | Signal5( const Signal5<ret, p1t, p2t, p3t, p4t, p5t> &rSrc ) : | 624 | Signal5( const Signal5<ret, p1t, p2t, p3t, p4t, p5t> &rSrc ) : |
625 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 625 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
626 | virtual ~Signal5() { delete pCb; pCb = NULL; } | 626 | virtual ~Signal5() { delete pCb; pCb = NULL; } |
627 | 627 | ||
628 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) | 628 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5 ) |
629 | { | 629 | { |
630 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 630 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
631 | return (*pCb)( p1, p2, p3, p4, p5 ); | 631 | return (*pCb)( p1, p2, p3, p4, p5 ); |
632 | } | 632 | } |
633 | 633 | ||
634 | bool isSet() const { return pCb != NULL; } | 634 | bool isSet() const { return pCb != NULL; } |
635 | operator bool() const { return isSet(); } | 635 | operator bool() const { return isSet(); } |
636 | 636 | ||
637 | Signal5<ret, p1t, p2t, p3t, p4t, p5t> &operator=( const Signal5<ret, p1t, p2t, p3t, p4t, p5t> &rhs ) | 637 | Signal5<ret, p1t, p2t, p3t, p4t, p5t> &operator=( const Signal5<ret, p1t, p2t, p3t, p4t, p5t> &rhs ) |
638 | { | 638 | { |
639 | pCb = rhs.pCb->clone(); | 639 | pCb = rhs.pCb->clone(); |
640 | return *this; | 640 | return *this; |
641 | } | 641 | } |
642 | 642 | ||
643 | private: | 643 | private: |
644 | _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *pCb; | 644 | _Slot5<ret, p1t, p2t, p3t, p4t, p5t> *pCb; |
645 | }; | 645 | }; |
646 | 646 | ||
647 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> | 647 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> |
648 | Signal5<ret, p1t, p2t, p3t, p4t, p5t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) | 648 | Signal5<ret, p1t, p2t, p3t, p4t, p5t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) |
649 | { | 649 | { |
650 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 650 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
651 | return Signal5<ret, p1t, p2t, p3t, p4t, p5t>( | 651 | return Signal5<ret, p1t, p2t, p3t, p4t, p5t>( |
652 | new __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t>( pCls, pFnc ) | 652 | new __Slot5<cls, ret, p1t, p2t, p3t, p4t, p5t>( pCls, pFnc ) |
653 | ); | 653 | ); |
654 | } | 654 | } |
655 | 655 | ||
656 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> | 656 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t> |
657 | Signal5<ret, p1t, p2t, p3t, p4t, p5t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) | 657 | Signal5<ret, p1t, p2t, p3t, p4t, p5t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t ) ) |
658 | { | 658 | { |
659 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 659 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
660 | return Signal5<ret, p1t, p2t, p3t, p4t, p5t>( | 660 | return Signal5<ret, p1t, p2t, p3t, p4t, p5t>( |
661 | new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc ) | 661 | new __Slot5F<ret, p1t, p2t, p3t, p4t, p5t>( pFnc ) |
662 | ); | 662 | ); |
663 | } | 663 | } |
664 | #endif // BU_SIGNAL_PARAM_COUNT_5 | 664 | #endif // BU_SIGNAL_PARAM_COUNT_5 |
665 | 665 | ||
666 | #ifndef BU_SIGNAL_PARAM_COUNT_6 | 666 | #ifndef BU_SIGNAL_PARAM_COUNT_6 |
667 | #define BU_SIGNAL_PARAM_COUNT_6 | 667 | #define BU_SIGNAL_PARAM_COUNT_6 |
668 | // | 668 | // |
669 | // 6 Parameter(s) | 669 | // 6 Parameter(s) |
670 | // | 670 | // |
671 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> | 671 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> |
672 | class _Slot6 | 672 | class _Slot6 |
673 | { | 673 | { |
674 | public: | 674 | public: |
675 | _Slot6() { } | 675 | _Slot6() { } |
676 | virtual ~_Slot6() { } | 676 | virtual ~_Slot6() { } |
677 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )=0; | 677 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 )=0; |
678 | virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const=0; | 678 | virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const=0; |
679 | }; | 679 | }; |
680 | 680 | ||
681 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> | 681 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> |
682 | class __Slot6 : public _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> | 682 | class __Slot6 : public _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> |
683 | { | 683 | { |
684 | public: | 684 | public: |
685 | __Slot6( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) : | 685 | __Slot6( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) : |
686 | pCls( pCls ), pFnc( pFnc ) { } | 686 | pCls( pCls ), pFnc( pFnc ) { } |
687 | virtual ~__Slot6() { } | 687 | virtual ~__Slot6() { } |
688 | 688 | ||
689 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) | 689 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) |
690 | { | 690 | { |
691 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6 ); | 691 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6 ); |
692 | } | 692 | } |
693 | 693 | ||
694 | virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const | 694 | virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const |
695 | { | 695 | { |
696 | return new __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t>( pCls, pFnc ); | 696 | return new __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t>( pCls, pFnc ); |
697 | } | 697 | } |
698 | 698 | ||
699 | private: | 699 | private: |
700 | cls *pCls; | 700 | cls *pCls; |
701 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); | 701 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); |
702 | }; | 702 | }; |
703 | 703 | ||
704 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> | 704 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> |
705 | class __Slot6F : public _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> | 705 | class __Slot6F : public _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> |
706 | { | 706 | { |
707 | public: | 707 | public: |
708 | __Slot6F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) : | 708 | __Slot6F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) : |
709 | pFnc( pFnc ) { } | 709 | pFnc( pFnc ) { } |
710 | virtual ~__Slot6F() { } | 710 | virtual ~__Slot6F() { } |
711 | 711 | ||
712 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) | 712 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) |
713 | { | 713 | { |
714 | return (*pFnc)( p1, p2, p3, p4, p5, p6 ); | 714 | return (*pFnc)( p1, p2, p3, p4, p5, p6 ); |
715 | } | 715 | } |
716 | 716 | ||
717 | virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const | 717 | virtual _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *clone() const |
718 | { | 718 | { |
719 | return new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc ); | 719 | return new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc ); |
720 | } | 720 | } |
721 | 721 | ||
722 | private: | 722 | private: |
723 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); | 723 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ); |
724 | }; | 724 | }; |
725 | 725 | ||
726 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> | 726 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> |
727 | class Signal6 | 727 | class Signal6 |
728 | { | 728 | { |
729 | public: | 729 | public: |
730 | Signal6() : pCb( NULL ) { } | 730 | Signal6() : pCb( NULL ) { } |
731 | Signal6( _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *pCb ) : pCb( pCb ) { } | 731 | Signal6( _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *pCb ) : pCb( pCb ) { } |
732 | Signal6( const Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rSrc ) : | 732 | Signal6( const Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rSrc ) : |
733 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 733 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
734 | virtual ~Signal6() { delete pCb; pCb = NULL; } | 734 | virtual ~Signal6() { delete pCb; pCb = NULL; } |
735 | 735 | ||
736 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) | 736 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6 ) |
737 | { | 737 | { |
738 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 738 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
739 | return (*pCb)( p1, p2, p3, p4, p5, p6 ); | 739 | return (*pCb)( p1, p2, p3, p4, p5, p6 ); |
740 | } | 740 | } |
741 | 741 | ||
742 | bool isSet() const { return pCb != NULL; } | 742 | bool isSet() const { return pCb != NULL; } |
743 | operator bool() const { return isSet(); } | 743 | operator bool() const { return isSet(); } |
744 | 744 | ||
745 | Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &operator=( const Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rhs ) | 745 | Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &operator=( const Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> &rhs ) |
746 | { | 746 | { |
747 | pCb = rhs.pCb->clone(); | 747 | pCb = rhs.pCb->clone(); |
748 | return *this; | 748 | return *this; |
749 | } | 749 | } |
750 | 750 | ||
751 | private: | 751 | private: |
752 | _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *pCb; | 752 | _Slot6<ret, p1t, p2t, p3t, p4t, p5t, p6t> *pCb; |
753 | }; | 753 | }; |
754 | 754 | ||
755 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> | 755 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> |
756 | Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) | 756 | Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) |
757 | { | 757 | { |
758 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 758 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
759 | return Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t>( | 759 | return Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t>( |
760 | new __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t>( pCls, pFnc ) | 760 | new __Slot6<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t>( pCls, pFnc ) |
761 | ); | 761 | ); |
762 | } | 762 | } |
763 | 763 | ||
764 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> | 764 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t> |
765 | Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) | 765 | Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t ) ) |
766 | { | 766 | { |
767 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 767 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
768 | return Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t>( | 768 | return Signal6<ret, p1t, p2t, p3t, p4t, p5t, p6t>( |
769 | new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc ) | 769 | new __Slot6F<ret, p1t, p2t, p3t, p4t, p5t, p6t>( pFnc ) |
770 | ); | 770 | ); |
771 | } | 771 | } |
772 | #endif // BU_SIGNAL_PARAM_COUNT_6 | 772 | #endif // BU_SIGNAL_PARAM_COUNT_6 |
773 | 773 | ||
774 | #ifndef BU_SIGNAL_PARAM_COUNT_7 | 774 | #ifndef BU_SIGNAL_PARAM_COUNT_7 |
775 | #define BU_SIGNAL_PARAM_COUNT_7 | 775 | #define BU_SIGNAL_PARAM_COUNT_7 |
776 | // | 776 | // |
777 | // 7 Parameter(s) | 777 | // 7 Parameter(s) |
778 | // | 778 | // |
779 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> | 779 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> |
780 | class _Slot7 | 780 | class _Slot7 |
781 | { | 781 | { |
782 | public: | 782 | public: |
783 | _Slot7() { } | 783 | _Slot7() { } |
784 | virtual ~_Slot7() { } | 784 | virtual ~_Slot7() { } |
785 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 )=0; | 785 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 )=0; |
786 | virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const=0; | 786 | virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const=0; |
787 | }; | 787 | }; |
788 | 788 | ||
789 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> | 789 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> |
790 | class __Slot7 : public _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> | 790 | class __Slot7 : public _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> |
791 | { | 791 | { |
792 | public: | 792 | public: |
793 | __Slot7( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) : | 793 | __Slot7( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) : |
794 | pCls( pCls ), pFnc( pFnc ) { } | 794 | pCls( pCls ), pFnc( pFnc ) { } |
795 | virtual ~__Slot7() { } | 795 | virtual ~__Slot7() { } |
796 | 796 | ||
797 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) | 797 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) |
798 | { | 798 | { |
799 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7 ); | 799 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7 ); |
800 | } | 800 | } |
801 | 801 | ||
802 | virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const | 802 | virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const |
803 | { | 803 | { |
804 | return new __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pCls, pFnc ); | 804 | return new __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pCls, pFnc ); |
805 | } | 805 | } |
806 | 806 | ||
807 | private: | 807 | private: |
808 | cls *pCls; | 808 | cls *pCls; |
809 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); | 809 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); |
810 | }; | 810 | }; |
811 | 811 | ||
812 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> | 812 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> |
813 | class __Slot7F : public _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> | 813 | class __Slot7F : public _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> |
814 | { | 814 | { |
815 | public: | 815 | public: |
816 | __Slot7F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) : | 816 | __Slot7F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) : |
817 | pFnc( pFnc ) { } | 817 | pFnc( pFnc ) { } |
818 | virtual ~__Slot7F() { } | 818 | virtual ~__Slot7F() { } |
819 | 819 | ||
820 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) | 820 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) |
821 | { | 821 | { |
822 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7 ); | 822 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7 ); |
823 | } | 823 | } |
824 | 824 | ||
825 | virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const | 825 | virtual _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *clone() const |
826 | { | 826 | { |
827 | return new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc ); | 827 | return new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc ); |
828 | } | 828 | } |
829 | 829 | ||
830 | private: | 830 | private: |
831 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); | 831 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ); |
832 | }; | 832 | }; |
833 | 833 | ||
834 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> | 834 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> |
835 | class Signal7 | 835 | class Signal7 |
836 | { | 836 | { |
837 | public: | 837 | public: |
838 | Signal7() : pCb( NULL ) { } | 838 | Signal7() : pCb( NULL ) { } |
839 | Signal7( _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *pCb ) : pCb( pCb ) { } | 839 | Signal7( _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *pCb ) : pCb( pCb ) { } |
840 | Signal7( const Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rSrc ) : | 840 | Signal7( const Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rSrc ) : |
841 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 841 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
842 | virtual ~Signal7() { delete pCb; pCb = NULL; } | 842 | virtual ~Signal7() { delete pCb; pCb = NULL; } |
843 | 843 | ||
844 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) | 844 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7 ) |
845 | { | 845 | { |
846 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 846 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
847 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7 ); | 847 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7 ); |
848 | } | 848 | } |
849 | 849 | ||
850 | bool isSet() const { return pCb != NULL; } | 850 | bool isSet() const { return pCb != NULL; } |
851 | operator bool() const { return isSet(); } | 851 | operator bool() const { return isSet(); } |
852 | 852 | ||
853 | Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &operator=( const Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rhs ) | 853 | Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &operator=( const Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> &rhs ) |
854 | { | 854 | { |
855 | pCb = rhs.pCb->clone(); | 855 | pCb = rhs.pCb->clone(); |
856 | return *this; | 856 | return *this; |
857 | } | 857 | } |
858 | 858 | ||
859 | private: | 859 | private: |
860 | _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *pCb; | 860 | _Slot7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> *pCb; |
861 | }; | 861 | }; |
862 | 862 | ||
863 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> | 863 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> |
864 | Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) | 864 | Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) |
865 | { | 865 | { |
866 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 866 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
867 | return Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( | 867 | return Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( |
868 | new __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pCls, pFnc ) | 868 | new __Slot7<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pCls, pFnc ) |
869 | ); | 869 | ); |
870 | } | 870 | } |
871 | 871 | ||
872 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> | 872 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t> |
873 | Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) | 873 | Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t ) ) |
874 | { | 874 | { |
875 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 875 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
876 | return Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( | 876 | return Signal7<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( |
877 | new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc ) | 877 | new __Slot7F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t>( pFnc ) |
878 | ); | 878 | ); |
879 | } | 879 | } |
880 | #endif // BU_SIGNAL_PARAM_COUNT_7 | 880 | #endif // BU_SIGNAL_PARAM_COUNT_7 |
881 | 881 | ||
882 | #ifndef BU_SIGNAL_PARAM_COUNT_8 | 882 | #ifndef BU_SIGNAL_PARAM_COUNT_8 |
883 | #define BU_SIGNAL_PARAM_COUNT_8 | 883 | #define BU_SIGNAL_PARAM_COUNT_8 |
884 | // | 884 | // |
885 | // 8 Parameter(s) | 885 | // 8 Parameter(s) |
886 | // | 886 | // |
887 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> | 887 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> |
888 | class _Slot8 | 888 | class _Slot8 |
889 | { | 889 | { |
890 | public: | 890 | public: |
891 | _Slot8() { } | 891 | _Slot8() { } |
892 | virtual ~_Slot8() { } | 892 | virtual ~_Slot8() { } |
893 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 )=0; | 893 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 )=0; |
894 | virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const=0; | 894 | virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const=0; |
895 | }; | 895 | }; |
896 | 896 | ||
897 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> | 897 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> |
898 | class __Slot8 : public _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> | 898 | class __Slot8 : public _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> |
899 | { | 899 | { |
900 | public: | 900 | public: |
901 | __Slot8( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) : | 901 | __Slot8( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) : |
902 | pCls( pCls ), pFnc( pFnc ) { } | 902 | pCls( pCls ), pFnc( pFnc ) { } |
903 | virtual ~__Slot8() { } | 903 | virtual ~__Slot8() { } |
904 | 904 | ||
905 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) | 905 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) |
906 | { | 906 | { |
907 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8 ); | 907 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8 ); |
908 | } | 908 | } |
909 | 909 | ||
910 | virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const | 910 | virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const |
911 | { | 911 | { |
912 | return new __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pCls, pFnc ); | 912 | return new __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pCls, pFnc ); |
913 | } | 913 | } |
914 | 914 | ||
915 | private: | 915 | private: |
916 | cls *pCls; | 916 | cls *pCls; |
917 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); | 917 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); |
918 | }; | 918 | }; |
919 | 919 | ||
920 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> | 920 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> |
921 | class __Slot8F : public _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> | 921 | class __Slot8F : public _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> |
922 | { | 922 | { |
923 | public: | 923 | public: |
924 | __Slot8F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) : | 924 | __Slot8F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) : |
925 | pFnc( pFnc ) { } | 925 | pFnc( pFnc ) { } |
926 | virtual ~__Slot8F() { } | 926 | virtual ~__Slot8F() { } |
927 | 927 | ||
928 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) | 928 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) |
929 | { | 929 | { |
930 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8 ); | 930 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8 ); |
931 | } | 931 | } |
932 | 932 | ||
933 | virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const | 933 | virtual _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *clone() const |
934 | { | 934 | { |
935 | return new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc ); | 935 | return new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc ); |
936 | } | 936 | } |
937 | 937 | ||
938 | private: | 938 | private: |
939 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); | 939 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ); |
940 | }; | 940 | }; |
941 | 941 | ||
942 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> | 942 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> |
943 | class Signal8 | 943 | class Signal8 |
944 | { | 944 | { |
945 | public: | 945 | public: |
946 | Signal8() : pCb( NULL ) { } | 946 | Signal8() : pCb( NULL ) { } |
947 | Signal8( _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *pCb ) : pCb( pCb ) { } | 947 | Signal8( _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *pCb ) : pCb( pCb ) { } |
948 | Signal8( const Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rSrc ) : | 948 | Signal8( const Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rSrc ) : |
949 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 949 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
950 | virtual ~Signal8() { delete pCb; pCb = NULL; } | 950 | virtual ~Signal8() { delete pCb; pCb = NULL; } |
951 | 951 | ||
952 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) | 952 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8 ) |
953 | { | 953 | { |
954 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 954 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
955 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8 ); | 955 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8 ); |
956 | } | 956 | } |
957 | 957 | ||
958 | bool isSet() const { return pCb != NULL; } | 958 | bool isSet() const { return pCb != NULL; } |
959 | operator bool() const { return isSet(); } | 959 | operator bool() const { return isSet(); } |
960 | 960 | ||
961 | Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &operator=( const Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rhs ) | 961 | Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &operator=( const Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> &rhs ) |
962 | { | 962 | { |
963 | pCb = rhs.pCb->clone(); | 963 | pCb = rhs.pCb->clone(); |
964 | return *this; | 964 | return *this; |
965 | } | 965 | } |
966 | 966 | ||
967 | private: | 967 | private: |
968 | _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *pCb; | 968 | _Slot8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> *pCb; |
969 | }; | 969 | }; |
970 | 970 | ||
971 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> | 971 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> |
972 | Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) | 972 | Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) |
973 | { | 973 | { |
974 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 974 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
975 | return Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( | 975 | return Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( |
976 | new __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pCls, pFnc ) | 976 | new __Slot8<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pCls, pFnc ) |
977 | ); | 977 | ); |
978 | } | 978 | } |
979 | 979 | ||
980 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> | 980 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t> |
981 | Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) | 981 | Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t ) ) |
982 | { | 982 | { |
983 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 983 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
984 | return Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( | 984 | return Signal8<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( |
985 | new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc ) | 985 | new __Slot8F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t>( pFnc ) |
986 | ); | 986 | ); |
987 | } | 987 | } |
988 | #endif // BU_SIGNAL_PARAM_COUNT_8 | 988 | #endif // BU_SIGNAL_PARAM_COUNT_8 |
989 | 989 | ||
990 | #ifndef BU_SIGNAL_PARAM_COUNT_9 | 990 | #ifndef BU_SIGNAL_PARAM_COUNT_9 |
991 | #define BU_SIGNAL_PARAM_COUNT_9 | 991 | #define BU_SIGNAL_PARAM_COUNT_9 |
992 | // | 992 | // |
993 | // 9 Parameter(s) | 993 | // 9 Parameter(s) |
994 | // | 994 | // |
995 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> | 995 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> |
996 | class _Slot9 | 996 | class _Slot9 |
997 | { | 997 | { |
998 | public: | 998 | public: |
999 | _Slot9() { } | 999 | _Slot9() { } |
1000 | virtual ~_Slot9() { } | 1000 | virtual ~_Slot9() { } |
1001 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 )=0; | 1001 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 )=0; |
1002 | virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const=0; | 1002 | virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const=0; |
1003 | }; | 1003 | }; |
1004 | 1004 | ||
1005 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> | 1005 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> |
1006 | class __Slot9 : public _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> | 1006 | class __Slot9 : public _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> |
1007 | { | 1007 | { |
1008 | public: | 1008 | public: |
1009 | __Slot9( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) : | 1009 | __Slot9( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) : |
1010 | pCls( pCls ), pFnc( pFnc ) { } | 1010 | pCls( pCls ), pFnc( pFnc ) { } |
1011 | virtual ~__Slot9() { } | 1011 | virtual ~__Slot9() { } |
1012 | 1012 | ||
1013 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) | 1013 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) |
1014 | { | 1014 | { |
1015 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); | 1015 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); |
1016 | } | 1016 | } |
1017 | 1017 | ||
1018 | virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const | 1018 | virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const |
1019 | { | 1019 | { |
1020 | return new __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pCls, pFnc ); | 1020 | return new __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pCls, pFnc ); |
1021 | } | 1021 | } |
1022 | 1022 | ||
1023 | private: | 1023 | private: |
1024 | cls *pCls; | 1024 | cls *pCls; |
1025 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); | 1025 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); |
1026 | }; | 1026 | }; |
1027 | 1027 | ||
1028 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> | 1028 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> |
1029 | class __Slot9F : public _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> | 1029 | class __Slot9F : public _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> |
1030 | { | 1030 | { |
1031 | public: | 1031 | public: |
1032 | __Slot9F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) : | 1032 | __Slot9F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) : |
1033 | pFnc( pFnc ) { } | 1033 | pFnc( pFnc ) { } |
1034 | virtual ~__Slot9F() { } | 1034 | virtual ~__Slot9F() { } |
1035 | 1035 | ||
1036 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) | 1036 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) |
1037 | { | 1037 | { |
1038 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); | 1038 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); |
1039 | } | 1039 | } |
1040 | 1040 | ||
1041 | virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const | 1041 | virtual _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *clone() const |
1042 | { | 1042 | { |
1043 | return new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc ); | 1043 | return new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc ); |
1044 | } | 1044 | } |
1045 | 1045 | ||
1046 | private: | 1046 | private: |
1047 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); | 1047 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ); |
1048 | }; | 1048 | }; |
1049 | 1049 | ||
1050 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> | 1050 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> |
1051 | class Signal9 | 1051 | class Signal9 |
1052 | { | 1052 | { |
1053 | public: | 1053 | public: |
1054 | Signal9() : pCb( NULL ) { } | 1054 | Signal9() : pCb( NULL ) { } |
1055 | Signal9( _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *pCb ) : pCb( pCb ) { } | 1055 | Signal9( _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *pCb ) : pCb( pCb ) { } |
1056 | Signal9( const Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rSrc ) : | 1056 | Signal9( const Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rSrc ) : |
1057 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 1057 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
1058 | virtual ~Signal9() { delete pCb; pCb = NULL; } | 1058 | virtual ~Signal9() { delete pCb; pCb = NULL; } |
1059 | 1059 | ||
1060 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) | 1060 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9 ) |
1061 | { | 1061 | { |
1062 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 1062 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
1063 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); | 1063 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8, p9 ); |
1064 | } | 1064 | } |
1065 | 1065 | ||
1066 | bool isSet() const { return pCb != NULL; } | 1066 | bool isSet() const { return pCb != NULL; } |
1067 | operator bool() const { return isSet(); } | 1067 | operator bool() const { return isSet(); } |
1068 | 1068 | ||
1069 | Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &operator=( const Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rhs ) | 1069 | Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &operator=( const Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> &rhs ) |
1070 | { | 1070 | { |
1071 | pCb = rhs.pCb->clone(); | 1071 | pCb = rhs.pCb->clone(); |
1072 | return *this; | 1072 | return *this; |
1073 | } | 1073 | } |
1074 | 1074 | ||
1075 | private: | 1075 | private: |
1076 | _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *pCb; | 1076 | _Slot9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> *pCb; |
1077 | }; | 1077 | }; |
1078 | 1078 | ||
1079 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> | 1079 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> |
1080 | Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) | 1080 | Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) |
1081 | { | 1081 | { |
1082 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 1082 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
1083 | return Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( | 1083 | return Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( |
1084 | new __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pCls, pFnc ) | 1084 | new __Slot9<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pCls, pFnc ) |
1085 | ); | 1085 | ); |
1086 | } | 1086 | } |
1087 | 1087 | ||
1088 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> | 1088 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t> |
1089 | Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) | 1089 | Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t ) ) |
1090 | { | 1090 | { |
1091 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 1091 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
1092 | return Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( | 1092 | return Signal9<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( |
1093 | new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc ) | 1093 | new __Slot9F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t>( pFnc ) |
1094 | ); | 1094 | ); |
1095 | } | 1095 | } |
1096 | #endif // BU_SIGNAL_PARAM_COUNT_9 | 1096 | #endif // BU_SIGNAL_PARAM_COUNT_9 |
1097 | 1097 | ||
1098 | #ifndef BU_SIGNAL_PARAM_COUNT_10 | 1098 | #ifndef BU_SIGNAL_PARAM_COUNT_10 |
1099 | #define BU_SIGNAL_PARAM_COUNT_10 | 1099 | #define BU_SIGNAL_PARAM_COUNT_10 |
1100 | // | 1100 | // |
1101 | // 10 Parameter(s) | 1101 | // 10 Parameter(s) |
1102 | // | 1102 | // |
1103 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> | 1103 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> |
1104 | class _Slot10 | 1104 | class _Slot10 |
1105 | { | 1105 | { |
1106 | public: | 1106 | public: |
1107 | _Slot10() { } | 1107 | _Slot10() { } |
1108 | virtual ~_Slot10() { } | 1108 | virtual ~_Slot10() { } |
1109 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 )=0; | 1109 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 )=0; |
1110 | virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const=0; | 1110 | virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const=0; |
1111 | }; | 1111 | }; |
1112 | 1112 | ||
1113 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> | 1113 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> |
1114 | class __Slot10 : public _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> | 1114 | class __Slot10 : public _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> |
1115 | { | 1115 | { |
1116 | public: | 1116 | public: |
1117 | __Slot10( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) : | 1117 | __Slot10( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) : |
1118 | pCls( pCls ), pFnc( pFnc ) { } | 1118 | pCls( pCls ), pFnc( pFnc ) { } |
1119 | virtual ~__Slot10() { } | 1119 | virtual ~__Slot10() { } |
1120 | 1120 | ||
1121 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) | 1121 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) |
1122 | { | 1122 | { |
1123 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); | 1123 | return (pCls->*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const | 1126 | virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const |
1127 | { | 1127 | { |
1128 | return new __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pCls, pFnc ); | 1128 | return new __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pCls, pFnc ); |
1129 | } | 1129 | } |
1130 | 1130 | ||
1131 | private: | 1131 | private: |
1132 | cls *pCls; | 1132 | cls *pCls; |
1133 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); | 1133 | ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); |
1134 | }; | 1134 | }; |
1135 | 1135 | ||
1136 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> | 1136 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> |
1137 | class __Slot10F : public _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> | 1137 | class __Slot10F : public _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> |
1138 | { | 1138 | { |
1139 | public: | 1139 | public: |
1140 | __Slot10F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) : | 1140 | __Slot10F( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) : |
1141 | pFnc( pFnc ) { } | 1141 | pFnc( pFnc ) { } |
1142 | virtual ~__Slot10F() { } | 1142 | virtual ~__Slot10F() { } |
1143 | 1143 | ||
1144 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) | 1144 | virtual ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) |
1145 | { | 1145 | { |
1146 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); | 1146 | return (*pFnc)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); |
1147 | } | 1147 | } |
1148 | 1148 | ||
1149 | virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const | 1149 | virtual _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *clone() const |
1150 | { | 1150 | { |
1151 | return new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc ); | 1151 | return new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc ); |
1152 | } | 1152 | } |
1153 | 1153 | ||
1154 | private: | 1154 | private: |
1155 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); | 1155 | ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ); |
1156 | }; | 1156 | }; |
1157 | 1157 | ||
1158 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> | 1158 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> |
1159 | class Signal10 | 1159 | class Signal10 |
1160 | { | 1160 | { |
1161 | public: | 1161 | public: |
1162 | Signal10() : pCb( NULL ) { } | 1162 | Signal10() : pCb( NULL ) { } |
1163 | Signal10( _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *pCb ) : pCb( pCb ) { } | 1163 | Signal10( _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *pCb ) : pCb( pCb ) { } |
1164 | Signal10( const Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rSrc ) : | 1164 | Signal10( const Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rSrc ) : |
1165 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } | 1165 | pCb( (rSrc.pCb)?(rSrc.pCb->clone()):(NULL) ) { } |
1166 | virtual ~Signal10() { delete pCb; pCb = NULL; } | 1166 | virtual ~Signal10() { delete pCb; pCb = NULL; } |
1167 | 1167 | ||
1168 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) | 1168 | ret operator()( p1t p1, p2t p2, p3t p3, p4t p4, p5t p5, p6t p6, p7t p7, p8t p8, p9t p9, p10t p10 ) |
1169 | { | 1169 | { |
1170 | if( !pCb ) throw SignalException("Uninitialized signal called."); | 1170 | if( !pCb ) throw SignalException("Uninitialized signal called."); |
1171 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); | 1171 | return (*pCb)( p1, p2, p3, p4, p5, p6, p7, p8, p9, p10 ); |
1172 | } | 1172 | } |
1173 | 1173 | ||
1174 | bool isSet() const { return pCb != NULL; } | 1174 | bool isSet() const { return pCb != NULL; } |
1175 | operator bool() const { return isSet(); } | 1175 | operator bool() const { return isSet(); } |
1176 | 1176 | ||
1177 | Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &operator=( const Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rhs ) | 1177 | Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &operator=( const Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> &rhs ) |
1178 | { | 1178 | { |
1179 | pCb = rhs.pCb->clone(); | 1179 | pCb = rhs.pCb->clone(); |
1180 | return *this; | 1180 | return *this; |
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | private: | 1183 | private: |
1184 | _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *pCb; | 1184 | _Slot10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> *pCb; |
1185 | }; | 1185 | }; |
1186 | 1186 | ||
1187 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> | 1187 | template<typename cls, typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> |
1188 | Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) | 1188 | Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> slot( cls *pCls, ret (cls::*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) |
1189 | { | 1189 | { |
1190 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); | 1190 | if( !pCls || !pFnc ) throw SignalException("NULL pointer in slot()."); |
1191 | return Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( | 1191 | return Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( |
1192 | new __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pCls, pFnc ) | 1192 | new __Slot10<cls, ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pCls, pFnc ) |
1193 | ); | 1193 | ); |
1194 | } | 1194 | } |
1195 | 1195 | ||
1196 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> | 1196 | template<typename ret, typename p1t, typename p2t, typename p3t, typename p4t, typename p5t, typename p6t, typename p7t, typename p8t, typename p9t, typename p10t> |
1197 | Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) | 1197 | Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t> slot( ret (*pFnc)( p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t ) ) |
1198 | { | 1198 | { |
1199 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); | 1199 | if( !pFnc ) throw SignalException("NULL pointer in slot()."); |
1200 | return Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( | 1200 | return Signal10<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( |
1201 | new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc ) | 1201 | new __Slot10F<ret, p1t, p2t, p3t, p4t, p5t, p6t, p7t, p8t, p9t, p10t>( pFnc ) |
1202 | ); | 1202 | ); |
1203 | } | 1203 | } |
1204 | #endif // BU_SIGNAL_PARAM_COUNT_10 | 1204 | #endif // BU_SIGNAL_PARAM_COUNT_10 |
1205 | 1205 | ||
1206 | }; | 1206 | }; |