#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) | |
bool | 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 30 of file http_request_handler.hpp.
typedef boost::function<bool(const HttpRequest&)> async_web_server_cpp::HttpRequestHandlerGroup::HandlerPredicate |
Definition at line 33 of file http_request_handler.hpp.
async_web_server_cpp::HttpRequestHandlerGroup::HttpRequestHandlerGroup | ( | HttpServerRequestHandler | default_handler | ) |
Definition at line 20 of file http_request_handler.cpp.
void async_web_server_cpp::HttpRequestHandlerGroup::addHandler | ( | HandlerPredicate | predicate, |
HttpServerRequestHandler | handler | ||
) |
Definition at line 49 of file http_request_handler.cpp.
void async_web_server_cpp::HttpRequestHandlerGroup::addHandlerForPath | ( | const std::string & | path_regex, |
HttpServerRequestHandler | handler | ||
) |
Definition at line 43 of file http_request_handler.cpp.
bool async_web_server_cpp::HttpRequestHandlerGroup::operator() | ( | const HttpRequest & | request, |
boost::shared_ptr< HttpConnection > | connection, | ||
const char * | begin, | ||
const char * | end | ||
) |
Definition at line 55 of file http_request_handler.cpp.
|
private |
Definition at line 48 of file http_request_handler.hpp.
|
private |
Definition at line 50 of file http_request_handler.hpp.