Web framework C++
2.0.0
Simple web framework on c++ designed to easily create web pages, etc
Main Page
Classes
Files
File List
File Members
•
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Pages
include
handler.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include "
context.h
"
5
13
class
Handler
{
14
bool
hasRoute;
15
Context
* context;
16
std::string route;
17
HTTP::Method
method;
18
Handler
* next;
19
protected
:
26
Context
*
getContext
();
27
public
:
36
explicit
Handler
(
const
char
* route =
nullptr
,
HTTP::Method
method = HTTP::Method::ANY,
Handler
* next =
nullptr
);
37
41
virtual
~Handler
();
42
49
virtual
void
setNext
(
Handler
* next);
50
57
virtual
void
add
(
Handler
* handler);
58
65
bool
isRouted
();
66
73
std::string
getRoute
();
74
81
HTTP::Method
getMethod
();
82
89
void
setContext
(
Context
* context);
90
95
void
handleRequest
();
96
100
virtual
void
exec
() = 0;
101
private
:
109
bool
shouldHandleRequest();
110
};
Handler::getRoute
std::string getRoute()
context.h
Handler::setNext
virtual void setNext(Handler *next)
Context
This class is wrapper for important data (like Response, DB, Middleware etc.), which is needed to han...
Definition:
context.h:17
Handler::setContext
void setContext(Context *context)
Handler::handleRequest
void handleRequest()
Handler::getMethod
HTTP::Method getMethod()
Handler::~Handler
virtual ~Handler()
Handler
object of this class executes every time on new request, this object (and others) construct response ...
Definition:
handler.h:13
Handler::getContext
Context * getContext()
Handler::add
virtual void add(Handler *handler)
Handler::exec
virtual void exec()=0
Handler::isRouted
bool isRouted()
Handler::Handler
Handler(const char *route=nullptr, HTTP::Method method=HTTP::Method::ANY, Handler *next=nullptr)
HTTP::Method
Method
Definition:
http.h:16
Generated by
1.8.11