Crow  1.1
A C++ microframework for the web
crow::BaseRule Class Referenceabstract

A base class for all rules. More...

#include <routing.h>

Inheritance diagram for crow::BaseRule:
crow::DynamicRule crow::TaggedRule< Args > crow::WebSocketRule< App >

Public Member Functions

 BaseRule (std::string rule)
 
virtual void validate ()=0
 
void set_added ()
 
bool is_added ()
 
std::unique_ptr< BaseRuleupgrade ()
 
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< BaseRulerule_to_upgrade_
 
detail::middleware_indices mw_indices_
 

Friends

class Router
 
class Blueprint
 
template<typename T >
struct RuleParameterTraits
 

Detailed Description

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.


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