Electroneum
Public Member Functions | Private Attributes | List of all members
crow::DynamicRule Class Reference

#include <routing.h>

Inheritance diagram for crow::DynamicRule:
Inheritance graph
[legend]
Collaboration diagram for crow::DynamicRule:
Collaboration graph
[legend]

Public Member Functions

 DynamicRule (std::string rule)
 
void validate () override
 
void handle (const request &req, response &res, const routing_params &params) override
 
template<typename Func >
void operator() (Func f)
 
template<typename Func , unsigned ... Indices>
std::function< void(const request &, response &, const routing_params &)> wrap (Func f, black_magic::seq< Indices... >)
 
template<typename Func >
void operator() (std::string name, Func &&f)
 
- Public Member Functions inherited from crow::BaseRule
 BaseRule (std::string rule)
 
virtual ~BaseRule ()
 
std::unique_ptr< BaseRuleupgrade ()
 
virtual void handle_upgrade (const request &, response &res, SocketAdaptor &&)
 
uint32_t get_methods ()
 
- Public Member Functions inherited from crow::RuleParameterTraits< DynamicRule >
WebSocketRulewebsocket ()
 
self_tname (std::string name) noexcept
 
self_tmethods (HTTPMethod method)
 
self_tmethods (HTTPMethod method, MethodArgs ... args_method)
 

Private Attributes

std::function< void(const request &, response &, const routing_params &)> erased_handler_
 

Additional Inherited Members

- Public Types inherited from crow::RuleParameterTraits< DynamicRule >
using self_t = DynamicRule
 
- Protected Attributes inherited from crow::BaseRule
uint32_t methods_ {1<<(int)HTTPMethod::Get}
 
std::string rule_
 
std::string name_
 
std::unique_ptr< BaseRulerule_to_upgrade_
 

Constructor & Destructor Documentation

◆ DynamicRule()

crow::DynamicRule::DynamicRule ( std::string  rule)
inline

Member Function Documentation

◆ handle()

void crow::DynamicRule::handle ( const request req,
response res,
const routing_params params 
)
inlineoverridevirtual

Implements crow::BaseRule.

◆ operator()() [1/2]

template<typename Func >
void crow::DynamicRule::operator() ( Func  f)
inline

◆ operator()() [2/2]

template<typename Func >
void crow::DynamicRule::operator() ( std::string  name,
Func &&  f 
)
inline

◆ validate()

void crow::DynamicRule::validate ( )
inlineoverridevirtual

Implements crow::BaseRule.

◆ wrap()

template<typename Func , unsigned ... Indices>
std::function<void(const request&, response&, const routing_params&)> crow::DynamicRule::wrap ( Func  f,
black_magic::seq< Indices... >   
)
inline

Member Data Documentation

◆ erased_handler_

std::function<void(const request&, response&, const routing_params&)> crow::DynamicRule::erased_handler_
private

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