# Crow: crow::BaseRule Class Reference

crow::BaseRule Class Referenceabstract

A base class for all rules. More...

`#include <routing.h>`

Inheritance diagram for crow::BaseRule:

## Public Member Functions

| BaseRule (std::string rule)
virtual void | validate ()=0
std::unique_ptr< BaseRule > | upgrade ()
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< BaseRule > | rule_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:

- /home/farook/cppsrv/crow-0.3-fordoc/include/crow/routing.h