A base class for all rules. More...
#include <routing.h>
Public Member Functions | |
BaseRule (std::string rule) | |
virtual void | validate ()=0 |
void | set_added () |
bool | is_added () |
std::unique_ptr< BaseRule > | upgrade () |
virtual void | handle (request &, response &, const routing_params &)=0 |
virtual void | handle_upgrade (const request &, response &res, SocketAdaptor &&) |
virtual void | handle_upgrade (const request &, response &res, SSLAdaptor &&) |
uint32_t | get_methods () |
template<typename F > | |
void | foreach_method (F f) |
const std::string & | rule () |
Public Attributes | |
std::string | custom_templates_base |
Protected Attributes | |
uint32_t | methods_ {1 << static_cast<int>(HTTPMethod::Get)} |
std::string | rule_ |
std::string | name_ |
bool | added_ {false} |
std::unique_ptr< BaseRule > | rule_to_upgrade_ |
detail::middleware_indices | mw_indices_ |
Friends | |
class | Router |
class | Blueprint |
template<typename T > | |
struct | RuleParameterTraits |
A base class for all rules.
Used to provide a common interface for code dealing with different types of rules.
A Rule provides a URL, allowed HTTP methods, and handlers.