30 #ifndef PT_REMOTING_BASICPROCEDURE_H
31 #define PT_REMOTING_BASICPROCEDURE_H
33 #include <Pt/Remoting/Api.h>
34 #include <Pt/Remoting/Arguments.h>
35 #include <Pt/Remoting/ServiceProcedure.h>
36 #include <Pt/System/EventLoop.h>
37 #include <Pt/Decomposer.h>
38 #include <Pt/Composer.h>
39 #include <Pt/TypeTraits.h>
52 template <
typename R,
typename... As>
60 , _argv(&resp.context())
84 _rv = callWith(std::index_sequence_for<As...>());
90 template <std::size_t... Is>
91 R callWith(std::index_sequence<Is...>)
93 return _cb->
call(get<Is>(_argv)...);
105 Arguments<ValueType<As>...> _argv;
110 template <
typename R,
typename... As>
111 class BasicProcedureDef :
public ServiceProcedureDef
126 virtual ServiceProcedure* onCreateProcedure(Responder& resp)
const
128 return new BasicProcedure<R, As...>(*_cb, resp);
132 Callable<R, As...>* _cb;
139 #endif // PT_REMOTING_BASICPROCEDURE_H
Core module.
Definition: Allocator.h:33
Manages the decomposition of types during serialization.
Definition: Decomposer.h:44
Manages the decomposition of types during serialization.
Definition: Decomposer.h:108
void begin(const T &type, const char *name)
Begin decomposing a type.
Definition: Decomposer.h:123
ServiceProcedure(Responder &r)
Constructor.
Definition: ServiceProcedure.h:77
IMPLEMENTATION_DEFINED Value
The derived value type.
Definition: Api-TypeTraits.h:22
Dispatches requests to a service procedure.
Definition: Responder.h:50
Service procedure.
Definition: ServiceProcedure.h:46
Thread-safe event loop supporting I/O multiplexing and Timers.
Definition: EventLoop.h:83
Composes types during serialization.
Definition: Composer.h:43
Generic service procedure.
Definition: BasicProcedure.h:54
virtual Callable * clone() const =0
Returns a copy of this instance.
void setReady()
Indicates that the procedure has finished.
Definition: ServiceProcedure.h:55
virtual R call(As... args) const =0
Calls the callable entity and returns its result.