Xmipp  v3.23.11-Nereus
Public Types | Public Member Functions | List of all members
testing::internal::ActionImpl< R(Args...), Impl > Struct Template Reference

#include <gmock-actions.h>

Inheritance diagram for testing::internal::ActionImpl< R(Args...), Impl >:
Inheritance graph
[legend]
Collaboration diagram for testing::internal::ActionImpl< R(Args...), Impl >:
Collaboration graph
[legend]

Public Types

using Base = typename ImplBase< Impl >::type
 
using function_type = R(Args...)
 
using args_type = std::tuple< Args... >
 

Public Member Functions

 ActionImpl ()=default
 
 ActionImpl (std::shared_ptr< Impl > impl)
 
operator() (Args &&... arg) const
 
template<std::size_t... arg_id, std::size_t... excess_id>
Apply (IndexSequence< arg_id... >, IndexSequence< excess_id... >, const args_type &args) const
 

Detailed Description

template<typename R, typename... Args, typename Impl>
struct testing::internal::ActionImpl< R(Args...), Impl >

Definition at line 2106 of file gmock-actions.h.

Member Typedef Documentation

◆ args_type

template<typename R , typename... Args, typename Impl >
using testing::internal::ActionImpl< R(Args...), Impl >::args_type = std::tuple<Args...>

Definition at line 2109 of file gmock-actions.h.

◆ Base

template<typename R , typename... Args, typename Impl >
using testing::internal::ActionImpl< R(Args...), Impl >::Base = typename ImplBase<Impl>::type

Definition at line 2107 of file gmock-actions.h.

◆ function_type

template<typename R , typename... Args, typename Impl >
using testing::internal::ActionImpl< R(Args...), Impl >::function_type = R(Args...)

Definition at line 2108 of file gmock-actions.h.

Constructor & Destructor Documentation

◆ ActionImpl() [1/2]

template<typename R , typename... Args, typename Impl >
testing::internal::ActionImpl< R(Args...), Impl >::ActionImpl ( )
default

◆ ActionImpl() [2/2]

template<typename R , typename... Args, typename Impl >
testing::internal::ActionImpl< R(Args...), Impl >::ActionImpl ( std::shared_ptr< Impl >  impl)
inlineexplicit

Definition at line 2112 of file gmock-actions.h.

2112 : Base{std::move(impl)} {}

Member Function Documentation

◆ Apply()

template<typename R , typename... Args, typename Impl >
template<std::size_t... arg_id, std::size_t... excess_id>
R testing::internal::ActionImpl< R(Args...), Impl >::Apply ( IndexSequence< arg_id... >  ,
IndexSequence< excess_id... >  ,
const args_type args 
) const
inline

Definition at line 2123 of file gmock-actions.h.

2124  {
2125  // Impl need not be specific to the signature of action being implemented;
2126  // only the implementing function body needs to have all of the specific
2127  // types instantiated. Up to 10 of the args that are provided by the
2128  // args_type get passed, followed by a dummy of unspecified type for the
2129  // remainder up to 10 explicit args.
2130  static constexpr ExcessiveArg kExcessArg{};
2131  return static_cast<const Impl&>(*this)
2132  .template gmock_PerformImpl<
2133  /*function_type=*/function_type, /*return_type=*/R,
2134  /*args_type=*/args_type,
2135  /*argN_type=*/
2137  /*args=*/args, std::get<arg_id>(args)...,
2138  ((void)excess_id, kExcessArg)...);
2139  }
viol type

◆ operator()()

template<typename R , typename... Args, typename Impl >
R testing::internal::ActionImpl< R(Args...), Impl >::operator() ( Args &&...  arg) const
inline

Definition at line 2114 of file gmock-actions.h.

2114  {
2115  static constexpr size_t kMaxArgs =
2116  sizeof...(Args) <= 10 ? sizeof...(Args) : 10;
2117  return Apply(MakeIndexSequence<kMaxArgs>{},
2118  MakeIndexSequence<10 - kMaxArgs>{},
2119  args_type{std::forward<Args>(arg)...});
2120  }
R Apply(IndexSequence< arg_id... >, IndexSequence< excess_id... >, const args_type &args) const
typename MakeIndexSequenceImpl< N >::type MakeIndexSequence

The documentation for this struct was generated from the following file: