tufao  1.3.0
An asynchronous web framework for C++ built on top of Qt
Tufao::NotFoundHandler Class Reference

A handler that responds with "Not found" to every request. More...

+ Inheritance diagram for Tufao::NotFoundHandler:
+ Collaboration diagram for Tufao::NotFoundHandler:

Public Slots

bool handleRequest (Tufao::HttpServerRequest &request, Tufao::HttpServerResponse &response) override
 It responds to the request with a not found message.
 

Public Member Functions

 NotFoundHandler (QObject *parent=0)
 Constructs a NotFoundHandler object. More...
 
- Public Member Functions inherited from Tufao::AbstractHttpServerRequestHandler
 operator std::function< bool (HttpServerRequest &, HttpServerResponse &)>()
 Implicit conversion operator to std::function functor object. More...
 
virtual bool handleRequest (Tufao::HttpServerRequest &request, Tufao::HttpServerResponse &response)=0
 Handles the request using the response object. More...
 

Static Public Member Functions

static std::function< bool(HttpServerRequest &, HttpServerResponse &)> handler ()
 Returns a handler that don't depends on another object. More...
 

Detailed Description

A handler that responds with "Not found" to every request.

Its purpose is to avoid boilerplate code.

Since
1.0

Constructor & Destructor Documentation

Tufao::NotFoundHandler::NotFoundHandler ( QObject *  parent = 0)
explicit

Constructs a NotFoundHandler object.

parent is passed to the QObject constructor.

Member Function Documentation

std::function< bool(HttpServerRequest &, HttpServerResponse &)> Tufao::NotFoundHandler::handler ( )
inlinestatic

Returns a handler that don't depends on another object.

The purpose of this alternative handler is to free you of the worry of maintain the NotFoundHandler's object (lifetime) while the functor object is being used.


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