Realistic 3D camera system
3D camera system components
basic_object_handle.hpp
Go to the documentation of this file.
1 //
2 // windows/basic_object_handle.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2015 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 // Copyright (c) 2011 Boris Schaeling (boris@highscore.de)
7 //
8 // Distributed under the Boost Software License, Version 1.0. (See accompanying
9 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
10 //
11 
12 #ifndef ASIO_WINDOWS_BASIC_OBJECT_HANDLE_HPP
13 #define ASIO_WINDOWS_BASIC_OBJECT_HANDLE_HPP
14 
15 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
16 # pragma once
17 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
18 
19 #include "asio/detail/config.hpp"
20 
21 #if defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE) \
22  || defined(GENERATING_DOCUMENTATION)
23 
25 #include "asio/error.hpp"
28 
30 
31 namespace asio {
32 namespace windows {
33 
35 
43 template <typename ObjectHandleService = object_handle_service>
44 class basic_object_handle
45  : public basic_handle<ObjectHandleService>
46 {
47 public:
49  typedef typename ObjectHandleService::native_handle_type native_handle_type;
50 
52 
58  explicit basic_object_handle(asio::io_service& io_service)
59  : basic_handle<ObjectHandleService>(io_service)
60  {
61  }
62 
64 
75  basic_object_handle(asio::io_service& io_service,
76  const native_handle_type& native_handle)
77  : basic_handle<ObjectHandleService>(io_service, native_handle)
78  {
79  }
80 
81 #if defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
82 
92  basic_object_handle(basic_object_handle&& other)
93  : basic_handle<ObjectHandleService>(
94  ASIO_MOVE_CAST(basic_object_handle)(other))
95  {
96  }
97 
99 
108  basic_object_handle& operator=(basic_object_handle&& other)
109  {
110  basic_handle<ObjectHandleService>::operator=(
111  ASIO_MOVE_CAST(basic_object_handle)(other));
112  return *this;
113  }
114 #endif // defined(ASIO_HAS_MOVE) || defined(GENERATING_DOCUMENTATION)
115 
117 
124  void wait()
125  {
126  asio::error_code ec;
127  this->get_service().wait(this->get_implementation(), ec);
128  asio::detail::throw_error(ec, "wait");
129  }
130 
132 
139  void wait(asio::error_code& ec)
140  {
141  this->get_service().wait(this->get_implementation(), ec);
142  }
143 
145 
160  template <typename WaitHandler>
161  ASIO_INITFN_RESULT_TYPE(WaitHandler,
162  void (asio::error_code))
163  async_wait(ASIO_MOVE_ARG(WaitHandler) handler)
164  {
165  return this->get_service().async_wait(this->get_implementation(),
166  ASIO_MOVE_CAST(WaitHandler)(handler));
167  }
168 };
169 
170 } // namespace windows
171 } // namespace asio
172 
174 
175 #endif // defined(ASIO_HAS_WINDOWS_OBJECT_HANDLE)
176  // || defined(GENERATING_DOCUMENTATION)
177 
178 #endif // ASIO_WINDOWS_BASIC_OBJECT_HANDLE_HPP
void throw_error(const asio::error_code &err)
Definition: throw_error.hpp:31
Provides core I/O functionality.
Definition: io_service.hpp:184
ASIO_INITFN_RESULT_TYPE(ComposedConnectHandler, void(asio::error_code, Iterator)) async_connect(basic_socket< Protocol
asio::basic_streambuf< Allocator > CompletionCondition ASIO_MOVE_ARG(ReadHandler) handler)
Definition: read.hpp:704
Class to represent an error code value.
Definition: error_code.hpp:80
#define ASIO_MOVE_CAST(type)
Definition: config.hpp:138