sphttp.hpp
874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Copyright 2007 Stephen Liu
* For license terms, see the file COPYING along with this library.
*/
#ifndef __sphttp_hpp__
#define __sphttp_hpp__
#include "sphandler.hpp"
#include "spmsgdecoder.hpp"
class SP_HttpRequest;
class SP_HttpResponse;
class SP_HttpMsgParser;
class SP_HttpHandler {
public:
virtual ~SP_HttpHandler();
virtual void handle( SP_HttpRequest * request, SP_HttpResponse * response ) = 0;
virtual void error();
virtual void timeout();
};
class SP_HttpHandlerFactory {
public:
virtual ~SP_HttpHandlerFactory();
virtual SP_HttpHandler * create() const = 0;
};
class SP_HttpHandlerAdapterFactory : public SP_HandlerFactory {
public:
SP_HttpHandlerAdapterFactory( SP_HttpHandlerFactory * factory );
virtual ~SP_HttpHandlerAdapterFactory();
virtual SP_Handler * create() const;
private:
SP_HttpHandlerFactory * mFactory;
};
#endif