2 * This file is part of NumptyPhysics
3 * Copyright (C) 2008 Tim Edmonds
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 3 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
25 WorkerBase( void (*func
)(void*) ) { m_func
= func
; }
30 void (*m_func
)(void*);
34 template< typename A
, typename B
, typename C
>
35 class Worker
: public WorkerBase
38 typedef void (*F
)(A
,B
,C
);
40 Worker( F ff
, A aa
, B bb
, C cc
)
41 : f(ff
), a(aa
), b(bb
), c(cc
),
42 WorkerBase( worker
, this )
45 static void worker( void *s
)
47 Worker
* self
= (Worker
*)s
;
48 self
->f( self
->a
, self
->b
, self
->c
);