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>
68 template <
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;
155 template <
typename CallT>
177 return _cb->call(resp);
188 #endif // PT_REMOTING_ACTIVEPROCEDURE_H
Core module.
Definition: Allocator.h:33
auto & arg()
Access argument value by index.
Definition: ActiveProcedure.h:90
An interface for all callable entities.
Definition: Callable.h:48
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
IMPLEMENTATION_DEFINED Value
The derived value type.
Definition: Api-TypeTraits.h:22
ActiveProcedure(Responder &resp)
Constructs with Responder.
Definition: ActiveProcedure.h:74
Dispatches requests to a service procedure.
Definition: Responder.h:50
const auto & arg() const
Access argument value by index.
Definition: ActiveProcedure.h:98
Service procedure.
Definition: ServiceProcedure.h:46
virtual const R & onResult()=0
Return result of the asynchronous procedure.
Thread-safe event loop supporting I/O multiplexing and Timers.
Definition: EventLoop.h:83
Composes types during serialization.
Definition: Composer.h:43
Definition of an asynchronous service procedure.
Definition: ActiveProcedure.h:157
virtual ~ActiveProcedure()
Destructor.
Definition: ActiveProcedure.h:84
virtual void onInvoke(System::EventLoop &loop, const As &... args)=0
Start an asynchronous procedure.
~ActiveProcedureDef()
Destructor.
Definition: ActiveProcedure.h:169
virtual Callable * clone() const =0
Returns a copy of this instance.
ActiveProcedureDef(const Callable< CallT *, Responder & > &cb)
Constructs with a factory callback.
Definition: ActiveProcedure.h:161
Asynchronous service procedure.
Definition: ActiveProcedure.h:70