Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-09 08:19:03

0001 // This file was GENERATED by command:
0002 //     pump.py gmock-generated-internal-utils.h.pump
0003 // DO NOT EDIT BY HAND!!!
0004 
0005 // Copyright 2007, Google Inc.
0006 // All rights reserved.
0007 //
0008 // Redistribution and use in source and binary forms, with or without
0009 // modification, are permitted provided that the following conditions are
0010 // met:
0011 //
0012 //     * Redistributions of source code must retain the above copyright
0013 // notice, this list of conditions and the following disclaimer.
0014 //     * Redistributions in binary form must reproduce the above
0015 // copyright notice, this list of conditions and the following disclaimer
0016 // in the documentation and/or other materials provided with the
0017 // distribution.
0018 //     * Neither the name of Google Inc. nor the names of its
0019 // contributors may be used to endorse or promote products derived from
0020 // this software without specific prior written permission.
0021 //
0022 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0023 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0024 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
0025 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0026 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0027 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
0028 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
0029 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
0030 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
0031 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0032 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0033 //
0034 // Author: wan@google.com (Zhanyong Wan)
0035 
0036 // Google Mock - a framework for writing C++ mock classes.
0037 //
0038 // This file contains template meta-programming utility classes needed
0039 // for implementing Google Mock.
0040 
0041 #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
0042 #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
0043 
0044 #include "gmock/internal/gmock-port.h"
0045 
0046 namespace testing {
0047 
0048 template <typename T>
0049 class Matcher;
0050 
0051 namespace internal {
0052 
0053 // An IgnoredValue object can be implicitly constructed from ANY value.
0054 // This is used in implementing the IgnoreResult(a) action.
0055 class IgnoredValue {
0056  public:
0057   // This constructor template allows any value to be implicitly
0058   // converted to IgnoredValue.  The object has no data member and
0059   // doesn't try to remember anything about the argument.  We
0060   // deliberately omit the 'explicit' keyword in order to allow the
0061   // conversion to be implicit.
0062   template <typename T>
0063   IgnoredValue(const T& /* ignored */) {}  // NOLINT(runtime/explicit)
0064 };
0065 
0066 // MatcherTuple<T>::type is a tuple type where each field is a Matcher
0067 // for the corresponding field in tuple type T.
0068 template <typename Tuple>
0069 struct MatcherTuple;
0070 
0071 template <>
0072 struct MatcherTuple< ::testing::tuple<> > {
0073   typedef ::testing::tuple< > type;
0074 };
0075 
0076 template <typename A1>
0077 struct MatcherTuple< ::testing::tuple<A1> > {
0078   typedef ::testing::tuple<Matcher<A1> > type;
0079 };
0080 
0081 template <typename A1, typename A2>
0082 struct MatcherTuple< ::testing::tuple<A1, A2> > {
0083   typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type;
0084 };
0085 
0086 template <typename A1, typename A2, typename A3>
0087 struct MatcherTuple< ::testing::tuple<A1, A2, A3> > {
0088   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type;
0089 };
0090 
0091 template <typename A1, typename A2, typename A3, typename A4>
0092 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > {
0093   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>,
0094       Matcher<A4> > type;
0095 };
0096 
0097 template <typename A1, typename A2, typename A3, typename A4, typename A5>
0098 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > {
0099   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0100       Matcher<A5> > type;
0101 };
0102 
0103 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0104     typename A6>
0105 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > {
0106   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0107       Matcher<A5>, Matcher<A6> > type;
0108 };
0109 
0110 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0111     typename A6, typename A7>
0112 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > {
0113   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0114       Matcher<A5>, Matcher<A6>, Matcher<A7> > type;
0115 };
0116 
0117 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0118     typename A6, typename A7, typename A8>
0119 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > {
0120   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0121       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type;
0122 };
0123 
0124 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0125     typename A6, typename A7, typename A8, typename A9>
0126 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > {
0127   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0128       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type;
0129 };
0130 
0131 template <typename A1, typename A2, typename A3, typename A4, typename A5,
0132     typename A6, typename A7, typename A8, typename A9, typename A10>
0133 struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
0134     A10> > {
0135   typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>,
0136       Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>,
0137       Matcher<A10> > type;
0138 };
0139 
0140 // Template struct Function<F>, where F must be a function type, contains
0141 // the following typedefs:
0142 //
0143 //   Result:               the function's return type.
0144 //   ArgumentN:            the type of the N-th argument, where N starts with 1.
0145 //   ArgumentTuple:        the tuple type consisting of all parameters of F.
0146 //   ArgumentMatcherTuple: the tuple type consisting of Matchers for all
0147 //                         parameters of F.
0148 //   MakeResultVoid:       the function type obtained by substituting void
0149 //                         for the return type of F.
0150 //   MakeResultIgnoredValue:
0151 //                         the function type obtained by substituting Something
0152 //                         for the return type of F.
0153 template <typename F>
0154 struct Function;
0155 
0156 template <typename R>
0157 struct Function<R()> {
0158   typedef R Result;
0159   typedef ::testing::tuple<> ArgumentTuple;
0160   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0161   typedef void MakeResultVoid();
0162   typedef IgnoredValue MakeResultIgnoredValue();
0163 };
0164 
0165 template <typename R, typename A1>
0166 struct Function<R(A1)>
0167     : Function<R()> {
0168   typedef A1 Argument1;
0169   typedef ::testing::tuple<A1> ArgumentTuple;
0170   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0171   typedef void MakeResultVoid(A1);
0172   typedef IgnoredValue MakeResultIgnoredValue(A1);
0173 };
0174 
0175 template <typename R, typename A1, typename A2>
0176 struct Function<R(A1, A2)>
0177     : Function<R(A1)> {
0178   typedef A2 Argument2;
0179   typedef ::testing::tuple<A1, A2> ArgumentTuple;
0180   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0181   typedef void MakeResultVoid(A1, A2);
0182   typedef IgnoredValue MakeResultIgnoredValue(A1, A2);
0183 };
0184 
0185 template <typename R, typename A1, typename A2, typename A3>
0186 struct Function<R(A1, A2, A3)>
0187     : Function<R(A1, A2)> {
0188   typedef A3 Argument3;
0189   typedef ::testing::tuple<A1, A2, A3> ArgumentTuple;
0190   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0191   typedef void MakeResultVoid(A1, A2, A3);
0192   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3);
0193 };
0194 
0195 template <typename R, typename A1, typename A2, typename A3, typename A4>
0196 struct Function<R(A1, A2, A3, A4)>
0197     : Function<R(A1, A2, A3)> {
0198   typedef A4 Argument4;
0199   typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple;
0200   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0201   typedef void MakeResultVoid(A1, A2, A3, A4);
0202   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4);
0203 };
0204 
0205 template <typename R, typename A1, typename A2, typename A3, typename A4,
0206     typename A5>
0207 struct Function<R(A1, A2, A3, A4, A5)>
0208     : Function<R(A1, A2, A3, A4)> {
0209   typedef A5 Argument5;
0210   typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple;
0211   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0212   typedef void MakeResultVoid(A1, A2, A3, A4, A5);
0213   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5);
0214 };
0215 
0216 template <typename R, typename A1, typename A2, typename A3, typename A4,
0217     typename A5, typename A6>
0218 struct Function<R(A1, A2, A3, A4, A5, A6)>
0219     : Function<R(A1, A2, A3, A4, A5)> {
0220   typedef A6 Argument6;
0221   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple;
0222   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0223   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6);
0224   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6);
0225 };
0226 
0227 template <typename R, typename A1, typename A2, typename A3, typename A4,
0228     typename A5, typename A6, typename A7>
0229 struct Function<R(A1, A2, A3, A4, A5, A6, A7)>
0230     : Function<R(A1, A2, A3, A4, A5, A6)> {
0231   typedef A7 Argument7;
0232   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple;
0233   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0234   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7);
0235   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7);
0236 };
0237 
0238 template <typename R, typename A1, typename A2, typename A3, typename A4,
0239     typename A5, typename A6, typename A7, typename A8>
0240 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)>
0241     : Function<R(A1, A2, A3, A4, A5, A6, A7)> {
0242   typedef A8 Argument8;
0243   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple;
0244   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0245   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8);
0246   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8);
0247 };
0248 
0249 template <typename R, typename A1, typename A2, typename A3, typename A4,
0250     typename A5, typename A6, typename A7, typename A8, typename A9>
0251 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)>
0252     : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> {
0253   typedef A9 Argument9;
0254   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple;
0255   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0256   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9);
0257   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
0258       A9);
0259 };
0260 
0261 template <typename R, typename A1, typename A2, typename A3, typename A4,
0262     typename A5, typename A6, typename A7, typename A8, typename A9,
0263     typename A10>
0264 struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)>
0265     : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
0266   typedef A10 Argument10;
0267   typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9,
0268       A10> ArgumentTuple;
0269   typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
0270   typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10);
0271   typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8,
0272       A9, A10);
0273 };
0274 
0275 }  // namespace internal
0276 
0277 }  // namespace testing
0278 
0279 #endif  // GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_