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