30#ifndef PT_REMOTING_ACTIVEPROCEDURE_H
31#define PT_REMOTING_ACTIVEPROCEDURE_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>
68template <
typename R,
typename... As>
77 , _argv(&resp.context())
89 template <std::
size_t I>
97 template <std::
size_t I>
98 const auto&
arg()
const
100 return get<I>(_argv);
114 invokeWith(loop, std::index_sequence_for<As...>());
118 Decomposer* onEndCall()
135 template <std::size_t... Is>
142 template <
typename T>
146 Arguments<ValueType<As>...> _argv;
155template <
typename CallT>
177 return _cb->call(resp);
Manages the decomposition of types during serialization.
Definition Decomposer.h:185
void begin(const T &type, const char *name)
Begin decomposing a type.
Definition Decomposer.h:200
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
~ActiveProcedureDef()
Destructor.
Definition ActiveProcedure.h:169
ActiveProcedureDef(const Callable< CallT *, Responder & > &cb)
Constructs with a factory callback.
Definition ActiveProcedure.h:161
virtual void onInvoke(System::EventLoop &loop, const As &... args)=0
Start an asynchronous procedure.
const auto & arg() const
Access argument value by index.
Definition ActiveProcedure.h:98
auto & arg()
Access argument value by index.
Definition ActiveProcedure.h:90
virtual ~ActiveProcedure()
Destructor.
Definition ActiveProcedure.h:84
ActiveProcedure(Responder &resp)
Constructs with Responder.
Definition ActiveProcedure.h:74
virtual const R & onResult()=0
Return result of the asynchronous procedure.
Dispatches requests to a service procedure.
Definition Responder.h:50
Service procedure.
Definition ServiceProcedure.h:46
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