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>
52template <
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;
110template <
typename R,
typename... As>
111class BasicProcedureDef :
public ServiceProcedureDef
126 virtual ServiceProcedure* onCreateProcedure(Responder& resp)
const
128 return new BasicProcedure<R, As...>(*_cb, resp);
132 Callable<R, As...>* _cb;
Manages the decomposition of types during serialization.
Definition Decomposer.h:185
An interface for all callable entities.
Definition Callable.h:48
virtual Callable * clone() const =0
Returns a copy of this instance.
Composes types during serialization.
Definition Composer.h:101
Manages the decomposition of types during serialization.
Definition Decomposer.h:121
Dispatches requests to a service procedure.
Definition Responder.h:50
void setReady()
Indicates that the procedure has finished.
Definition ServiceProcedure.h:55
ServiceProcedure(Responder &r)
Constructor.
Definition ServiceProcedure.h:77
Event loop of a thread or process.
Definition EventLoop.h:83
Remote services and clients.
Definition HttpService.h:39
Core module.
Definition Allocator.h:33
IMPLEMENTATION_DEFINED Value
The derived value type.
Definition Api-TypeTraits.h:40