Sensor with Web Server

Dependencies:   EthernetInterface mbed-rpc mbed-rtos mbed

Committer:
afilipem
Date:
Tue Apr 08 12:13:32 2014 +0000
Revision:
0:c385e589a779
1 version;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
afilipem 0:c385e589a779 1 #ifndef REQUEST_HANDLER
afilipem 0:c385e589a779 2 #define REQUEST_HANDLER
afilipem 0:c385e589a779 3
afilipem 0:c385e589a779 4 #include "RPCCommand.h"
afilipem 0:c385e589a779 5
afilipem 0:c385e589a779 6 class RequestHandler
afilipem 0:c385e589a779 7 {
afilipem 0:c385e589a779 8 public :
afilipem 0:c385e589a779 9
afilipem 0:c385e589a779 10 virtual void handle(const RPCCommand& cmd, char* reply) = 0;
afilipem 0:c385e589a779 11 };
afilipem 0:c385e589a779 12
afilipem 0:c385e589a779 13 class GetRequestHandler : public RequestHandler
afilipem 0:c385e589a779 14 {
afilipem 0:c385e589a779 15 public :
afilipem 0:c385e589a779 16
afilipem 0:c385e589a779 17 virtual void handle(const RPCCommand& cmd, char* reply);
afilipem 0:c385e589a779 18 };
afilipem 0:c385e589a779 19
afilipem 0:c385e589a779 20 class PutRequestHandler : public RequestHandler
afilipem 0:c385e589a779 21 {
afilipem 0:c385e589a779 22 public :
afilipem 0:c385e589a779 23
afilipem 0:c385e589a779 24 virtual void handle(const RPCCommand& cmd, char* reply);
afilipem 0:c385e589a779 25
afilipem 0:c385e589a779 26 };
afilipem 0:c385e589a779 27
afilipem 0:c385e589a779 28
afilipem 0:c385e589a779 29 class DeleteRequestHandler : public RequestHandler
afilipem 0:c385e589a779 30 {
afilipem 0:c385e589a779 31 public :
afilipem 0:c385e589a779 32
afilipem 0:c385e589a779 33 virtual void handle(const RPCCommand& cmd, char* reply);
afilipem 0:c385e589a779 34
afilipem 0:c385e589a779 35 };
afilipem 0:c385e589a779 36
afilipem 0:c385e589a779 37 class ComplexRequestHandler : public RequestHandler
afilipem 0:c385e589a779 38 {
afilipem 0:c385e589a779 39 public :
afilipem 0:c385e589a779 40
afilipem 0:c385e589a779 41 virtual void handle(const RPCCommand& cmd, char* reply);
afilipem 0:c385e589a779 42
afilipem 0:c385e589a779 43 private :
afilipem 0:c385e589a779 44
afilipem 0:c385e589a779 45 GetRequestHandler getHandler;
afilipem 0:c385e589a779 46 PutRequestHandler putHandler;
afilipem 0:c385e589a779 47 DeleteRequestHandler deleteHandler;
afilipem 0:c385e589a779 48 };
afilipem 0:c385e589a779 49
afilipem 0:c385e589a779 50 #endif
afilipem 0:c385e589a779 51