看io_service類裡的成員impl_, 貼幾段程式碼你應該就明白了,
C/C++ code?
1
2
3
4
5
6
7
8
9
10
// io_service.hpp
typedef class task_io_service io_service_impl;
...
class io_service: private noncopyable
{
private:
typedef detail::io_service_impl impl_type;
impl_type& impl_;
};
// detail/task_io_service.hpp
#include
class task_io_service
: public boost::asio::detail::service_base
reactor* task_;
看io_service類裡的成員impl_, 貼幾段程式碼你應該就明白了,
C/C++ code?
1
2
3
4
5
6
7
8
9
10
// io_service.hpp
typedef class task_io_service io_service_impl;
...
class io_service: private noncopyable
{
private:
typedef detail::io_service_impl impl_type;
...
impl_type& impl_;
};
C/C++ code?
1
2
3
4
5
6
7
8
9
10
// detail/task_io_service.hpp
#include
...
class task_io_service
: public boost::asio::detail::service_base
{
...
reactor* task_;
...
};