diff options
Diffstat (limited to 'core/command_queue_mt.h')
-rw-r--r-- | core/command_queue_mt.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/core/command_queue_mt.h b/core/command_queue_mt.h index bae8cf7fca..83c90a925c 100644 --- a/core/command_queue_mt.h +++ b/core/command_queue_mt.h @@ -170,6 +170,43 @@ class CommandQueueMT { virtual void call() { (instance->*method)(p1, p2, p3, p4, p5, p6, p7, p8); } }; + template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> + struct Command9 : public CommandBase { + + T *instance; + M method; + typename GetSimpleTypeT<P1>::type_t p1; + typename GetSimpleTypeT<P2>::type_t p2; + typename GetSimpleTypeT<P3>::type_t p3; + typename GetSimpleTypeT<P4>::type_t p4; + typename GetSimpleTypeT<P5>::type_t p5; + typename GetSimpleTypeT<P6>::type_t p6; + typename GetSimpleTypeT<P7>::type_t p7; + typename GetSimpleTypeT<P8>::type_t p8; + typename GetSimpleTypeT<P9>::type_t p9; + + virtual void call() { (instance->*method)(p1, p2, p3, p4, p5, p6, p7, p8, p9); } + }; + + template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10> + struct Command10 : public CommandBase { + + T *instance; + M method; + typename GetSimpleTypeT<P1>::type_t p1; + typename GetSimpleTypeT<P2>::type_t p2; + typename GetSimpleTypeT<P3>::type_t p3; + typename GetSimpleTypeT<P4>::type_t p4; + typename GetSimpleTypeT<P5>::type_t p5; + typename GetSimpleTypeT<P6>::type_t p6; + typename GetSimpleTypeT<P7>::type_t p7; + typename GetSimpleTypeT<P8>::type_t p8; + typename GetSimpleTypeT<P9>::type_t p9; + typename GetSimpleTypeT<P10>::type_t p10; + + virtual void call() { (instance->*method)(p1, p2, p3, p4, p5, p6, p7, p8, p9, p10); } + }; + /* comands that return */ template <class T, class M, class R> @@ -779,6 +816,52 @@ public: if (sync) sync->post(); } + + template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9> + void push(T *p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9) { + + Command9<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9> *cmd = allocate_and_lock<Command9<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9> >(); + + cmd->instance = p_instance; + cmd->method = p_method; + cmd->p1 = p1; + cmd->p2 = p2; + cmd->p3 = p3; + cmd->p4 = p4; + cmd->p5 = p5; + cmd->p6 = p6; + cmd->p7 = p7; + cmd->p8 = p8; + cmd->p9 = p9; + + unlock(); + + if (sync) sync->post(); + } + + template <class T, class M, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10> + void push(T *p_instance, M p_method, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P6 p6, P7 p7, P8 p8, P9 p9, P10 p10) { + + Command10<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> *cmd = allocate_and_lock<Command10<T, M, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10> >(); + + cmd->instance = p_instance; + cmd->method = p_method; + cmd->p1 = p1; + cmd->p2 = p2; + cmd->p3 = p3; + cmd->p4 = p4; + cmd->p5 = p5; + cmd->p6 = p6; + cmd->p7 = p7; + cmd->p8 = p8; + cmd->p9 = p9; + cmd->p10 = p10; + + unlock(); + + if (sync) sync->post(); + } + /*** PUSH AND RET COMMANDS ***/ template <class T, class M, class R> |