Crow  0.3
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

Public Member Functions

 BaseRule (std::string rule)
 
virtual void validate ()=0
 
std::unique_ptr< BaseRuleupgrade ()
 
virtual void handle (const request &, response &, const routing_params &)=0
 
virtual void handle_upgrade (const request &, response &res, SocketAdaptor &&)
 
uint32_t get_methods ()
 
template<typename F >
void foreach_method (F f)
 
const std::string & rule ()
 

Protected Attributes

uint32_t methods_ {1<<static_cast<int>(HTTPMethod::Get)}
 
std::string rule_
 
std::string name_
 
std::unique_ptr< BaseRulerule_to_upgrade_
 

Friends

class Router
 
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: