roar
Loading...
Searching...
No Matches
Classes | Public Member Functions | Private Attributes | List of all members
Roar::Route Class Reference

A route represents the mapping of a verb+path to a user provided function. More...

#include <route.hpp>

Collaboration diagram for Roar::Route:

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< Implementationimpl_
 

Detailed Description

A route represents the mapping of a verb+path to a user provided function.

Constructor & Destructor Documentation

◆ Route()

Roar::Route::Route ( ProtoRoute  proto)

Member Function Documentation

◆ matches()

bool Roar::Route::matches ( std::string const &  path,
std::vector< std::string > &  matches 
) const

Does this route match the given path?

Parameters
pathA path to match.
matchesWill be filled with regex matches, if the route path is a regex.
Returns
true Does match!
false Does not match!

◆ operator()()

void Roar::Route::operator() ( Session session,
Request< boost::beast::http::empty_body >  req,
StandardResponseProvider const &  standardResponseProvider 
) const

Calls the associated function of this route.

Parameters
sessionThe corresponding http session.
reqA request object containing the http request.
standardResponseProviderA class that can make standard responses for 404, ... .

◆ ROAR_PIMPL_SPECIAL_FUNCTIONS()

Roar::Route::ROAR_PIMPL_SPECIAL_FUNCTIONS ( Route  )

Member Data Documentation

◆ impl_

std::unique_ptr<Implementation> Roar::Route::impl_
private

The documentation for this class was generated from the following files: