CppWAMP
C++11 client library for the WAMP protocol
asiodefs.hpp
Go to the documentation of this file.
1 /*------------------------------------------------------------------------------
2  Copyright Butterfly Energy Systems 2014-2015, 2022.
3  Distributed under the Boost Software License, Version 1.0.
4  http://www.boost.org/LICENSE_1_0.txt
5 ------------------------------------------------------------------------------*/
6 
7 #ifndef CPPWAMP_ASIODEFS_HPP
8 #define CPPWAMP_ASIODEFS_HPP
9 
10 //------------------------------------------------------------------------------
14 //------------------------------------------------------------------------------
15 
16 #include <type_traits>
17 #include <boost/asio/any_io_executor.hpp>
18 #include <boost/asio/io_context.hpp>
19 #include <boost/asio/strand.hpp>
20 #include <boost/system/error_code.hpp>
21 #include "config.hpp"
22 
23 namespace wamp
24 {
25 
27 using AnyIoExecutor = boost::asio::any_io_executor;
28 
31 using AnyExecutor CPPWAMP_DEPRECATED = AnyIoExecutor;
32 
34 using AsioContext = boost::asio::io_context;
35 
38 using AsioService CPPWAMP_DEPRECATED = AsioContext;
39 
41 using IoStrand = boost::asio::strand<AnyIoExecutor>;
42 
44 using AsioErrorCode = boost::system::error_code;
45 
48 template <typename T>
49 static constexpr bool isExecutionContext()
50 {
51  return std::is_base_of<boost::asio::execution_context, T>::value;
52 }
53 
54 } // namespace wamp
55 
56 #endif // CPPWAMP_ASIODEFS_HPP
wamp::AnyIoExecutor
boost::asio::any_io_executor AnyIoExecutor
Polymorphic executor for all I/O objects.
Definition: asiodefs.hpp:27
wamp::AsioService
AsioContext AsioService
Alias of AsioContext kept for backward compatibility.
Definition: asiodefs.hpp:38
wamp::IoStrand
boost::asio::strand< AnyIoExecutor > IoStrand
Serializes I/O operations.
Definition: asiodefs.hpp:41
wamp::AnyExecutor
AnyIoExecutor AnyExecutor
Alias of AnyIoExecutor kept for backward compatibility.
Definition: asiodefs.hpp:31
wamp
Definition: anyhandler.hpp:36
wamp::AsioErrorCode
boost::system::error_code AsioErrorCode
Type used by Boost.Asio for reporting errors.
Definition: asiodefs.hpp:44
wamp::AsioContext
boost::asio::io_context AsioContext
Queues and runs I/O completion handlers.
Definition: asiodefs.hpp:34