Remote Call Framework 3.1
tuple.hpp
1 
2 //******************************************************************************
3 // RCF - Remote Call Framework
4 //
5 // Copyright (c) 2005 - 2019, Delta V Software. All rights reserved.
6 // http://www.deltavsoft.com
7 //
8 // RCF is distributed under dual licenses - closed source or GPL.
9 // Consult your particular license for conditions of use.
10 //
11 // If you have not purchased a commercial license, you are using RCF
12 // under GPL terms.
13 //
14 // Version: 3.1
15 // Contact: support <at> deltavsoft.com
16 //
17 //******************************************************************************
18 
19 #ifndef INCLUDE_SF_TUPLE_STD_HPP
20 #define INCLUDE_SF_TUPLE_STD_HPP
21 
22 #include <RCF/Config.hpp>
23 
24 #include <tuple>
25 
26 namespace SF {
27 
28  class Archive;
29 
30  // std::tuple
31 
32  template<
33  typename T0>
34  void serialize(SF::Archive &ar, std::tuple<T0> &t)
35  {
36  ar
37  & std::get<0>(t);
38  }
39 
40  template<
41  typename T0,
42  typename T1>
43  void serialize(SF::Archive &ar, std::tuple<T0,T1> &t)
44  {
45  ar
46  & std::get<0>(t)
47  & std::get<1>(t);
48  }
49 
50  template<
51  typename T0,
52  typename T1,
53  typename T2>
54  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2> &t)
55  {
56  ar
57  & std::get<0>(t)
58  & std::get<1>(t)
59  & std::get<2>(t);
60  }
61 
62  template<
63  typename T0,
64  typename T1,
65  typename T2,
66  typename T3>
67  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2,T3> &t)
68  {
69  ar
70  & std::get<0>(t)
71  & std::get<1>(t)
72  & std::get<2>(t)
73  & std::get<3>(t);
74  }
75 
76  template<
77  typename T0,
78  typename T1,
79  typename T2,
80  typename T3,
81  typename T4>
82  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2,T3,T4> &t)
83  {
84  ar
85  & std::get<0>(t)
86  & std::get<1>(t)
87  & std::get<2>(t)
88  & std::get<3>(t)
89  & std::get<4>(t);
90  }
91 
92  template<
93  typename T0,
94  typename T1,
95  typename T2,
96  typename T3,
97  typename T4,
98  typename T5>
99  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2,T3,T4,T5> &t)
100  {
101  ar
102  & std::get<0>(t)
103  & std::get<1>(t)
104  & std::get<2>(t)
105  & std::get<3>(t)
106  & std::get<4>(t)
107  & std::get<5>(t);
108  }
109 
110  template<
111  typename T0,
112  typename T1,
113  typename T2,
114  typename T3,
115  typename T4,
116  typename T5,
117  typename T6>
118  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2,T3,T4,T5,T6> &t)
119  {
120  ar
121  & std::get<0>(t)
122  & std::get<1>(t)
123  & std::get<2>(t)
124  & std::get<3>(t)
125  & std::get<4>(t)
126  & std::get<5>(t)
127  & std::get<6>(t);
128  }
129 
130  template<
131  typename T0,
132  typename T1,
133  typename T2,
134  typename T3,
135  typename T4,
136  typename T5,
137  typename T6,
138  typename T7>
139  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2,T3,T4,T5,T6,T7> &t)
140  {
141  ar
142  & std::get<0>(t)
143  & std::get<1>(t)
144  & std::get<2>(t)
145  & std::get<3>(t)
146  & std::get<4>(t)
147  & std::get<5>(t)
148  & std::get<6>(t)
149  & std::get<7>(t);
150  }
151 
152  // Visual C++ 11 doesn't support any more args to std::tuple<>.
153 
154  /*
155  template<
156  typename T0,
157  typename T1,
158  typename T2,
159  typename T3,
160  typename T4,
161  typename T5,
162  typename T6,
163  typename T7,
164  typename T8>
165  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8> &t)
166  {
167  ar
168  & std::get<0>(t)
169  & std::get<1>(t)
170  & std::get<2>(t)
171  & std::get<3>(t)
172  & std::get<4>(t)
173  & std::get<5>(t)
174  & std::get<6>(t)
175  & std::get<7>(t)
176  & std::get<8>(t);
177  }
178 
179  template<
180  typename T0,
181  typename T1,
182  typename T2,
183  typename T3,
184  typename T4,
185  typename T5,
186  typename T6,
187  typename T7,
188  typename T8,
189  typename T9>
190  void serialize(SF::Archive &ar, std::tuple<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9> &t)
191  {
192  ar
193  & std::get<0>(t)
194  & std::get<1>(t)
195  & std::get<2>(t)
196  & std::get<3>(t)
197  & std::get<4>(t)
198  & std::get<5>(t)
199  & std::get<6>(t)
200  & std::get<7>(t)
201  & std::get<8>(t)
202  & std::get<9>(t);
203  }
204  */
205 
206 }
207 
208 #endif // ! INCLUDE_SF_TUPLE_STD_HPP
Represents an archive, in which serialized objects are stored.
Definition: Archive.hpp:32
Definition: ByteBuffer.hpp:189