roar
|
A route represents the mapping of a verb+path to a user provided function. More...
#include <route.hpp>
Classes | |
struct | Implementation |
Public Member Functions | |
Route (ProtoRoute proto) | |
ROAR_PIMPL_SPECIAL_FUNCTIONS (Route) | |
void | operator() (Session &session, Request< boost::beast::http::empty_body > req, StandardResponseProvider const &standardResponseProvider) const |
Calls the associated function of this route. | |
bool | matches (std::string const &path, std::vector< std::string > &matches) const |
Does this route match the given path? | |
Private Attributes | |
std::unique_ptr< Implementation > | impl_ |
A route represents the mapping of a verb+path to a user provided function.
Roar::Route::Route | ( | ProtoRoute | proto | ) |
bool Roar::Route::matches | ( | std::string const & | path, |
std::vector< std::string > & | matches | ||
) | const |
Does this route match the given path?
path | A path to match. |
matches | Will be filled with regex matches, if the route path is a regex. |
void Roar::Route::operator() | ( | Session & | session, |
Request< boost::beast::http::empty_body > | req, | ||
StandardResponseProvider const & | standardResponseProvider | ||
) | const |
Calls the associated function of this route.
session | The corresponding http session. |
req | A request object containing the http request. |
standardResponseProvider | A class that can make standard responses for 404, ... . |
Roar::Route::ROAR_PIMPL_SPECIAL_FUNCTIONS | ( | Route | ) |
|
private |