web_application.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _WEB_APPLICATION_H_
00023 #define _WEB_APPLICATION_H_
00024
00025 #include <dcl/delegate.h>
00026 #include <dcl/exception.h>
00027 #include <dcl/http_header.h>
00028
00029 namespace dbp {
00030
00032
00039 class web_application_int {
00040 public:
00042 typedef delegate2<const std::exception&, http_response&, void>
00043 on_exception_handler;
00045 typedef delegate1<const http_request&, http_response> on_request_handler;
00047
00065 virtual void on_handle_request(on_request_handler handler) = 0;
00067
00074 virtual void on_exception(on_exception_handler handler) = 0;
00075 protected:
00076 virtual http_request get_request() = 0;
00077 virtual void send_response(const http_response&) = 0;
00078 };
00079
00080 }
00081
00082 #endif