tesseract v5.3.3.20231005
testing::internal::ActionImpl< R(Args...), Impl > Struct Template Reference

#include <gmock-actions.h>

Inheritance diagram for testing::internal::ActionImpl< R(Args...), Impl >:

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 1499 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 1502 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 1500 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 1501 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 1505 of file gmock-actions.h.

1505: 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 1516 of file gmock-actions.h.

1517 {
1518 // Impl need not be specific to the signature of action being implemented;
1519 // only the implementing function body needs to have all of the specific
1520 // types instantiated. Up to 10 of the args that are provided by the
1521 // args_type get passed, followed by a dummy of unspecified type for the
1522 // remainder up to 10 explicit args.
1523 static constexpr ExcessiveArg kExcessArg{};
1524 return static_cast<const Impl&>(*this).template gmock_PerformImpl<
1525 /*function_type=*/function_type, /*return_type=*/R,
1526 /*args_type=*/args_type,
1527 /*argN_type=*/typename std::tuple_element<arg_id, args_type>::type...>(
1528 /*args=*/args, std::get<arg_id>(args)...,
1529 ((void)excess_id, kExcessArg)...);
1530 }
type
Definition: upload.py:458

◆ operator()()

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

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

1507 {
1508 static constexpr size_t kMaxArgs =
1509 sizeof...(Args) <= 10 ? sizeof...(Args) : 10;
1510 return Apply(MakeIndexSequence<kMaxArgs>{},
1511 MakeIndexSequence<10 - kMaxArgs>{},
1512 args_type{std::forward<Args>(arg)...});
1513 }
typename MakeIndexSequenceImpl< N >::type MakeIndexSequence
R Apply(IndexSequence< arg_id... >, IndexSequence< excess_id... >, const args_type &args) const

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