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
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113 #ifndef LASS_GUARDIAN_OF_INCLUSION_UTIL_THREAD_FUN_H
00114 #define LASS_GUARDIAN_OF_INCLUSION_UTIL_THREAD_FUN_H
00115
00116 #include "util_common.h"
00117 #include "callback_0.h"
00118 #include "thread.h"
00119 #include "../meta/type_traits.h"
00120
00121 namespace lass
00122 {
00123 namespace util
00124 {
00125
00126 class LASS_DLL ThreadFun: public Thread
00127 {
00128 public:
00129 ThreadFun(const Callback0& fun, ThreadKind kind = threadDetached);
00130 private:
00131 void doRun();
00132 Callback0 fun_;
00133 };
00134
00135
00136
00137 template <typename Function>
00138 ThreadFun* threadFun(
00139 Function function,
00140 ThreadKind kind = threadDetached);
00141
00142 template <typename ObjectPtr, typename Method>
00143 ThreadFun* threadMemFun(
00144 ObjectPtr object, Method method,
00145 ThreadKind kind = threadDetached);
00146
00147
00148
00149
00150 template <typename P1, typename Function>
00151 ThreadFun* threadFun(
00152 Function function,
00153 const P1& iP1,
00154 ThreadKind kind = threadDetached);
00155
00156 template <typename P1, typename ObjectPtr, typename Method>
00157 ThreadFun* threadMemFun(
00158 ObjectPtr object, Method method,
00159 const P1& iP1,
00160 ThreadKind kind = threadDetached);
00161
00162
00163
00164 template <typename P1, typename P2, typename Function>
00165 ThreadFun* threadFun(
00166 Function function,
00167 const P1& iP1, const P2& iP2,
00168 ThreadKind kind = threadDetached);
00169
00170 template <typename P1, typename P2, typename ObjectPtr, typename Method>
00171 ThreadFun* threadMemFun(
00172 ObjectPtr object, Method method,
00173 const P1& iP1, const P2& iP2,
00174 ThreadKind kind = threadDetached);
00175
00176
00177
00178 template <typename P1, typename P2, typename P3, typename Function>
00179 ThreadFun* threadFun(
00180 Function function,
00181 const P1& iP1, const P2& iP2, const P3& iP3,
00182 ThreadKind kind = threadDetached);
00183
00184 template <typename P1, typename P2, typename P3, typename ObjectPtr, typename Method>
00185 ThreadFun* threadMemFun(
00186 ObjectPtr object, Method method,
00187 const P1& iP1, const P2& iP2, const P3& iP3,
00188 ThreadKind kind = threadDetached);
00189
00190
00191
00192 template <typename P1, typename P2, typename P3, typename P4, typename Function>
00193 ThreadFun* threadFun(
00194 Function function,
00195 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4,
00196 ThreadKind kind = threadDetached);
00197
00198 template <typename P1, typename P2, typename P3, typename P4, typename ObjectPtr, typename Method>
00199 ThreadFun* threadMemFun(
00200 ObjectPtr object, Method method,
00201 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4,
00202 ThreadKind kind = threadDetached);
00203
00204
00205
00206 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename Function>
00207 ThreadFun* threadFun(
00208 Function function,
00209 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5,
00210 ThreadKind kind = threadDetached);
00211
00212 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename ObjectPtr, typename Method>
00213 ThreadFun* threadMemFun(
00214 ObjectPtr object, Method method,
00215 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5,
00216 ThreadKind kind = threadDetached);
00217
00218
00219
00220 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename Function>
00221 ThreadFun* threadFun(
00222 Function function,
00223 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6,
00224 ThreadKind kind = threadDetached);
00225
00226 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename ObjectPtr, typename Method>
00227 ThreadFun* threadMemFun(
00228 ObjectPtr object, Method method,
00229 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6,
00230 ThreadKind kind = threadDetached);
00231
00232
00233
00234 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename Function>
00235 ThreadFun* threadFun(
00236 Function function,
00237 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7,
00238 ThreadKind kind = threadDetached);
00239
00240 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename ObjectPtr, typename Method>
00241 ThreadFun* threadMemFun(
00242 ObjectPtr object, Method method,
00243 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7,
00244 ThreadKind kind = threadDetached);
00245
00246
00247
00248 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename Function>
00249 ThreadFun* threadFun(
00250 Function function,
00251 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8,
00252 ThreadKind kind = threadDetached);
00253
00254 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename ObjectPtr, typename Method>
00255 ThreadFun* threadMemFun(
00256 ObjectPtr object, Method method,
00257 const P1& iP1, const P2& iP2, const P3& iP3, const P4& iP4, const P5& iP5, const P6& iP6, const P7& iP7, const P8& iP8,
00258 ThreadKind kind = threadDetached);
00259
00260
00261
00262 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename Function>
00263 ThreadFun* threadFun(
00264 Function function,
00265 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,
00266 ThreadKind kind = threadDetached);
00267
00268 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename ObjectPtr, typename Method>
00269 ThreadFun* threadMemFun(
00270 ObjectPtr object, Method method,
00271 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,
00272 ThreadKind kind = threadDetached);
00273
00274
00275
00276 template <typename P1, typename P2, typename P3, typename P4, typename P5, typename P6, typename P7, typename P8, typename P9, typename P10, typename Function>
00277 ThreadFun* threadFun(
00278 Function function,
00279 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,
00280 ThreadKind kind = threadDetached);
00281
00282 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>
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, const P8& iP8, const P9& iP9, const P10& iP10,
00286 ThreadKind kind = threadDetached);
00287
00288
00289
00290 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>
00291 ThreadFun* threadFun(
00292 Function function,
00293 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,
00294 ThreadKind kind = threadDetached);
00295
00296 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>
00297 ThreadFun* threadMemFun(
00298 ObjectPtr object, Method method,
00299 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,
00300 ThreadKind kind = threadDetached);
00301
00302
00303
00304 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>
00305 ThreadFun* threadFun(
00306 Function function,
00307 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,
00308 ThreadKind kind = threadDetached);
00309
00310 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>
00311 ThreadFun* threadMemFun(
00312 ObjectPtr object, Method method,
00313 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,
00314 ThreadKind kind = threadDetached);
00315
00316
00317
00318 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>
00319 ThreadFun* threadFun(
00320 Function function,
00321 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,
00322 ThreadKind kind = threadDetached);
00323
00324 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>
00325 ThreadFun* threadMemFun(
00326 ObjectPtr object, Method method,
00327 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,
00328 ThreadKind kind = threadDetached);
00329
00330
00331
00332 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>
00333 ThreadFun* threadFun(
00334 Function function,
00335 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,
00336 ThreadKind kind = threadDetached);
00337
00338 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>
00339 ThreadFun* threadMemFun(
00340 ObjectPtr object, Method method,
00341 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,
00342 ThreadKind kind = threadDetached);
00343
00344
00345
00346 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>
00347 ThreadFun* threadFun(
00348 Function function,
00349 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,
00350 ThreadKind kind = threadDetached);
00351
00352 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>
00353 ThreadFun* threadMemFun(
00354 ObjectPtr object, Method method,
00355 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,
00356 ThreadKind kind = threadDetached);
00357
00358
00359 }
00360
00361 }
00362
00363 #include "thread_fun.inl"
00364
00365 #endif
00366
00367