30#ifndef PT_REMOTING_SERVICEDEFINITION_H
31#define PT_REMOTING_SERVICEDEFINITION_H
33#include <Pt/Remoting/Api.h>
34#include <Pt/Remoting/ServiceProcedure.h>
35#include <Pt/System/Mutex.h>
36#include <Pt/NonCopyable.h>
82 template <
typename R,
typename... As>
85 ServiceProcedureDef* proc =
new BasicProcedureDef<R, As...>(
Pt::callable(func));
96 template <
typename R,
class C,
typename... As>
99 ServiceProcedureDef* proc =
new BasicProcedureDef<R, As...>(
callable(obj, mth) );
110 template <
typename R,
typename... As>
113 ServiceProcedureDef* proc =
new BasicProcedureDef<R, As...>(cb);
124 template <
typename A,
class C>
139 template <
typename A,
class C>
154 template <
typename A,
class C>
162 void registerProcedure(
const std::string& name, ServiceProcedureDef* proc);
169 typedef std::map<std::string, ServiceProcedureDef*> ProcedureMap;
170 ProcedureMap _procedures;
An interface for all callable entities.
Definition Callable.h:48
ConstMethod< R, ClassT, As... > callable(ClassT &object, R(BaseT::*method)(As...) const)
Returns a ConstMethod object for the given object/method pair.
Definition ConstMethod.h:161
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
Definition of an asynchronous service procedure.
Definition ActiveProcedure.h:157
Dispatches requests to a service procedure.
Definition Responder.h:50
void registerActiveProcedure(const std::string &name, C &obj, A *(C::*method)(Responder &))
Registers a member function as an asynchronous procedure.
Definition ServiceDefinition.h:140
void registerProcedure(const std::string &name, const Callable< R, As... > &cb)
Registers a generic callable as a synchronous procedure.
Definition ServiceDefinition.h:111
void registerActiveProcedure(const std::string &name, C &obj, A *(C::*method)(Responder &) const)
Registers a const member function as an asynchronous procedure.
Definition ServiceDefinition.h:155
ServiceDefinition()
Constructor.
void registerProcedure(const std::string &name, R(*func)(As...))
Registers a function as a synchronous procedure.
Definition ServiceDefinition.h:83
void registerProcedure(const std::string &name, C &obj, R(C::*mth)(As...))
Registers a member function as a synchronous procedure.
Definition ServiceDefinition.h:97
void registerActiveProcedure(const std::string &name, A *(*fn)(Responder &))
Registers a function as an asynchronous procedure.
Definition ServiceDefinition.h:125
virtual ~ServiceDefinition()
Destructor.
Service procedure.
Definition ServiceProcedure.h:46
Mutual exclusion device.
Definition Mutex.h:73
Remote services and clients.
Definition HttpService.h:39
Core module.
Definition Allocator.h:33