Chris@16
|
1 //
|
Chris@16
|
2 // detail/bind_handler.hpp
|
Chris@16
|
3 // ~~~~~~~~~~~~~~~~~~~~~~~
|
Chris@16
|
4 //
|
Chris@101
|
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
|
Chris@16
|
6 //
|
Chris@16
|
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
9 //
|
Chris@16
|
10
|
Chris@16
|
11 #ifndef BOOST_ASIO_DETAIL_BIND_HANDLER_HPP
|
Chris@16
|
12 #define BOOST_ASIO_DETAIL_BIND_HANDLER_HPP
|
Chris@16
|
13
|
Chris@16
|
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
15 # pragma once
|
Chris@16
|
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
|
Chris@16
|
17
|
Chris@16
|
18 #include <boost/asio/detail/config.hpp>
|
Chris@16
|
19 #include <boost/asio/detail/handler_alloc_helpers.hpp>
|
Chris@16
|
20 #include <boost/asio/detail/handler_cont_helpers.hpp>
|
Chris@16
|
21 #include <boost/asio/detail/handler_invoke_helpers.hpp>
|
Chris@16
|
22
|
Chris@16
|
23 #include <boost/asio/detail/push_options.hpp>
|
Chris@16
|
24
|
Chris@16
|
25 namespace boost {
|
Chris@16
|
26 namespace asio {
|
Chris@16
|
27 namespace detail {
|
Chris@16
|
28
|
Chris@16
|
29 template <typename Handler, typename Arg1>
|
Chris@16
|
30 class binder1
|
Chris@16
|
31 {
|
Chris@16
|
32 public:
|
Chris@16
|
33 binder1(const Handler& handler, const Arg1& arg1)
|
Chris@16
|
34 : handler_(handler),
|
Chris@16
|
35 arg1_(arg1)
|
Chris@16
|
36 {
|
Chris@16
|
37 }
|
Chris@16
|
38
|
Chris@16
|
39 binder1(Handler& handler, const Arg1& arg1)
|
Chris@16
|
40 : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
|
Chris@16
|
41 arg1_(arg1)
|
Chris@16
|
42 {
|
Chris@16
|
43 }
|
Chris@16
|
44
|
Chris@16
|
45 void operator()()
|
Chris@16
|
46 {
|
Chris@16
|
47 handler_(static_cast<const Arg1&>(arg1_));
|
Chris@16
|
48 }
|
Chris@16
|
49
|
Chris@16
|
50 void operator()() const
|
Chris@16
|
51 {
|
Chris@16
|
52 handler_(arg1_);
|
Chris@16
|
53 }
|
Chris@16
|
54
|
Chris@16
|
55 //private:
|
Chris@16
|
56 Handler handler_;
|
Chris@16
|
57 Arg1 arg1_;
|
Chris@16
|
58 };
|
Chris@16
|
59
|
Chris@16
|
60 template <typename Handler, typename Arg1>
|
Chris@16
|
61 inline void* asio_handler_allocate(std::size_t size,
|
Chris@16
|
62 binder1<Handler, Arg1>* this_handler)
|
Chris@16
|
63 {
|
Chris@16
|
64 return boost_asio_handler_alloc_helpers::allocate(
|
Chris@16
|
65 size, this_handler->handler_);
|
Chris@16
|
66 }
|
Chris@16
|
67
|
Chris@16
|
68 template <typename Handler, typename Arg1>
|
Chris@16
|
69 inline void asio_handler_deallocate(void* pointer, std::size_t size,
|
Chris@16
|
70 binder1<Handler, Arg1>* this_handler)
|
Chris@16
|
71 {
|
Chris@16
|
72 boost_asio_handler_alloc_helpers::deallocate(
|
Chris@16
|
73 pointer, size, this_handler->handler_);
|
Chris@16
|
74 }
|
Chris@16
|
75
|
Chris@16
|
76 template <typename Handler, typename Arg1>
|
Chris@16
|
77 inline bool asio_handler_is_continuation(
|
Chris@16
|
78 binder1<Handler, Arg1>* this_handler)
|
Chris@16
|
79 {
|
Chris@16
|
80 return boost_asio_handler_cont_helpers::is_continuation(
|
Chris@16
|
81 this_handler->handler_);
|
Chris@16
|
82 }
|
Chris@16
|
83
|
Chris@16
|
84 template <typename Function, typename Handler, typename Arg1>
|
Chris@16
|
85 inline void asio_handler_invoke(Function& function,
|
Chris@16
|
86 binder1<Handler, Arg1>* this_handler)
|
Chris@16
|
87 {
|
Chris@16
|
88 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
89 function, this_handler->handler_);
|
Chris@16
|
90 }
|
Chris@16
|
91
|
Chris@16
|
92 template <typename Function, typename Handler, typename Arg1>
|
Chris@16
|
93 inline void asio_handler_invoke(const Function& function,
|
Chris@16
|
94 binder1<Handler, Arg1>* this_handler)
|
Chris@16
|
95 {
|
Chris@16
|
96 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
97 function, this_handler->handler_);
|
Chris@16
|
98 }
|
Chris@16
|
99
|
Chris@16
|
100 template <typename Handler, typename Arg1>
|
Chris@16
|
101 inline binder1<Handler, Arg1> bind_handler(Handler handler,
|
Chris@16
|
102 const Arg1& arg1)
|
Chris@16
|
103 {
|
Chris@16
|
104 return binder1<Handler, Arg1>(handler, arg1);
|
Chris@16
|
105 }
|
Chris@16
|
106
|
Chris@16
|
107 template <typename Handler, typename Arg1, typename Arg2>
|
Chris@16
|
108 class binder2
|
Chris@16
|
109 {
|
Chris@16
|
110 public:
|
Chris@16
|
111 binder2(const Handler& handler, const Arg1& arg1, const Arg2& arg2)
|
Chris@16
|
112 : handler_(handler),
|
Chris@16
|
113 arg1_(arg1),
|
Chris@16
|
114 arg2_(arg2)
|
Chris@16
|
115 {
|
Chris@16
|
116 }
|
Chris@16
|
117
|
Chris@16
|
118 binder2(Handler& handler, const Arg1& arg1, const Arg2& arg2)
|
Chris@16
|
119 : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
|
Chris@16
|
120 arg1_(arg1),
|
Chris@16
|
121 arg2_(arg2)
|
Chris@16
|
122 {
|
Chris@16
|
123 }
|
Chris@16
|
124
|
Chris@16
|
125 void operator()()
|
Chris@16
|
126 {
|
Chris@16
|
127 handler_(static_cast<const Arg1&>(arg1_),
|
Chris@16
|
128 static_cast<const Arg2&>(arg2_));
|
Chris@16
|
129 }
|
Chris@16
|
130
|
Chris@16
|
131 void operator()() const
|
Chris@16
|
132 {
|
Chris@16
|
133 handler_(arg1_, arg2_);
|
Chris@16
|
134 }
|
Chris@16
|
135
|
Chris@16
|
136 //private:
|
Chris@16
|
137 Handler handler_;
|
Chris@16
|
138 Arg1 arg1_;
|
Chris@16
|
139 Arg2 arg2_;
|
Chris@16
|
140 };
|
Chris@16
|
141
|
Chris@16
|
142 template <typename Handler, typename Arg1, typename Arg2>
|
Chris@16
|
143 inline void* asio_handler_allocate(std::size_t size,
|
Chris@16
|
144 binder2<Handler, Arg1, Arg2>* this_handler)
|
Chris@16
|
145 {
|
Chris@16
|
146 return boost_asio_handler_alloc_helpers::allocate(
|
Chris@16
|
147 size, this_handler->handler_);
|
Chris@16
|
148 }
|
Chris@16
|
149
|
Chris@16
|
150 template <typename Handler, typename Arg1, typename Arg2>
|
Chris@16
|
151 inline void asio_handler_deallocate(void* pointer, std::size_t size,
|
Chris@16
|
152 binder2<Handler, Arg1, Arg2>* this_handler)
|
Chris@16
|
153 {
|
Chris@16
|
154 boost_asio_handler_alloc_helpers::deallocate(
|
Chris@16
|
155 pointer, size, this_handler->handler_);
|
Chris@16
|
156 }
|
Chris@16
|
157
|
Chris@16
|
158 template <typename Handler, typename Arg1, typename Arg2>
|
Chris@16
|
159 inline bool asio_handler_is_continuation(
|
Chris@16
|
160 binder2<Handler, Arg1, Arg2>* this_handler)
|
Chris@16
|
161 {
|
Chris@16
|
162 return boost_asio_handler_cont_helpers::is_continuation(
|
Chris@16
|
163 this_handler->handler_);
|
Chris@16
|
164 }
|
Chris@16
|
165
|
Chris@16
|
166 template <typename Function, typename Handler, typename Arg1, typename Arg2>
|
Chris@16
|
167 inline void asio_handler_invoke(Function& function,
|
Chris@16
|
168 binder2<Handler, Arg1, Arg2>* this_handler)
|
Chris@16
|
169 {
|
Chris@16
|
170 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
171 function, this_handler->handler_);
|
Chris@16
|
172 }
|
Chris@16
|
173
|
Chris@16
|
174 template <typename Function, typename Handler, typename Arg1, typename Arg2>
|
Chris@16
|
175 inline void asio_handler_invoke(const Function& function,
|
Chris@16
|
176 binder2<Handler, Arg1, Arg2>* this_handler)
|
Chris@16
|
177 {
|
Chris@16
|
178 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
179 function, this_handler->handler_);
|
Chris@16
|
180 }
|
Chris@16
|
181
|
Chris@16
|
182 template <typename Handler, typename Arg1, typename Arg2>
|
Chris@16
|
183 inline binder2<Handler, Arg1, Arg2> bind_handler(Handler handler,
|
Chris@16
|
184 const Arg1& arg1, const Arg2& arg2)
|
Chris@16
|
185 {
|
Chris@16
|
186 return binder2<Handler, Arg1, Arg2>(handler, arg1, arg2);
|
Chris@16
|
187 }
|
Chris@16
|
188
|
Chris@16
|
189 template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
|
Chris@16
|
190 class binder3
|
Chris@16
|
191 {
|
Chris@16
|
192 public:
|
Chris@16
|
193 binder3(const Handler& handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
194 const Arg3& arg3)
|
Chris@16
|
195 : handler_(handler),
|
Chris@16
|
196 arg1_(arg1),
|
Chris@16
|
197 arg2_(arg2),
|
Chris@16
|
198 arg3_(arg3)
|
Chris@16
|
199 {
|
Chris@16
|
200 }
|
Chris@16
|
201
|
Chris@16
|
202 binder3(Handler& handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
203 const Arg3& arg3)
|
Chris@16
|
204 : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
|
Chris@16
|
205 arg1_(arg1),
|
Chris@16
|
206 arg2_(arg2),
|
Chris@16
|
207 arg3_(arg3)
|
Chris@16
|
208 {
|
Chris@16
|
209 }
|
Chris@16
|
210
|
Chris@16
|
211 void operator()()
|
Chris@16
|
212 {
|
Chris@16
|
213 handler_(static_cast<const Arg1&>(arg1_),
|
Chris@16
|
214 static_cast<const Arg2&>(arg2_),
|
Chris@16
|
215 static_cast<const Arg3&>(arg3_));
|
Chris@16
|
216 }
|
Chris@16
|
217
|
Chris@16
|
218 void operator()() const
|
Chris@16
|
219 {
|
Chris@16
|
220 handler_(arg1_, arg2_, arg3_);
|
Chris@16
|
221 }
|
Chris@16
|
222
|
Chris@16
|
223 //private:
|
Chris@16
|
224 Handler handler_;
|
Chris@16
|
225 Arg1 arg1_;
|
Chris@16
|
226 Arg2 arg2_;
|
Chris@16
|
227 Arg3 arg3_;
|
Chris@16
|
228 };
|
Chris@16
|
229
|
Chris@16
|
230 template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
|
Chris@16
|
231 inline void* asio_handler_allocate(std::size_t size,
|
Chris@16
|
232 binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
|
Chris@16
|
233 {
|
Chris@16
|
234 return boost_asio_handler_alloc_helpers::allocate(
|
Chris@16
|
235 size, this_handler->handler_);
|
Chris@16
|
236 }
|
Chris@16
|
237
|
Chris@16
|
238 template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
|
Chris@16
|
239 inline void asio_handler_deallocate(void* pointer, std::size_t size,
|
Chris@16
|
240 binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
|
Chris@16
|
241 {
|
Chris@16
|
242 boost_asio_handler_alloc_helpers::deallocate(
|
Chris@16
|
243 pointer, size, this_handler->handler_);
|
Chris@16
|
244 }
|
Chris@16
|
245
|
Chris@16
|
246 template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
|
Chris@16
|
247 inline bool asio_handler_is_continuation(
|
Chris@16
|
248 binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
|
Chris@16
|
249 {
|
Chris@16
|
250 return boost_asio_handler_cont_helpers::is_continuation(
|
Chris@16
|
251 this_handler->handler_);
|
Chris@16
|
252 }
|
Chris@16
|
253
|
Chris@16
|
254 template <typename Function, typename Handler, typename Arg1, typename Arg2,
|
Chris@16
|
255 typename Arg3>
|
Chris@16
|
256 inline void asio_handler_invoke(Function& function,
|
Chris@16
|
257 binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
|
Chris@16
|
258 {
|
Chris@16
|
259 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
260 function, this_handler->handler_);
|
Chris@16
|
261 }
|
Chris@16
|
262
|
Chris@16
|
263 template <typename Function, typename Handler, typename Arg1, typename Arg2,
|
Chris@16
|
264 typename Arg3>
|
Chris@16
|
265 inline void asio_handler_invoke(const Function& function,
|
Chris@16
|
266 binder3<Handler, Arg1, Arg2, Arg3>* this_handler)
|
Chris@16
|
267 {
|
Chris@16
|
268 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
269 function, this_handler->handler_);
|
Chris@16
|
270 }
|
Chris@16
|
271
|
Chris@16
|
272 template <typename Handler, typename Arg1, typename Arg2, typename Arg3>
|
Chris@16
|
273 inline binder3<Handler, Arg1, Arg2, Arg3> bind_handler(Handler handler,
|
Chris@16
|
274 const Arg1& arg1, const Arg2& arg2, const Arg3& arg3)
|
Chris@16
|
275 {
|
Chris@16
|
276 return binder3<Handler, Arg1, Arg2, Arg3>(handler, arg1, arg2, arg3);
|
Chris@16
|
277 }
|
Chris@16
|
278
|
Chris@16
|
279 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
280 typename Arg4>
|
Chris@16
|
281 class binder4
|
Chris@16
|
282 {
|
Chris@16
|
283 public:
|
Chris@16
|
284 binder4(const Handler& handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
285 const Arg3& arg3, const Arg4& arg4)
|
Chris@16
|
286 : handler_(handler),
|
Chris@16
|
287 arg1_(arg1),
|
Chris@16
|
288 arg2_(arg2),
|
Chris@16
|
289 arg3_(arg3),
|
Chris@16
|
290 arg4_(arg4)
|
Chris@16
|
291 {
|
Chris@16
|
292 }
|
Chris@16
|
293
|
Chris@16
|
294 binder4(Handler& handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
295 const Arg3& arg3, const Arg4& arg4)
|
Chris@16
|
296 : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
|
Chris@16
|
297 arg1_(arg1),
|
Chris@16
|
298 arg2_(arg2),
|
Chris@16
|
299 arg3_(arg3),
|
Chris@16
|
300 arg4_(arg4)
|
Chris@16
|
301 {
|
Chris@16
|
302 }
|
Chris@16
|
303
|
Chris@16
|
304 void operator()()
|
Chris@16
|
305 {
|
Chris@16
|
306 handler_(static_cast<const Arg1&>(arg1_),
|
Chris@16
|
307 static_cast<const Arg2&>(arg2_),
|
Chris@16
|
308 static_cast<const Arg3&>(arg3_),
|
Chris@16
|
309 static_cast<const Arg4&>(arg4_));
|
Chris@16
|
310 }
|
Chris@16
|
311
|
Chris@16
|
312 void operator()() const
|
Chris@16
|
313 {
|
Chris@16
|
314 handler_(arg1_, arg2_, arg3_, arg4_);
|
Chris@16
|
315 }
|
Chris@16
|
316
|
Chris@16
|
317 //private:
|
Chris@16
|
318 Handler handler_;
|
Chris@16
|
319 Arg1 arg1_;
|
Chris@16
|
320 Arg2 arg2_;
|
Chris@16
|
321 Arg3 arg3_;
|
Chris@16
|
322 Arg4 arg4_;
|
Chris@16
|
323 };
|
Chris@16
|
324
|
Chris@16
|
325 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
326 typename Arg4>
|
Chris@16
|
327 inline void* asio_handler_allocate(std::size_t size,
|
Chris@16
|
328 binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
|
Chris@16
|
329 {
|
Chris@16
|
330 return boost_asio_handler_alloc_helpers::allocate(
|
Chris@16
|
331 size, this_handler->handler_);
|
Chris@16
|
332 }
|
Chris@16
|
333
|
Chris@16
|
334 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
335 typename Arg4>
|
Chris@16
|
336 inline void asio_handler_deallocate(void* pointer, std::size_t size,
|
Chris@16
|
337 binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
|
Chris@16
|
338 {
|
Chris@16
|
339 boost_asio_handler_alloc_helpers::deallocate(
|
Chris@16
|
340 pointer, size, this_handler->handler_);
|
Chris@16
|
341 }
|
Chris@16
|
342
|
Chris@16
|
343 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
344 typename Arg4>
|
Chris@16
|
345 inline bool asio_handler_is_continuation(
|
Chris@16
|
346 binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
|
Chris@16
|
347 {
|
Chris@16
|
348 return boost_asio_handler_cont_helpers::is_continuation(
|
Chris@16
|
349 this_handler->handler_);
|
Chris@16
|
350 }
|
Chris@16
|
351
|
Chris@16
|
352 template <typename Function, typename Handler, typename Arg1, typename Arg2,
|
Chris@16
|
353 typename Arg3, typename Arg4>
|
Chris@16
|
354 inline void asio_handler_invoke(Function& function,
|
Chris@16
|
355 binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
|
Chris@16
|
356 {
|
Chris@16
|
357 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
358 function, this_handler->handler_);
|
Chris@16
|
359 }
|
Chris@16
|
360
|
Chris@16
|
361 template <typename Function, typename Handler, typename Arg1, typename Arg2,
|
Chris@16
|
362 typename Arg3, typename Arg4>
|
Chris@16
|
363 inline void asio_handler_invoke(const Function& function,
|
Chris@16
|
364 binder4<Handler, Arg1, Arg2, Arg3, Arg4>* this_handler)
|
Chris@16
|
365 {
|
Chris@16
|
366 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
367 function, this_handler->handler_);
|
Chris@16
|
368 }
|
Chris@16
|
369
|
Chris@16
|
370 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
371 typename Arg4>
|
Chris@16
|
372 inline binder4<Handler, Arg1, Arg2, Arg3, Arg4> bind_handler(
|
Chris@16
|
373 Handler handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
374 const Arg3& arg3, const Arg4& arg4)
|
Chris@16
|
375 {
|
Chris@16
|
376 return binder4<Handler, Arg1, Arg2, Arg3, Arg4>(handler, arg1, arg2, arg3,
|
Chris@16
|
377 arg4);
|
Chris@16
|
378 }
|
Chris@16
|
379
|
Chris@16
|
380 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
381 typename Arg4, typename Arg5>
|
Chris@16
|
382 class binder5
|
Chris@16
|
383 {
|
Chris@16
|
384 public:
|
Chris@16
|
385 binder5(const Handler& handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
386 const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
|
Chris@16
|
387 : handler_(handler),
|
Chris@16
|
388 arg1_(arg1),
|
Chris@16
|
389 arg2_(arg2),
|
Chris@16
|
390 arg3_(arg3),
|
Chris@16
|
391 arg4_(arg4),
|
Chris@16
|
392 arg5_(arg5)
|
Chris@16
|
393 {
|
Chris@16
|
394 }
|
Chris@16
|
395
|
Chris@16
|
396 binder5(Handler& handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
397 const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
|
Chris@16
|
398 : handler_(BOOST_ASIO_MOVE_CAST(Handler)(handler)),
|
Chris@16
|
399 arg1_(arg1),
|
Chris@16
|
400 arg2_(arg2),
|
Chris@16
|
401 arg3_(arg3),
|
Chris@16
|
402 arg4_(arg4),
|
Chris@16
|
403 arg5_(arg5)
|
Chris@16
|
404 {
|
Chris@16
|
405 }
|
Chris@16
|
406
|
Chris@16
|
407 void operator()()
|
Chris@16
|
408 {
|
Chris@16
|
409 handler_(static_cast<const Arg1&>(arg1_),
|
Chris@16
|
410 static_cast<const Arg2&>(arg2_),
|
Chris@16
|
411 static_cast<const Arg3&>(arg3_),
|
Chris@16
|
412 static_cast<const Arg4&>(arg4_),
|
Chris@16
|
413 static_cast<const Arg5&>(arg5_));
|
Chris@16
|
414 }
|
Chris@16
|
415
|
Chris@16
|
416 void operator()() const
|
Chris@16
|
417 {
|
Chris@16
|
418 handler_(arg1_, arg2_, arg3_, arg4_, arg5_);
|
Chris@16
|
419 }
|
Chris@16
|
420
|
Chris@16
|
421 //private:
|
Chris@16
|
422 Handler handler_;
|
Chris@16
|
423 Arg1 arg1_;
|
Chris@16
|
424 Arg2 arg2_;
|
Chris@16
|
425 Arg3 arg3_;
|
Chris@16
|
426 Arg4 arg4_;
|
Chris@16
|
427 Arg5 arg5_;
|
Chris@16
|
428 };
|
Chris@16
|
429
|
Chris@16
|
430 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
431 typename Arg4, typename Arg5>
|
Chris@16
|
432 inline void* asio_handler_allocate(std::size_t size,
|
Chris@16
|
433 binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
|
Chris@16
|
434 {
|
Chris@16
|
435 return boost_asio_handler_alloc_helpers::allocate(
|
Chris@16
|
436 size, this_handler->handler_);
|
Chris@16
|
437 }
|
Chris@16
|
438
|
Chris@16
|
439 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
440 typename Arg4, typename Arg5>
|
Chris@16
|
441 inline void asio_handler_deallocate(void* pointer, std::size_t size,
|
Chris@16
|
442 binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
|
Chris@16
|
443 {
|
Chris@16
|
444 boost_asio_handler_alloc_helpers::deallocate(
|
Chris@16
|
445 pointer, size, this_handler->handler_);
|
Chris@16
|
446 }
|
Chris@16
|
447
|
Chris@16
|
448 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
449 typename Arg4, typename Arg5>
|
Chris@16
|
450 inline bool asio_handler_is_continuation(
|
Chris@16
|
451 binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
|
Chris@16
|
452 {
|
Chris@16
|
453 return boost_asio_handler_cont_helpers::is_continuation(
|
Chris@16
|
454 this_handler->handler_);
|
Chris@16
|
455 }
|
Chris@16
|
456
|
Chris@16
|
457 template <typename Function, typename Handler, typename Arg1, typename Arg2,
|
Chris@16
|
458 typename Arg3, typename Arg4, typename Arg5>
|
Chris@16
|
459 inline void asio_handler_invoke(Function& function,
|
Chris@16
|
460 binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
|
Chris@16
|
461 {
|
Chris@16
|
462 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
463 function, this_handler->handler_);
|
Chris@16
|
464 }
|
Chris@16
|
465
|
Chris@16
|
466 template <typename Function, typename Handler, typename Arg1, typename Arg2,
|
Chris@16
|
467 typename Arg3, typename Arg4, typename Arg5>
|
Chris@16
|
468 inline void asio_handler_invoke(const Function& function,
|
Chris@16
|
469 binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>* this_handler)
|
Chris@16
|
470 {
|
Chris@16
|
471 boost_asio_handler_invoke_helpers::invoke(
|
Chris@16
|
472 function, this_handler->handler_);
|
Chris@16
|
473 }
|
Chris@16
|
474
|
Chris@16
|
475 template <typename Handler, typename Arg1, typename Arg2, typename Arg3,
|
Chris@16
|
476 typename Arg4, typename Arg5>
|
Chris@16
|
477 inline binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5> bind_handler(
|
Chris@16
|
478 Handler handler, const Arg1& arg1, const Arg2& arg2,
|
Chris@16
|
479 const Arg3& arg3, const Arg4& arg4, const Arg5& arg5)
|
Chris@16
|
480 {
|
Chris@16
|
481 return binder5<Handler, Arg1, Arg2, Arg3, Arg4, Arg5>(handler, arg1, arg2,
|
Chris@16
|
482 arg3, arg4, arg5);
|
Chris@16
|
483 }
|
Chris@16
|
484
|
Chris@16
|
485 } // namespace detail
|
Chris@16
|
486 } // namespace asio
|
Chris@16
|
487 } // namespace boost
|
Chris@16
|
488
|
Chris@16
|
489 #include <boost/asio/detail/pop_options.hpp>
|
Chris@16
|
490
|
Chris@16
|
491 #endif // BOOST_ASIO_DETAIL_BIND_HANDLER_HPP
|