123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- $$ -*- mode: c++; -*-
- $$ This is a Pump source file. Please use Pump to convert it to
- $$ gmock-generated-function-mockers.h.
- $$
- $var n = 10 $$ The maximum arity we support.
- #ifndef GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
- #define GMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_GENERATED_INTERNAL_UTILS_H_
- #include "gmock/internal/gmock-port.h"
- namespace testing {
- template <typename T>
- class Matcher;
- namespace internal {
- class IgnoredValue {
- public:
-
-
-
-
-
- template <typename T>
- IgnoredValue(const T& ) {}
- };
- template <typename Tuple>
- struct MatcherTuple;
- $range i 0..n
- $for i [[
- $range j 1..i
- $var typename_As = [[$for j, [[typename A$j]]]]
- $var As = [[$for j, [[A$j]]]]
- $var matcher_As = [[$for j, [[Matcher<A$j>]]]]
- template <$typename_As>
- struct MatcherTuple< ::testing::tuple<$As> > {
- typedef ::testing::tuple<$matcher_As > type;
- };
- ]]
- template <typename F>
- struct Function;
- template <typename R>
- struct Function<R()> {
- typedef R Result;
- typedef ::testing::tuple<> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid();
- typedef IgnoredValue MakeResultIgnoredValue();
- };
- $range i 1..n
- $for i [[
- $range j 1..i
- $var typename_As = [[$for j [[, typename A$j]]]]
- $var As = [[$for j, [[A$j]]]]
- $var matcher_As = [[$for j, [[Matcher<A$j>]]]]
- $range k 1..i-1
- $var prev_As = [[$for k, [[A$k]]]]
- template <typename R$typename_As>
- struct Function<R($As)>
- : Function<R($prev_As)> {
- typedef A$i Argument$i;
- typedef ::testing::tuple<$As> ArgumentTuple;
- typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple;
- typedef void MakeResultVoid($As);
- typedef IgnoredValue MakeResultIgnoredValue($As);
- };
- ]]
- }
- }
- #endif
|