Dependents: SimpleLCDClock readCard2Twitter_http AnalogClock_StepperMotor_NTP ServoCamV1
services/http/server/impl/RpcHandler.h@0:a2dd0ba6cd2d, 2010-05-24 (annotated)
- Committer:
- donatien
- Date:
- Mon May 24 10:24:38 2010 +0000
- Revision:
- 0:a2dd0ba6cd2d
- Child:
- 1:7043cc0db03c
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 0:a2dd0ba6cd2d | 1 | #ifndef RPC_HANDLER_H |
donatien | 0:a2dd0ba6cd2d | 2 | #define RPC_HANDLER_H |
donatien | 0:a2dd0ba6cd2d | 3 | |
donatien | 0:a2dd0ba6cd2d | 4 | #include "../HttpRequestHandler.h" |
donatien | 0:a2dd0ba6cd2d | 5 | |
donatien | 0:a2dd0ba6cd2d | 6 | class RpcHandler : public HttpRequestHandler |
donatien | 0:a2dd0ba6cd2d | 7 | { |
donatien | 0:a2dd0ba6cd2d | 8 | public: |
donatien | 0:a2dd0ba6cd2d | 9 | RpcHandler(const char* rootPath, const char* path, TcpSocket* pTcpSocket); |
donatien | 0:a2dd0ba6cd2d | 10 | virtual ~RpcHandler(); |
donatien | 0:a2dd0ba6cd2d | 11 | |
donatien | 0:a2dd0ba6cd2d | 12 | //protected: |
donatien | 0:a2dd0ba6cd2d | 13 | static inline HttpRequestHandler* inst(const char* rootPath, const char* path, TcpSocket* pTcpSocket) { return new RpcHandler(rootPath, path, pTcpSocket); } //if we ever could do static virtual functions, this would be one |
donatien | 0:a2dd0ba6cd2d | 14 | |
donatien | 0:a2dd0ba6cd2d | 15 | virtual void doGet(); |
donatien | 0:a2dd0ba6cd2d | 16 | virtual void doPost(); |
donatien | 0:a2dd0ba6cd2d | 17 | virtual void doHead(); |
donatien | 0:a2dd0ba6cd2d | 18 | |
donatien | 0:a2dd0ba6cd2d | 19 | virtual void onReadable(); //Data has been read |
donatien | 0:a2dd0ba6cd2d | 20 | virtual void onWriteable(); //Data has been written & buf is free |
donatien | 0:a2dd0ba6cd2d | 21 | virtual void onClose(); //Connection is closing |
donatien | 0:a2dd0ba6cd2d | 22 | |
donatien | 0:a2dd0ba6cd2d | 23 | protected: |
donatien | 0:a2dd0ba6cd2d | 24 | void cleanReq(char* data); |
donatien | 0:a2dd0ba6cd2d | 25 | }; |
donatien | 0:a2dd0ba6cd2d | 26 | |
donatien | 0:a2dd0ba6cd2d | 27 | #endif |