29 #ifndef PT_REMOTING_BASICPROCEDURE_H
30 #define PT_REMOTING_BASICPROCEDURE_H
32 #include <Pt/Remoting/Api.h>
33 #include <Pt/Remoting/ServiceProcedure.h>
34 #include <Pt/System/EventLoop.h>
35 #include <Pt/Decomposer.h>
36 #include <Pt/Composer.h>
37 #include <Pt/TypeTraits.h>
49 template <
typename R,
60 class BasicProcedure :
public ServiceProcedure
63 BasicProcedure(
const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>& cb, Responder& resp)
66 , _a1(&resp.context())
67 , _a2(&resp.context())
68 , _a3(&resp.context())
69 , _a4(&resp.context())
70 , _a5(&resp.context())
71 , _a6(&resp.context())
72 , _a7(&resp.context())
73 , _a8(&resp.context())
74 , _a9(&resp.context())
75 , _a10(&resp.context())
99 Composer** onBeginArgs()
115 virtual void onBeginCall(System::EventLoop&)
120 Decomposer* onEndCall()
122 _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9, _v10);
141 Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>* _cb;
155 BasicComposer<V1> _a1;
156 BasicComposer<V2> _a2;
157 BasicComposer<V3> _a3;
158 BasicComposer<V4> _a4;
159 BasicComposer<V5> _a5;
160 BasicComposer<V6> _a6;
161 BasicComposer<V7> _a7;
162 BasicComposer<V8> _a8;
163 BasicComposer<V9> _a9;
164 BasicComposer<V10> _a10;
165 BasicDecomposer<RV> _r;
170 template <
typename R,
180 class BasicProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9,
181 Pt::Void> :
public ServiceProcedure
184 BasicProcedure(
const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>& cb, Responder& resp)
187 , _a1(&resp.context())
188 , _a2(&resp.context())
189 , _a3(&resp.context())
190 , _a4(&resp.context())
191 , _a5(&resp.context())
192 , _a6(&resp.context())
193 , _a7(&resp.context())
194 , _a8(&resp.context())
195 , _a9(&resp.context())
196 , _r(&resp.context())
218 Composer** onBeginArgs()
233 virtual void onBeginCall(System::EventLoop&)
238 Decomposer* onEndCall()
240 _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8, _v9);
258 Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9>* _cb;
271 BasicComposer<V1> _a1;
272 BasicComposer<V2> _a2;
273 BasicComposer<V3> _a3;
274 BasicComposer<V4> _a4;
275 BasicComposer<V5> _a5;
276 BasicComposer<V6> _a6;
277 BasicComposer<V7> _a7;
278 BasicComposer<V8> _a8;
279 BasicComposer<V9> _a9;
280 BasicDecomposer<RV> _r;
285 template <
typename R,
294 class BasicProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8,
299 BasicProcedure(
const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8>& cb, Responder& resp)
302 , _a1(&resp.context())
303 , _a2(&resp.context())
304 , _a3(&resp.context())
305 , _a4(&resp.context())
306 , _a5(&resp.context())
307 , _a6(&resp.context())
308 , _a7(&resp.context())
309 , _a8(&resp.context())
310 , _r(&resp.context())
331 Composer** onBeginArgs()
345 virtual void onBeginCall(System::EventLoop&)
350 Decomposer* onEndCall()
352 _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7, _v8);
369 Callable<R, A1, A2, A3, A4, A5, A6, A7, A8>* _cb;
381 BasicComposer<V1> _a1;
382 BasicComposer<V2> _a2;
383 BasicComposer<V3> _a3;
384 BasicComposer<V4> _a4;
385 BasicComposer<V5> _a5;
386 BasicComposer<V6> _a6;
387 BasicComposer<V7> _a7;
388 BasicComposer<V8> _a8;
389 BasicDecomposer<RV> _r;
394 template <
typename R,
402 class BasicProcedure<R, A1, A2, A3, A4, A5, A6, A7,
408 BasicProcedure(
const Callable<R, A1, A2, A3, A4, A5, A6, A7>& cb, Responder& resp)
411 , _a1(&resp.context())
412 , _a2(&resp.context())
413 , _a3(&resp.context())
414 , _a4(&resp.context())
415 , _a5(&resp.context())
416 , _a6(&resp.context())
417 , _a7(&resp.context())
418 , _r(&resp.context())
438 Composer** onBeginArgs()
451 virtual void onBeginCall(System::EventLoop&)
456 Decomposer* onEndCall()
458 _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6, _v7);
474 Callable<R, A1, A2, A3, A4, A5, A6, A7>* _cb;
485 BasicComposer<V1> _a1;
486 BasicComposer<V2> _a2;
487 BasicComposer<V3> _a3;
488 BasicComposer<V4> _a4;
489 BasicComposer<V5> _a5;
490 BasicComposer<V6> _a6;
491 BasicComposer<V7> _a7;
492 BasicDecomposer<RV> _r;
497 template <
typename R,
504 class BasicProcedure<R, A1, A2, A3, A4, A5, A6,
511 BasicProcedure(
const Callable<R, A1, A2, A3, A4, A5, A6>& cb, Responder& resp)
514 , _a1(&resp.context())
515 , _a2(&resp.context())
516 , _a3(&resp.context())
517 , _a4(&resp.context())
518 , _a5(&resp.context())
519 , _a6(&resp.context())
520 , _r(&resp.context())
539 Composer** onBeginArgs()
551 virtual void onBeginCall(System::EventLoop&)
556 Decomposer* onEndCall()
558 _rv = _cb->call(_v1, _v2, _v3, _v4, _v5, _v6);
573 Callable<R, A1, A2, A3, A4, A5, A6>* _cb;
583 BasicComposer<V1> _a1;
584 BasicComposer<V2> _a2;
585 BasicComposer<V3> _a3;
586 BasicComposer<V4> _a4;
587 BasicComposer<V5> _a5;
588 BasicComposer<V6> _a6;
589 BasicDecomposer<RV> _r;
594 template <
typename R,
600 class BasicProcedure<R, A1, A2, A3, A4, A5,
608 BasicProcedure(
const Callable<R, A1, A2, A3, A4, A5>& cb, Responder& resp)
611 , _a1(&resp.context())
612 , _a2(&resp.context())
613 , _a3(&resp.context())
614 , _a4(&resp.context())
615 , _a5(&resp.context())
616 , _r(&resp.context())
634 Composer** onBeginArgs()
645 virtual void onBeginCall(System::EventLoop&)
650 Decomposer* onEndCall()
652 _rv = _cb->call(_v1, _v2, _v3, _v4, _v5);
666 Callable<R, A1, A2, A3, A4, A5>* _cb;
675 BasicComposer<V1> _a1;
676 BasicComposer<V2> _a2;
677 BasicComposer<V3> _a3;
678 BasicComposer<V4> _a4;
679 BasicComposer<V5> _a5;
680 BasicDecomposer<RV> _r;
685 template <
typename R,
690 class BasicProcedure<R, A1, A2, A3, A4,
699 BasicProcedure(
const Callable<R, A1, A2, A3, A4>& cb, Responder& resp)
702 , _a1(&resp.context())
703 , _a2(&resp.context())
704 , _a3(&resp.context())
705 , _a4(&resp.context())
706 , _r(&resp.context())
723 Composer** onBeginArgs()
733 virtual void onBeginCall(System::EventLoop&)
738 Decomposer* onEndCall()
740 _rv = _cb->call(_v1, _v2, _v3, _v4);
753 Callable<R, A1, A2, A3, A4>* _cb;
761 BasicComposer<V1> _a1;
762 BasicComposer<V2> _a2;
763 BasicComposer<V3> _a3;
764 BasicComposer<V4> _a4;
765 BasicDecomposer<RV> _r;
770 template <
typename R,
774 class BasicProcedure<R, A1, A2, A3,
784 BasicProcedure(
const Callable<R, A1, A2, A3>& cb, Responder& resp )
787 , _a1(&resp.context())
788 , _a2(&resp.context())
789 , _a3(&resp.context())
790 , _r(&resp.context())
806 Composer** onBeginArgs()
815 virtual void onBeginCall(System::EventLoop&)
820 Decomposer* onEndCall()
822 _rv = _cb->call(_v1, _v2, _v3);
834 Callable<R, A1, A2, A3>* _cb;
841 BasicComposer<V1> _a1;
842 BasicComposer<V2> _a2;
843 BasicComposer<V3> _a3;
844 BasicDecomposer<RV> _r;
849 template <
typename R,
852 class BasicProcedure<R, A1, A2,
863 BasicProcedure(
const Callable<R, A1, A2>& cb, Responder& resp )
866 , _a1(&resp.context())
867 , _a2(&resp.context())
868 , _r(&resp.context())
883 Composer** onBeginArgs()
891 virtual void onBeginCall(System::EventLoop&)
896 Decomposer* onEndCall()
898 _rv = _cb->call(_v1, _v2);
909 Callable<R, A1, A2>* _cb;
915 BasicComposer<V1> _a1;
916 BasicComposer<V2> _a2;
917 BasicDecomposer<RV> _r;
922 template <
typename R,
924 class BasicProcedure<R, A1,
936 BasicProcedure(
const Callable<R, A1>& cb, Responder& resp)
939 , _a1(&resp.context())
940 , _r(&resp.context())
954 Composer** onBeginArgs()
961 virtual void onBeginCall(System::EventLoop&)
966 Decomposer* onEndCall()
968 _rv = _cb->call(_v1);
977 Callable<R, A1>* _cb;
982 BasicComposer<V1> _a1;
983 BasicDecomposer<RV> _r;
991 template <
typename R>
992 class BasicProcedure<R,
1002 Pt::Void> :
public ServiceProcedure
1005 BasicProcedure(
const Callable<R>& cb, Responder& resp)
1008 , _r(&resp.context())
1021 Composer** onBeginArgs()
1026 virtual void onBeginCall(System::EventLoop&)
1031 Decomposer* onEndCall()
1045 BasicDecomposer<RV> _r;
1049 template <
typename R,
1060 class BasicProcedureDef :
public ServiceProcedureDef
1063 BasicProcedureDef(
const Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>& cb)
1069 ~BasicProcedureDef()
1075 virtual ServiceProcedure* onCreateProcedure(Responder& resp)
const
1077 return new BasicProcedure<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>( *_cb, resp );
1081 Callable<R, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>* _cb;
1088 #endif // PT_REMOTING_BASICPROCEDURE_H
ServiceProcedure(Responder &r)
Constructor.
Definition: ServiceProcedure.h:72
IMPLEMENTATION_DEFINED Value
The derived value type.
Definition: TypeTraits.h:21
void setReady()
Indicates that the procedure has finished.
Definition: ServiceProcedure.h:54
Void type.
Definition: Void.h:43