Crow  1.0
A C++ microframework for the web
crow::TaggedRule< Args > Class Template Reference

Default rule created when CROW_ROUTE is called. More...

Inheritance diagram for crow::TaggedRule< Args >:
Collaboration diagram for crow::TaggedRule< Args >:

Public Types

using self_t = TaggedRule< Args... >
 

Public Member Functions

 TaggedRule (std::string rule)
 
void validate () override
 
template<typename Func >
void operator() (Func &&f)
 
template<typename Func >
void operator() (std::string name, Func &&f)
 
void handle (request &req, response &res, const routing_params &params) override
 
template<typename App , typename... Middlewares>
crow::detail::handler_call_bridge< TaggedRule< Args... >, App, Middlewares... > middlewares ()
 Enable local middleware for this handler. More...
 
std::unique_ptr< BaseRuleupgrade ()
 
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 ()
 
WebSocketRulewebsocket ()
 
self_tname (std::string name) noexcept
 
self_tmethods (HTTPMethod method)
 
self_tmethods (HTTPMethod method, MethodArgs... args_method)
 

Public Attributes

std::string custom_templates_base
 

Protected Attributes

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

Private Attributes

std::function< void(crow::request &, crow::response &, Args...)> handler_
 

Detailed Description

template<typename... Args>
class crow::TaggedRule< Args >

Default rule created when CROW_ROUTE is called.

Member Typedef Documentation

◆ self_t

template<typename... Args>
using crow::TaggedRule< Args >::self_t = TaggedRule<Args...>

Constructor & Destructor Documentation

◆ TaggedRule()

template<typename... Args>
crow::TaggedRule< Args >::TaggedRule ( std::string  rule)
inline

Member Function Documentation

◆ validate()

template<typename... Args>
void crow::TaggedRule< Args >::validate ( )
inlineoverridevirtual

Implements crow::BaseRule.

◆ operator()() [1/2]

template<typename... Args>
template<typename Func >
void crow::TaggedRule< Args >::operator() ( Func &&  f)
inline
Here is the call graph for this function:

◆ operator()() [2/2]

template<typename... Args>
template<typename Func >
void crow::TaggedRule< Args >::operator() ( std::string  name,
Func &&  f 
)
inline
Here is the call graph for this function:

◆ handle()

template<typename... Args>
void crow::TaggedRule< Args >::handle ( request req,
response res,
const routing_params &  params 
)
inlineoverridevirtual

Implements crow::BaseRule.

Here is the call graph for this function:

◆ middlewares()

template<typename... Args>
template<typename App , typename... Middlewares>
crow::detail::handler_call_bridge<TaggedRule<Args...>, App, Middlewares...> crow::TaggedRule< Args >::middlewares ( )
inline

Enable local middleware for this handler.

◆ upgrade()

std::unique_ptr<BaseRule> crow::BaseRule::upgrade ( )
inlineinherited

◆ handle_upgrade()

virtual void crow::BaseRule::handle_upgrade ( const request ,
response res,
SocketAdaptor &&   
)
inlinevirtualinherited

Reimplemented in crow::WebSocketRule.

Here is the call graph for this function:

◆ get_methods()

uint32_t crow::BaseRule::get_methods ( )
inlineinherited

◆ foreach_method()

template<typename F >
void crow::BaseRule::foreach_method ( f)
inlineinherited
Here is the caller graph for this function:

◆ rule()

const std::string& crow::BaseRule::rule ( )
inlineinherited

◆ websocket()

WebSocketRule& crow::RuleParameterTraits< TaggedRule< Args... > >::websocket
inlineinherited

◆ name()

self_t& crow::RuleParameterTraits< TaggedRule< Args... > >::name ( std::string  name)
inlinenoexceptinherited

◆ methods() [1/2]

self_t& crow::RuleParameterTraits< TaggedRule< Args... > >::methods ( HTTPMethod  method)
inlineinherited

◆ methods() [2/2]

self_t& crow::RuleParameterTraits< TaggedRule< Args... > >::methods ( HTTPMethod  method,
MethodArgs...  args_method 
)
inlineinherited

Member Data Documentation

◆ handler_

template<typename... Args>
std::function<void(crow::request&, crow::response&, Args...)> crow::TaggedRule< Args >::handler_
private

◆ custom_templates_base

std::string crow::BaseRule::custom_templates_base
inherited

◆ methods_

uint32_t crow::BaseRule::methods_ {1 << static_cast<int>(HTTPMethod::Get)}
protectedinherited

◆ rule_

std::string crow::BaseRule::rule_
protectedinherited

◆ name_

std::string crow::BaseRule::name_
protectedinherited

◆ rule_to_upgrade_

std::unique_ptr<BaseRule> crow::BaseRule::rule_to_upgrade_
protectedinherited

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