29#ifndef Pt_Http_Service_h
30#define Pt_Http_Service_h
32#include <Pt/Http/Api.h>
33#include <Pt/Http/Responder.h>
34#include <Pt/Http/Stream.h>
36#include <Pt/Allocator.h>
37#include <Pt/NonCopyable.h>
81 friend class ServerImpl;
131template <
typename R,
typename Alloc = Allocator>
148 void* r = _alloc.allocate(
sizeof(R) );
149 return new(r) R(*
this);
155 _alloc.deallocate( r,
sizeof(R) );
virtual Responder * onGetResponder(const Request &)
Creates a responder to handle request received by a server.
Definition Service.h:146
~BasicService()
Destructor.
Definition Service.h:142
virtual void onReleaseResponder(Responder *r)
Destroys a responder created by a server.
Definition Service.h:152
BasicService()
Default Constructor.
Definition Service.h:137
HTTP request message.
Definition Request.h:65
Handles one HTTP request and writes the reply.
Definition Responder.h:109
virtual ~Responder()
Destructor.
void releaseResponder(Responder *)
Destroys a responder created by a server.
Service()
Default Constructor.
Responder * getResponder(const Request &)
Creates a responder to handle request received by a server.
virtual ~Service()
Destructor.
virtual void onReleaseResponder(Responder *)=0
Destroys a responder created by a server.
virtual Responder * onGetResponder(const Request &)=0
Creates a responder to handle request received by a server.
virtual void onUpgrade(Stream &stream)
Called when a 101 reply has upgraded a connection.
One HTTP stream on a connection.
Definition Stream.h:90
NonCopyable()
Default constructor.
Definition NonCopyable.h:63
HTTP clients and servers.
Core module.
Definition Allocator.h:33