Publishing R3
[platform/upstream/dldt.git] / inference-engine / tests / libs / gtest / googlemock / include / gmock / internal / gmock-generated-internal-utils.h
1 // Copyright (C) 2018 Intel Corporation
2 //
3 // SPDX-License-Identifier: Apache-2.0
4 //
5
6 // This file was GENERATED by command:
7 //     pump.py gmock-generated-internal-utils.h.pump
8 // DO NOT EDIT BY HAND!!!
9
10 // Copyright 2007, Google Inc.
11 // All rights reserved.
12 //
13 // Redistribution and use in source and binary forms, with or without
14 // modification, are permitted provided that the following conditions are
15 // met:
16 //
17 //     * Redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //     * Redistributions in binary form must reproduce the above
20 // copyright notice, this list of conditions and the following disclaimer
21 // in the documentation and/or other materials provided with the
22 // distribution.
23 //     * Neither the name of Google Inc. nor the names of its
24 // contributors may be used to endorse or promote products derived from
25 // this software without specific prior written permission.
26 //
27 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 //
39 // Author: wan@google.com (Zhanyong Wan)
40
41 // Google Mock - a framework for writing C++ mock classes.
42 //
43 // This file contains template meta-programming utility classes needed
44 // for implementing Google Mock.
45
46 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
47 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
48
49 #include "gmock/internal/gmock-port.h"
50
51 namespace testing {
52
53 template <typename T>
54 class Matcher;
55
56 namespace internal {
57
58 // An IgnoredValue object can be implicitly constructed from ANY value.
59 // This is used in implementing the IgnoreResult(a) action.
60 class IgnoredValue {
61  public:
62   // This constructor template allows any value to be implicitly
63   // converted to IgnoredValue.  The object has no data member and
64   // doesn't try to remember anything about the argument.  We
65   // deliberately omit the 'explicit' keyword in order to allow the
66   // conversion to be implicit.
67   template <typename T>
68   IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
69 };
70
71 // MatcherTuple<T>::type is a tuple type where each field is a Matcher
72 // for the corresponding field in tuple type T.
73 template <typename Tuple>
74 struct MatcherTuple;
75
76 template <>
77 struct MatcherTuple< ::testing::tuple<> > {
78   typedef ::testing::tuple< > type;
79 };
80
81 template <typename A1>
82 struct MatcherTuple< ::testing::tuple<A1> > {
83   typedef ::testing::tuple<Matcher<A1> > type;
84 };
85
86 template <typename A1, typename A2>
87 struct MatcherTuple< ::testing::tuple<A1, A2> > {
88   typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
89 };
90
91 template <typename A1, typename A2, typename A3>
92 struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
93   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
94 };
95
96 template <typename A1, typename A2, typename A3, typename A4>
97 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
98   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
99       Matcher<A4> > type;
100 };
101
102 template <typename A1, typename A2, typename A3, typename A4, typename A5>
103 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
104   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
105       Matcher<A5> > type;
106 };
107
108 template <typename A1, typename A2, typename A3, typename A4, typename A5,
109     typename A6>
110 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
111   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
112       Matcher<A5>, Matcher<A6> > type;
113 };
114
115 template <typename A1, typename A2, typename A3, typename A4, typename A5,
116     typename A6, typename A7>
117 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
118   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
119       Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
120 };
121
122 template <typename A1, typename A2, typename A3, typename A4, typename A5,
123     typename A6, typename A7, typename A8>
124 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
125   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
126       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
127 };
128
129 template <typename A1, typename A2, typename A3, typename A4, typename A5,
130     typename A6, typename A7, typename A8, typename A9>
131 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
132   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
133       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
134 };
135
136 template <typename A1, typename A2, typename A3, typename A4, typename A5,
137     typename A6, typename A7, typename A8, typename A9, typename A10>
138 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
139     A10> > {
140   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
141       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
142       Matcher<A10> > type;
143 };
144
145 // Template struct Function<F>, where F must be a function type, contains
146 // the following typedefs:
147 //
148 //   Result:               the function's return type.
149 //   ArgumentN:            the type of the N-th argument, where N starts with 1.
150 //   ArgumentTuple:        the tuple type consisting of all parameters of F.
151 //   ArgumentMatcherTuple: the tuple type consisting of Matchers for all
152 //                         parameters of F.
153 //   MakeResultVoid:       the function type obtained by substituting void
154 //                         for the return type of F.
155 //   MakeResultIgnoredValue:
156 //                         the function type obtained by substituting Something
157 //                         for the return type of F.
158 template <typename F>
159 struct Function;
160
161 template <typename R>
162 struct Function<R()> {
163   typedef R Result;
164   typedef ::testing::tuple<> ArgumentTuple;
165   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
166   typedef void MakeResultVoid();
167   typedef IgnoredValue MakeResultIgnoredValue();
168 };
169
170 template <typename R, typename A1>
171 struct Function<R(A1)>
172     : Function<R()> {
173   typedef A1 Argument1;
174   typedef ::testing::tuple<A1> ArgumentTuple;
175   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
176   typedef void MakeResultVoid(A1);
177   typedef IgnoredValue MakeResultIgnoredValue(A1);
178 };
179
180 template <typename R, typename A1, typename A2>
181 struct Function<R(A1, A2)>
182     : Function<R(A1)> {
183   typedef A2 Argument2;
184   typedef ::testing::tuple<A1, A2> ArgumentTuple;
185   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
186   typedef void MakeResultVoid(A1, A2);
187   typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
188 };
189
190 template <typename R, typename A1, typename A2, typename A3>
191 struct Function<R(A1, A2, A3)>
192     : Function<R(A1, A2)> {
193   typedef A3 Argument3;
194   typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
195   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
196   typedef void MakeResultVoid(A1, A2, A3);
197   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
198 };
199
200 template <typename R, typename A1, typename A2, typename A3, typename A4>
201 struct Function<R(A1, A2, A3, A4)>
202     : Function<R(A1, A2, A3)> {
203   typedef A4 Argument4;
204   typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
205   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
206   typedef void MakeResultVoid(A1, A2, A3, A4);
207   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
208 };
209
210 template <typename R, typename A1, typename A2, typename A3, typename A4,
211     typename A5>
212 struct Function<R(A1, A2, A3, A4, A5)>
213     : Function<R(A1, A2, A3, A4)> {
214   typedef A5 Argument5;
215   typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
216   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
217   typedef void MakeResultVoid(A1, A2, A3, A4, A5);
218   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
219 };
220
221 template <typename R, typename A1, typename A2, typename A3, typename A4,
222     typename A5, typename A6>
223 struct Function<R(A1, A2, A3, A4, A5, A6)>
224     : Function<R(A1, A2, A3, A4, A5)> {
225   typedef A6 Argument6;
226   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
227   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
228   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
229   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
230 };
231
232 template <typename R, typename A1, typename A2, typename A3, typename A4,
233     typename A5, typename A6, typename A7>
234 struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
235     : Function<R(A1, A2, A3, A4, A5, A6)> {
236   typedef A7 Argument7;
237   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
238   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
239   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
240   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
241 };
242
243 template <typename R, typename A1, typename A2, typename A3, typename A4,
244     typename A5, typename A6, typename A7, typename A8>
245 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
246     : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
247   typedef A8 Argument8;
248   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
249   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
250   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
251   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
252 };
253
254 template <typename R, typename A1, typename A2, typename A3, typename A4,
255     typename A5, typename A6, typename A7, typename A8, typename A9>
256 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
257     : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
258   typedef A9 Argument9;
259   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
260   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
261   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
262   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
263       A9);
264 };
265
266 template <typename R, typename A1, typename A2, typename A3, typename A4,
267     typename A5, typename A6, typename A7, typename A8, typename A9,
268     typename A10>
269 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
270     : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
271   typedef A10 Argument10;
272   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
273       A10> ArgumentTuple;
274   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
275   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
276   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
277       A9, A10);
278 };
279
280 }  // namespace internal
281
282 }  // namespace testing
283
284 #endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_