io.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * fkie_message_filters
4  * Copyright © 2018-2020 Fraunhofer FKIE
5  * Author: Timo Röhling
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ****************************************************************************/
20 
21 #ifndef INCLUDE_FKIE_MESSAGE_FILTERS_HELPERS_IO_H_
22 #define INCLUDE_FKIE_MESSAGE_FILTERS_HELPERS_IO_H_
23 
24 namespace fkie_message_filters
25 {
26 
27 template<typename...> class IO;
28 
29 namespace helpers
30 {
31 
32 template<typename T>
33 struct io_wrap
34 {
35  using type = IO<T>;
36 };
37 
38 template<typename... Ts>
39 struct io_wrap<IO<Ts...>>
40 {
41  using type = IO<Ts...>;
42 };
43 
44 template<typename... Ts>
45 struct io_wrap<IO<IO<Ts...>>>
46 {
47  using type = typename io_wrap<IO<Ts...>>::type;
48 };
49 
50 template<typename T>
51 using io_wrap_t = typename io_wrap<T>::type;
52 
53 template<typename T>
54 struct io_unwrap
55 {
56  using type = T;
57 };
58 
59 template<typename T>
60 struct io_unwrap<IO<T>>
61 {
62  using type = typename io_unwrap<T>::type;
63 };
64 
65 template<typename T>
66 using io_unwrap_t = typename io_unwrap<T>::type;
67 
68 template<typename IO, template<typename...> class Wrap>
69 struct io_rewrap
70 {
71  using type = typename io_wrap_t<IO>::template Rewrap<Wrap>;
72 };
73 
74 template<typename IO, template<typename...> class Wrap>
75 using io_rewrap_t = typename io_rewrap<IO, Wrap>::type;
76 
77 template<typename T, typename U>
79 
80 template<typename... Ts, typename... Us>
81 struct io_concat_impl<IO<Ts...>, IO<Us...>>
82 {
83  using type = IO<Ts..., Us...>;
84 };
85 
86 template<typename... Ts>
87 struct io_concat;
88 
89 template<typename T1, typename T2, typename... Ts>
90 struct io_concat<T1, T2, Ts...>
91 {
93 };
94 
95 template<typename T>
96 struct io_concat<T>
97 {
98  using type = io_wrap_t<T>;
99 };
100 
101 template<typename... Ts>
102 using io_concat_t = typename io_concat<Ts...>::type;
103 
104 template<typename IO>
105 struct io_tuple
106 {
107  using type = typename io_wrap_t<IO>::Tuple;
108 };
109 
110 template<typename IO>
111 using io_tuple_t = typename io_tuple<IO>::type;
112 
113 } // namespace helpers
114 } // namespace fkie_message_filters
115 
116 #endif /* INCLUDE_FKIE_MESSAGE_FILTERS_HELPERS_IO_H_ */
fkie_message_filters
Definition: buffer.h:33
fkie_message_filters::helpers::io_tuple::type
typename io_wrap_t< IO >::Tuple type
Definition: io.h:125
fkie_message_filters::IO
Group multiple data types as filter input or output.
Definition: io.h:45
fkie_message_filters::helpers::io_rewrap
Definition: io.h:87
fkie_message_filters::helpers::io_unwrap_t
typename io_unwrap< T >::type io_unwrap_t
Definition: io.h:84
fkie_message_filters::helpers::io_tuple
Definition: io.h:123
fkie_message_filters::helpers::io_rewrap::type
typename io_wrap_t< IO >::template Rewrap< Wrap > type
Definition: io.h:89
fkie_message_filters::helpers::io_wrap_t
typename io_wrap< T >::type io_wrap_t
Definition: io.h:69
fkie_message_filters::helpers::io_unwrap::type
T type
Definition: io.h:74
fkie_message_filters::helpers::io_concat_impl
Definition: io.h:96
fkie_message_filters::helpers::io_rewrap_t
typename io_rewrap< IO, Wrap >::type io_rewrap_t
Definition: io.h:93
fkie_message_filters::helpers::io_unwrap
Definition: io.h:72
fkie_message_filters::helpers::io_concat
Definition: io.h:105
fkie_message_filters::helpers::io_tuple_t
typename io_tuple< IO >::type io_tuple_t
Definition: io.h:129
fkie_message_filters::helpers::io_concat_t
typename io_concat< Ts... >::type io_concat_t
Definition: io.h:120
fkie_message_filters::helpers::io_unwrap< IO< T > >::type
typename io_unwrap< T >::type type
Definition: io.h:80


fkie_message_filters
Author(s): Timo Röhling
autogenerated on Wed Mar 2 2022 00:18:57