tesseract v5.3.3.20231005
testing::Action< F > Class Template Reference

#include <gmock-actions.h>

Public Types

typedef internal::Function< F >::Result Result
 
typedef internal::Function< F >::ArgumentTuple ArgumentTuple
 

Public Member Functions

 Action ()
 
template<typename G , typename = typename std::enable_if<internal::disjunction< IsCompatibleFunctor<G>, std::is_constructible<std::function<Result()>, G>>::value>::type>
 Action (G &&fun)
 
 Action (ActionInterface< F > *impl)
 
template<typename Func >
 Action (const Action< Func > &action)
 
bool IsDoDefault () const
 
Result Perform (ArgumentTuple args) const
 

Friends

template<typename G >
class Action
 

Detailed Description

template<typename F>
class testing::Action< F >

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

Member Typedef Documentation

◆ ArgumentTuple

template<typename F >
typedef internal::Function<F>::ArgumentTuple testing::Action< F >::ArgumentTuple

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

◆ Result

template<typename F >
typedef internal::Function<F>::Result testing::Action< F >::Result

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

Constructor & Destructor Documentation

◆ Action() [1/4]

template<typename F >
testing::Action< F >::Action ( )
inline

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

461{}

◆ Action() [2/4]

template<typename F >
template<typename G , typename = typename std::enable_if<internal::disjunction< IsCompatibleFunctor<G>, std::is_constructible<std::function<Result()>, G>>::value>::type>
testing::Action< F >::Action ( G &&  fun)
inline

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

471 { // NOLINT
472 Init(::std::forward<G>(fun), IsCompatibleFunctor<G>());
473 }

◆ Action() [3/4]

template<typename F >
testing::Action< F >::Action ( ActionInterface< F > *  impl)
inlineexplicit

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

477 : fun_(ActionAdapter{::std::shared_ptr<ActionInterface<F>>(impl)}) {}

◆ Action() [4/4]

template<typename F >
template<typename Func >
testing::Action< F >::Action ( const Action< Func > &  action)
inlineexplicit

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

483: fun_(action.fun_) {}
action
Definition: upload.py:408

Member Function Documentation

◆ IsDoDefault()

template<typename F >
bool testing::Action< F >::IsDoDefault ( ) const
inline

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

486{ return fun_ == nullptr; }

◆ Perform()

template<typename F >
Result testing::Action< F >::Perform ( ArgumentTuple  args) const
inline

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

494 {
495 if (IsDoDefault()) {
496 internal::IllegalDoDefault(__FILE__, __LINE__);
497 }
498 return internal::Apply(fun_, ::std::move(args));
499 }
auto Apply(F &&f, Tuple &&args) -> decltype(ApplyImpl(std::forward< F >(f), std::forward< Tuple >(args), MakeIndexSequence< std::tuple_size< typename std::remove_reference< Tuple >::type >::value >()))
GTEST_API_ void IllegalDoDefault(const char *file, int line)
bool IsDoDefault() const

Friends And Related Function Documentation

◆ Action

template<typename F >
template<typename G >
friend class Action
friend

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


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