2
3
6
7
8
9
10
14#include <restinio/request_handler.hpp>
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
165 friend class builder_t;
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
191
192
193
194
195
196
201 return { std::move(m_chain) };
205
206
207 template<
typename Handler >
213 "a growable-size-chain builder that already "
216 m_chain->m_handlers.push_back(
217 growable_size_chain_t::handler_holder_t{
218 std::forward<Handler>(handler)
237
238
239
240
241
246
247
248
249
254 operator()(
const actual_request_handle_t & req )
const
256 for(
auto & h : m_handlers )
258 const request_handling_status_t result = h( req );
262 case request_handling_status_t::accepted:
263 case request_handling_status_t::rejected:
267 case request_handling_status_t::not_handled:
Exception class for all exceptions thrown by RESTinio.
exception_t(const char *err)
A builder of an instance of growable_size_chain.
std::unique_ptr< growable_size_chain_t > m_chain
void add(Handler &&handler)
Add a new handler to the chain.
std::unique_ptr< growable_size_chain_t > release() noexcept
Stop adding of new handlers and acquire the chain instance.
A holder of variable-size chain of synchronous handlers.
growable_size_chain_t()=delete
request_handling_status_t operator()(const actual_request_handle_t &req) const
growable_size_chain_t(creation_token_t)
The main constructor.
std::function< request_handling_status_t(const actual_request_handle_t &) > handler_holder_t
std::vector< handler_holder_t > m_handlers
constexpr request_handling_status_t request_not_handled() noexcept
request_handling_status_t
Request handling status.