template <typename Impl>

class PolymorphicAction

Defined at line 872 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-actions.h

The PolymorphicAction class template makes it easy to implement a

polymorphic action (i.e. an action that can be used in mock

functions of than one type, e.g. Return()).

To define a polymorphic action, a user first provides a COPYABLE

implementation class that has a Perform() method template:

class FooAction {

public:

template

<typename

Result, typename ArgumentTuple>

Result Perform(const ArgumentTuple

&

args) const {

// Processes the arguments and returns a result, using

// std::get

<N

>(args) to get the N-th (0-based) argument in the tuple.

}

...

};

Then the user creates the polymorphic action using

MakePolymorphicAction(object) where object has type FooAction. See

the definition of Return(void) and SetArgumentPointee

<N

>(value) for

complete examples.

Public Methods

void PolymorphicAction<Impl> (const Impl & impl)

Defined at line 874 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-actions.h

template <typename F>
Action<F> operator testing::Action<type-parameter-1-0> ()

Defined at line 877 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-actions.h

Records