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>
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>
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>
112 
113 } // namespace helpers
114 } // namespace fkie_message_filters
115 
116 #endif /* INCLUDE_FKIE_MESSAGE_FILTERS_HELPERS_IO_H_ */
Group multiple data types as filter input or output.
Definition: io.h:27
typename io_wrap_t< IO >::template Rewrap< Wrap > type
Definition: io.h:71
typename io_wrap_t< IO >::Tuple type
Definition: io.h:107
typename io_wrap< IO< Ts... > >::type type
Definition: io.h:47
typename io_rewrap< IO, Wrap >::type io_rewrap_t
Definition: io.h:75
typename io_concat< typename io_concat_impl< io_wrap_t< T1 >, io_wrap_t< T2 > >::type, Ts... >::type type
Definition: io.h:92
Primary namespace.
Definition: buffer.h:33
typename io_wrap< T >::type io_wrap_t
Definition: io.h:51
typename io_tuple< IO >::type io_tuple_t
Definition: io.h:111
typename io_unwrap< T >::type type
Definition: io.h:62
typename io_unwrap< T >::type io_unwrap_t
Definition: io.h:66
typename io_concat< Ts... >::type io_concat_t
Definition: io.h:102


fkie_message_filters
Author(s): Timo Röhling
autogenerated on Mon Feb 28 2022 22:21:43