Clementine
scheduler.hpp
1 //
2 // execution/scheduler.hpp
3 // ~~~~~~~~~~~~~~~~~~~~~~~
4 //
5 // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com)
6 //
7 // Distributed under the Boost Software License, Version 1.0. (See accompanying
8 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
9 //
10 
11 #ifndef ASIO_EXECUTION_SCHEDULER_HPP
12 #define ASIO_EXECUTION_SCHEDULER_HPP
13 
14 #if defined(_MSC_VER) && (_MSC_VER >= 1200)
15 # pragma once
16 #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
17 
18 #include "asio/detail/config.hpp"
19 #include "asio/detail/type_traits.hpp"
20 #include "asio/execution/schedule.hpp"
21 #include "asio/traits/equality_comparable.hpp"
22 
23 #include "asio/detail/push_options.hpp"
24 
25 namespace asio {
26 namespace execution {
27 namespace detail {
28 
29 template <typename T>
31  integral_constant<bool,
32  is_copy_constructible<typename remove_cvref<T>::type>::value
33  && traits::equality_comparable<typename remove_cvref<T>::type>::is_valid
34  >
35 {
36 };
37 
38 } // namespace detail
39 
42 
47 template <typename T>
48 struct is_scheduler :
49 #if defined(GENERATING_DOCUMENTATION)
50  integral_constant<bool, automatically_determined>
51 #else // defined(GENERATING_DOCUMENTATION)
52  conditional<
53  can_schedule<T>::value,
54  detail::is_scheduler_base<T>,
55  false_type
56  >::type
57 #endif // defined(GENERATING_DOCUMENTATION)
58 {
59 };
60 
61 #if defined(ASIO_HAS_VARIABLE_TEMPLATES)
62 
63 template <typename T>
64 ASIO_CONSTEXPR const bool is_scheduler_v = is_scheduler<T>::value;
65 
66 #endif // defined(ASIO_HAS_VARIABLE_TEMPLATES)
67 
68 #if defined(ASIO_HAS_CONCEPTS)
69 
70 template <typename T>
71 ASIO_CONCEPT scheduler = is_scheduler<T>::value;
72 
73 #define ASIO_EXECUTION_SCHEDULER ::asio::execution::scheduler
74 
75 #else // defined(ASIO_HAS_CONCEPTS)
76 
77 #define ASIO_EXECUTION_SCHEDULER typename
78 
79 #endif // defined(ASIO_HAS_CONCEPTS)
80 
81 } // namespace execution
82 } // namespace asio
83 
84 #include "asio/detail/pop_options.hpp"
85 
86 #endif // ASIO_EXECUTION_SCHEDULER_HPP
The is_scheduler trait detects whether a type T satisfies the execution::scheduler concept...
Definition: scheduler.hpp:48
Definition: chrono.h:284
Definition: scheduler.hpp:30
Definition: handler_work.hpp:37
Definition: any_io_executor.hpp:28