#include <http_request_handler.hpp>
Public Types | |
typedef boost::function< bool(const HttpRequest &)> | HandlerPredicate |
Public Member Functions | |
void | addHandler (HandlerPredicate predicate, HttpServerRequestHandler handler) |
void | addHandlerForPath (const std::string &path_regex, HttpServerRequestHandler handler) |
HttpRequestHandlerGroup (HttpServerRequestHandler default_handler) | |
void | operator() (const HttpRequest &request, boost::shared_ptr< HttpConnection > connection, const char *begin, const char *end) |
Private Attributes | |
HttpServerRequestHandler | default_handler_ |
std::vector< std::pair < HandlerPredicate, HttpServerRequestHandler > > | handlers_ |
A hander that can dispatch to a request to different handlers depending on a predicate. If none of registered handlers satisfy the request then the default request handler is used.
Definition at line 20 of file http_request_handler.hpp.
typedef boost::function<bool(const HttpRequest &)> async_web_server_cpp::HttpRequestHandlerGroup::HandlerPredicate |
Definition at line 23 of file http_request_handler.hpp.
async_web_server_cpp::HttpRequestHandlerGroup::HttpRequestHandlerGroup | ( | HttpServerRequestHandler | default_handler | ) |
Definition at line 7 of file http_request_handler.cpp.
void async_web_server_cpp::HttpRequestHandlerGroup::addHandler | ( | HandlerPredicate | predicate, |
HttpServerRequestHandler | handler | ||
) |
Definition at line 34 of file http_request_handler.cpp.
void async_web_server_cpp::HttpRequestHandlerGroup::addHandlerForPath | ( | const std::string & | path_regex, |
HttpServerRequestHandler | handler | ||
) |
Definition at line 29 of file http_request_handler.cpp.
void async_web_server_cpp::HttpRequestHandlerGroup::operator() | ( | const HttpRequest & | request, |
boost::shared_ptr< HttpConnection > | connection, | ||
const char * | begin, | ||
const char * | end | ||
) |
Definition at line 40 of file http_request_handler.cpp.
Definition at line 34 of file http_request_handler.hpp.
std::vector<std::pair<HandlerPredicate, HttpServerRequestHandler> > async_web_server_cpp::HttpRequestHandlerGroup::handlers_ [private] |
Definition at line 35 of file http_request_handler.hpp.