123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef BOOST_ASIO_WINDOWS_OVERLAPPED_PTR_HPP
- #define BOOST_ASIO_WINDOWS_OVERLAPPED_PTR_HPP
- #if defined(_MSC_VER) && (_MSC_VER >= 1200)
- # pragma once
- #endif
- #include <boost/asio/detail/push_options.hpp>
- #include <boost/asio/io_service.hpp>
- #include <boost/asio/detail/noncopyable.hpp>
- #include <boost/asio/detail/win_iocp_overlapped_ptr.hpp>
- #if !defined(BOOST_ASIO_DISABLE_WINDOWS_OVERLAPPED_PTR)
- # if defined(BOOST_ASIO_HAS_IOCP)
- # define BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR 1
- # endif
- #endif
- #if defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR) \
- || defined(GENERATING_DOCUMENTATION)
- namespace boost {
- namespace asio {
- namespace windows {
- class overlapped_ptr
- : private noncopyable
- {
- public:
-
- overlapped_ptr()
- : impl_()
- {
- }
-
- template <typename Handler>
- explicit overlapped_ptr(boost::asio::io_service& io_service, Handler handler)
- : impl_(io_service, handler)
- {
- }
-
- ~overlapped_ptr()
- {
- }
-
- void reset()
- {
- impl_.reset();
- }
-
-
- template <typename Handler>
- void reset(boost::asio::io_service& io_service, Handler handler)
- {
- impl_.reset(io_service, handler);
- }
-
- OVERLAPPED* get()
- {
- return impl_.get();
- }
-
- const OVERLAPPED* get() const
- {
- return impl_.get();
- }
-
- OVERLAPPED* release()
- {
- return impl_.release();
- }
-
- void complete(const boost::system::error_code& ec,
- std::size_t bytes_transferred)
- {
- impl_.complete(ec, bytes_transferred);
- }
- private:
- detail::win_iocp_overlapped_ptr impl_;
- };
- }
- }
- }
- #endif
-
- #include <boost/asio/detail/pop_options.hpp>
- #endif
|