00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052 #ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_THREAD_FUN_INL
00053 #define LASS_GUARDIAN_OF_INCLUSION_UTIL_THREAD_FUN_INL
00054
00055 #include "util_common.h"
00056 #include "thread_fun.h"
00057 #include "bind.h"
00058
00059 namespace lass
00060 {
00061 namespace util
00062 {
00063
00064
00065
00066
00067
00068 template <typename Function>
00069 ThreadFun* threadFun(
00070 Function function,
00071 ThreadKind kind)
00072 {
00073 return new ThreadFun(bind(function), kind);
00074 }
00075
00076
00077
00078
00079
00080 template <typename ObjectPtr, typename Method>
00081 ThreadFun* threadMemFun(
00082 ObjectPtr object, Method method,
00083 ThreadKind kind)
00084 {
00085 return new ThreadFun(bind(method, object), kind);
00086 }
00087
00088
00089
00090
00091
00092
00093
00094
00095 template <typename P1, typename Function>
00096 ThreadFun* threadFun(
00097 Function function,
00098 const P1& iP1,
00099 ThreadKind kind)
00100 {
00101 return new ThreadFun(bind(function, iP1), kind);
00102 }
00103
00104
00105
00106
00107
00108 template <typename P1, typename ObjectPtr, typename Method>
00109 ThreadFun* threadMemFun(
00110 ObjectPtr object, Method method,
00111 const P1& iP1,
00112 ThreadKind kind)
00113 {
00114 return new ThreadFun(bind(method, object, iP1), kind);
00115 }
00116
00117
00118
00119
00120
00121
00122
00123
00124 template <typename P1, typename P2, typename Function>
00125 ThreadFun* threadFun(
00126 Function function,
00127 const P1& iP1, const P2& iP2,
00128 ThreadKind kind)
00129 {
00130 return new ThreadFun(bind(function, iP1, iP2), kind);
00131 }
00132
00133
00134
00135
00136
00137 template <typename P1, typename P2, typename ObjectPtr, typename Method>
00138 ThreadFun* threadMemFun(
00139 ObjectPtr object, Method method,
00140 const P1& iP1, const P2& iP2,
00141 ThreadKind kind)
00142 {
00143 return new ThreadFun(bind(method, object, iP1, iP2), kind);
00144 }
00145
00146
00147
00148
00149
00150
00151
00152
00153 template <typename P1, typename P2, typename P3, typename Function>
00154 ThreadFun* threadFun(
00155 Function function,
00156 const P1& iP1, const P2& iP2, const P3& iP3,
00157 ThreadKind kind)
00158 {
00159 return new ThreadFun(bind(function, iP1, iP2, iP3), kind);
00160 }
00161
00162
00163
00164
00165
00166 template <typename P1, typename P2, typename P3, typename ObjectPtr, typename Method>
00167 ThreadFun* threadMemFun(
00168 ObjectPtr object, Method method,
00169 const P1& iP1, const P2& iP2, const P3& iP3,
00170 ThreadKind kind)
00171 {
00172 return new ThreadFun(bind(method, object, iP1, iP2, iP3), kind);
00173 }
00174
00175
00176
00177
00178
00179
00180
00181
00182 template <typename P1, typename P2, typename P3, typename P4, typename Function>
00183 ThreadFun* threadFun(
00184 Function function,
00185 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4,
00186 ThreadKind kind)
00187 {
00188 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4), kind);
00189 }
00190
00191
00192
00193
00194
00195 template <typename P1, typename P2, typename P3, typename P4, typename ObjectPtr, typename Method>
00196 ThreadFun* threadMemFun(
00197 ObjectPtr object, Method method,
00198 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4,
00199 ThreadKind kind)
00200 {
00201 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4), kind);
00202 }
00203
00204
00205
00206
00207
00208
00209
00210
00211 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename Function>
00212 ThreadFun* threadFun(
00213 Function function,
00214 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5,
00215 ThreadKind kind)
00216 {
00217 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5), kind);
00218 }
00219
00220
00221
00222
00223
00224 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename ObjectPtr, typename Method>
00225 ThreadFun* threadMemFun(
00226 ObjectPtr object, Method method,
00227 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5,
00228 ThreadKind kind)
00229 {
00230 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5), kind);
00231 }
00232
00233
00234
00235
00236
00237
00238
00239
00240 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename Function>
00241 ThreadFun* threadFun(
00242 Function function,
00243 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6,
00244 ThreadKind kind)
00245 {
00246 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6), kind);
00247 }
00248
00249
00250
00251
00252
00253 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename ObjectPtr, typename Method>
00254 ThreadFun* threadMemFun(
00255 ObjectPtr object, Method method,
00256 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6,
00257 ThreadKind kind)
00258 {
00259 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6), kind);
00260 }
00261
00262
00263
00264
00265
00266
00267
00268
00269 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename Function>
00270 ThreadFun* threadFun(
00271 Function function,
00272 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7,
00273 ThreadKind kind)
00274 {
00275 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7), kind);
00276 }
00277
00278
00279
00280
00281
00282 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename ObjectPtr, typename Method>
00283 ThreadFun* threadMemFun(
00284 ObjectPtr object, Method method,
00285 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7,
00286 ThreadKind kind)
00287 {
00288 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7), kind);
00289 }
00290
00291
00292
00293
00294
00295
00296
00297
00298 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename Function>
00299 ThreadFun* threadFun(
00300 Function function,
00301 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8,
00302 ThreadKind kind)
00303 {
00304 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8), kind);
00305 }
00306
00307
00308
00309
00310
00311 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename ObjectPtr, typename Method>
00312 ThreadFun* threadMemFun(
00313 ObjectPtr object, Method method,
00314 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8,
00315 ThreadKind kind)
00316 {
00317 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8), kind);
00318 }
00319
00320
00321
00322
00323
00324
00325
00326
00327 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename Function>
00328 ThreadFun* threadFun(
00329 Function function,
00330 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9,
00331 ThreadKind kind)
00332 {
00333 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9), kind);
00334 }
00335
00336
00337
00338
00339
00340 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename ObjectPtr, typename Method>
00341 ThreadFun* threadMemFun(
00342 ObjectPtr object, Method method,
00343 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9,
00344 ThreadKind kind)
00345 {
00346 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9), kind);
00347 }
00348
00349
00350
00351
00352
00353
00354
00355
00356 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename Function>
00357 ThreadFun* threadFun(
00358 Function function,
00359 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10,
00360 ThreadKind kind)
00361 {
00362 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10), kind);
00363 }
00364
00365
00366
00367
00368
00369 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename ObjectPtr, typename Method>
00370 ThreadFun* threadMemFun(
00371 ObjectPtr object, Method method,
00372 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10,
00373 ThreadKind kind)
00374 {
00375 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10), kind);
00376 }
00377
00378
00379
00380
00381
00382
00383
00384
00385 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename Function>
00386 ThreadFun* threadFun(
00387 Function function,
00388 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11,
00389 ThreadKind kind)
00390 {
00391 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11), kind);
00392 }
00393
00394
00395
00396
00397
00398 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename ObjectPtr, typename Method>
00399 ThreadFun* threadMemFun(
00400 ObjectPtr object, Method method,
00401 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11,
00402 ThreadKind kind)
00403 {
00404 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11), kind);
00405 }
00406
00407
00408
00409
00410
00411
00412
00413
00414 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename Function>
00415 ThreadFun* threadFun(
00416 Function function,
00417 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12,
00418 ThreadKind kind)
00419 {
00420 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12), kind);
00421 }
00422
00423
00424
00425
00426
00427 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename ObjectPtr, typename Method>
00428 ThreadFun* threadMemFun(
00429 ObjectPtr object, Method method,
00430 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12,
00431 ThreadKind kind)
00432 {
00433 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12), kind);
00434 }
00435
00436
00437
00438
00439
00440
00441
00442
00443 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename Function>
00444 ThreadFun* threadFun(
00445 Function function,
00446 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12, const P13& iP13,
00447 ThreadKind kind)
00448 {
00449 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12, iP13), kind);
00450 }
00451
00452
00453
00454
00455
00456 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename ObjectPtr, typename Method>
00457 ThreadFun* threadMemFun(
00458 ObjectPtr object, Method method,
00459 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12, const P13& iP13,
00460 ThreadKind kind)
00461 {
00462 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12, iP13), kind);
00463 }
00464
00465
00466
00467
00468
00469
00470
00471
00472 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14, typename Function>
00473 ThreadFun* threadFun(
00474 Function function,
00475 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12, const P13& iP13, const P14& iP14,
00476 ThreadKind kind)
00477 {
00478 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12, iP13, iP14), kind);
00479 }
00480
00481
00482
00483
00484
00485 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14, typename ObjectPtr, typename Method>
00486 ThreadFun* threadMemFun(
00487 ObjectPtr object, Method method,
00488 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12, const P13& iP13, const P14& iP14,
00489 ThreadKind kind)
00490 {
00491 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12, iP13, iP14), kind);
00492 }
00493
00494
00495
00496
00497
00498
00499
00500
00501 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14, typename P15, typename Function>
00502 ThreadFun* threadFun(
00503 Function function,
00504 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12, const P13& iP13, const P14& iP14, const P15& iP15,
00505 ThreadKind kind)
00506 {
00507 return new ThreadFun(bind(function, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12, iP13, iP14, iP15), kind);
00508 }
00509
00510
00511
00512
00513
00514 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename P11, typename P12, typename P13, typename P14, typename P15, typename ObjectPtr, typename Method>
00515 ThreadFun* threadMemFun(
00516 ObjectPtr object, Method method,
00517 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8, const P9& iP9, const P10& iP10, const P11& iP11, const P12& iP12, const P13& iP13, const P14& iP14, const P15& iP15,
00518 ThreadKind kind)
00519 {
00520 return new ThreadFun(bind(method, object, iP1, iP2, iP3, iP4, iP5, iP6, iP7, iP8, iP9, iP10, iP11, iP12, iP13, iP14, iP15), kind);
00521 }
00522
00523
00524
00525
00526 }
00527
00528 }
00529
00530 #endif
00531
00532