diff options
author | Shauren <shauren.trinity@gmail.com> | 2019-04-14 00:13:23 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2019-04-14 01:04:02 +0200 |
commit | d56c6710640e63fff6ead927b10d5135b9813bc6 (patch) | |
tree | 20acf562bed771e70e641d509ef97732542ed563 /src/common/Asio/IoContext.h | |
parent | 4040e06e03fd1a4690261a89a8401bb4e84bcfc5 (diff) |
Core/Dep: Boost 1.70 compatibility
(cherry picked from commit bcda8dd7421cfa1950a3e47081f2f28d032d38ac)
Diffstat (limited to 'src/common/Asio/IoContext.h')
-rw-r--r-- | src/common/Asio/IoContext.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/common/Asio/IoContext.h b/src/common/Asio/IoContext.h index e92222e8d0a..8ac0cc0a4e1 100644 --- a/src/common/Asio/IoContext.h +++ b/src/common/Asio/IoContext.h @@ -35,9 +35,24 @@ namespace Trinity { namespace Asio { - class IoContext : public IoContextBaseNamespace::IoContextBase + class IoContext { - using IoContextBaseNamespace::IoContextBase::IoContextBase; + public: + IoContext() : _impl() { } + explicit IoContext(int concurrency_hint) : _impl(concurrency_hint) { } + + operator IoContextBaseNamespace::IoContextBase&() { return _impl; } + operator IoContextBaseNamespace::IoContextBase const&() const { return _impl; } + + std::size_t run() { return _impl.run(); } + void stop() { _impl.stop(); } + +#if BOOST_VERSION >= 106600 + boost::asio::io_context::executor_type get_executor() noexcept { return _impl.get_executor(); } +#endif + + private: + IoContextBaseNamespace::IoContextBase _impl; }; template<typename T> |