Webserver for peach-board
RequestHandler.h@0:6ec14f880a00, 2015-03-04 (annotated)
- Committer:
- thudt90
- Date:
- Wed Mar 04 02:16:31 2015 +0000
- Revision:
- 0:6ec14f880a00
add webserver
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
thudt90 | 0:6ec14f880a00 | 1 | #ifndef REQUEST_HANDLER |
thudt90 | 0:6ec14f880a00 | 2 | #define REQUEST_HANDLER |
thudt90 | 0:6ec14f880a00 | 3 | |
thudt90 | 0:6ec14f880a00 | 4 | #include "RPCCommand.h" |
thudt90 | 0:6ec14f880a00 | 5 | |
thudt90 | 0:6ec14f880a00 | 6 | class RequestHandler |
thudt90 | 0:6ec14f880a00 | 7 | { |
thudt90 | 0:6ec14f880a00 | 8 | public : |
thudt90 | 0:6ec14f880a00 | 9 | |
thudt90 | 0:6ec14f880a00 | 10 | virtual void handle(const RPCCommand& cmd, char* reply) = 0; |
thudt90 | 0:6ec14f880a00 | 11 | }; |
thudt90 | 0:6ec14f880a00 | 12 | |
thudt90 | 0:6ec14f880a00 | 13 | class GetRequestHandler : public RequestHandler |
thudt90 | 0:6ec14f880a00 | 14 | { |
thudt90 | 0:6ec14f880a00 | 15 | public : |
thudt90 | 0:6ec14f880a00 | 16 | |
thudt90 | 0:6ec14f880a00 | 17 | virtual void handle(const RPCCommand& cmd, char* reply); |
thudt90 | 0:6ec14f880a00 | 18 | }; |
thudt90 | 0:6ec14f880a00 | 19 | |
thudt90 | 0:6ec14f880a00 | 20 | class PutRequestHandler : public RequestHandler |
thudt90 | 0:6ec14f880a00 | 21 | { |
thudt90 | 0:6ec14f880a00 | 22 | public : |
thudt90 | 0:6ec14f880a00 | 23 | |
thudt90 | 0:6ec14f880a00 | 24 | virtual void handle(const RPCCommand& cmd, char* reply); |
thudt90 | 0:6ec14f880a00 | 25 | |
thudt90 | 0:6ec14f880a00 | 26 | }; |
thudt90 | 0:6ec14f880a00 | 27 | |
thudt90 | 0:6ec14f880a00 | 28 | |
thudt90 | 0:6ec14f880a00 | 29 | class DeleteRequestHandler : public RequestHandler |
thudt90 | 0:6ec14f880a00 | 30 | { |
thudt90 | 0:6ec14f880a00 | 31 | public : |
thudt90 | 0:6ec14f880a00 | 32 | |
thudt90 | 0:6ec14f880a00 | 33 | virtual void handle(const RPCCommand& cmd, char* reply); |
thudt90 | 0:6ec14f880a00 | 34 | |
thudt90 | 0:6ec14f880a00 | 35 | }; |
thudt90 | 0:6ec14f880a00 | 36 | |
thudt90 | 0:6ec14f880a00 | 37 | class ComplexRequestHandler : public RequestHandler |
thudt90 | 0:6ec14f880a00 | 38 | { |
thudt90 | 0:6ec14f880a00 | 39 | public : |
thudt90 | 0:6ec14f880a00 | 40 | |
thudt90 | 0:6ec14f880a00 | 41 | virtual void handle(const RPCCommand& cmd, char* reply); |
thudt90 | 0:6ec14f880a00 | 42 | |
thudt90 | 0:6ec14f880a00 | 43 | private : |
thudt90 | 0:6ec14f880a00 | 44 | |
thudt90 | 0:6ec14f880a00 | 45 | GetRequestHandler getHandler; |
thudt90 | 0:6ec14f880a00 | 46 | PutRequestHandler putHandler; |
thudt90 | 0:6ec14f880a00 | 47 | DeleteRequestHandler deleteHandler; |
thudt90 | 0:6ec14f880a00 | 48 | }; |
thudt90 | 0:6ec14f880a00 | 49 | |
thudt90 | 0:6ec14f880a00 | 50 | #endif |
thudt90 | 0:6ec14f880a00 | 51 |