Realistic 3D camera system
3D camera system components
reactor_op.hpp
Go to the documentation of this file.
1 //
2 // detail/reactor_op.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_DETAIL_REACTOR_OP_HPP
12 #define ASIO_DETAIL_REACTOR_OP_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
20 
22 
23 namespace asio {
24 namespace detail {
25 
27  : public operation
28 {
29 public:
30  // The error code to be passed to the completion handler.
32 
33  // The number of bytes transferred, to be passed to the completion handler.
34  std::size_t bytes_transferred_;
35 
36  // Perform the operation. Returns true if it is finished.
37  bool perform()
38  {
39  return perform_func_(this);
40  }
41 
42 protected:
43  typedef bool (*perform_func_type)(reactor_op*);
44 
45  reactor_op(perform_func_type perform_func, func_type complete_func)
46  : operation(complete_func),
47  bytes_transferred_(0),
48  perform_func_(perform_func)
49  {
50  }
51 
52 private:
53  perform_func_type perform_func_;
54 };
55 
56 } // namespace detail
57 } // namespace asio
58 
60 
61 #endif // ASIO_DETAIL_REACTOR_OP_HPP
reactor_op(perform_func_type perform_func, func_type complete_func)
Definition: reactor_op.hpp:45
bool(* perform_func_type)(reactor_op *)
Definition: reactor_op.hpp:43
Class to represent an error code value.
Definition: error_code.hpp:80
task_io_service_operation operation
Definition: operation.hpp:32
asio::error_code ec_
Definition: reactor_op.hpp:31
std::size_t bytes_transferred_
Definition: reactor_op.hpp:34