]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // |
2 | // Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) | |
3 | // | |
4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | |
5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | |
6 | // | |
7 | ||
8 | #ifndef BEAST_STREAM_CONCEPTS_HPP | |
9 | #define BEAST_STREAM_CONCEPTS_HPP | |
10 | ||
11 | #include <beast/config.hpp> | |
12 | #include <beast/core/detail/stream_concepts.hpp> | |
13 | #include <type_traits> | |
14 | ||
15 | namespace beast { | |
16 | ||
17 | /// Determine if `T` has the `get_io_service` member. | |
18 | template<class T> | |
19 | #if BEAST_DOXYGEN | |
20 | struct has_get_io_service : std::integral_constant<bool, ...>{}; | |
21 | #else | |
22 | using has_get_io_service = typename detail::has_get_io_service<T>::type; | |
23 | #endif | |
24 | ||
25 | /// Determine if `T` meets the requirements of @b `AsyncReadStream`. | |
26 | template<class T> | |
27 | #if BEAST_DOXYGEN | |
28 | struct is_AsyncReadStream : std::integral_constant<bool, ...>{}; | |
29 | #else | |
30 | using is_AsyncReadStream = typename detail::is_AsyncReadStream<T>::type; | |
31 | #endif | |
32 | ||
33 | /// Determine if `T` meets the requirements of @b `AsyncWriteStream`. | |
34 | template<class T> | |
35 | #if BEAST_DOXYGEN | |
36 | struct is_AsyncWriteStream : std::integral_constant<bool, ...>{}; | |
37 | #else | |
38 | using is_AsyncWriteStream = typename detail::is_AsyncWriteStream<T>::type; | |
39 | #endif | |
40 | ||
41 | /// Determine if `T` meets the requirements of @b `SyncReadStream`. | |
42 | template<class T> | |
43 | #if BEAST_DOXYGEN | |
44 | struct is_SyncReadStream : std::integral_constant<bool, ...>{}; | |
45 | #else | |
46 | using is_SyncReadStream = typename detail::is_SyncReadStream<T>::type; | |
47 | #endif | |
48 | ||
49 | /// Determine if `T` meets the requirements of @b `SyncWriterStream`. | |
50 | template<class T> | |
51 | #if BEAST_DOXYGEN | |
52 | struct is_SyncWriteStream : std::integral_constant<bool, ...>{}; | |
53 | #else | |
54 | using is_SyncWriteStream = typename detail::is_SyncWriteStream<T>::type; | |
55 | #endif | |
56 | ||
57 | /// Determine if `T` meets the requirements of @b `AsyncStream`. | |
58 | template<class T> | |
59 | #if BEAST_DOXYGEN | |
60 | struct is_AsyncStream : std::integral_constant<bool, ...>{}; | |
61 | #else | |
62 | using is_AsyncStream = std::integral_constant<bool, | |
63 | is_AsyncReadStream<T>::value && is_AsyncWriteStream<T>::value>; | |
64 | #endif | |
65 | ||
66 | /// Determine if `T` meets the requirements of @b `SyncStream`. | |
67 | template<class T> | |
68 | #if BEAST_DOXYGEN | |
69 | struct is_SyncStream : std::integral_constant<bool, ...>{}; | |
70 | #else | |
71 | using is_SyncStream = std::integral_constant<bool, | |
72 | is_SyncReadStream<T>::value && is_SyncWriteStream<T>::value>; | |
73 | #endif | |
74 | ||
75 | } // beast | |
76 | ||
77 | #endif |