36#ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
37#define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
51template <
typename FunctionImpl>
57 : function_impl_(function_impl) {}
59 template <
typename Result,
typename ArgumentTuple>
60 Result
Perform(
const ArgumentTuple& args) {
65 FunctionImpl function_impl_;
71template <
class Class,
typename MethodPtr>
75 : method_ptr_(method_ptr), obj_ptr_(obj_ptr) {}
77 template <
typename Result,
typename ArgumentTuple>
78 Result
Perform(
const ArgumentTuple& args)
const {
80 obj_ptr_, method_ptr_, args);
87 const MethodPtr method_ptr_;
88 Class*
const obj_ptr_;
97template<
typename InputIterator,
typename OutputIterator>
100 OutputIterator output) {
101 for (; first != last; ++first, ++output) {
113template <
typename FunctionImpl>
115 FunctionImpl function_impl) {
122template <
class Class,
typename MethodPtr>
124 Class* obj_ptr, MethodPtr method_ptr) {
133template <
typename InnerAction>
134inline internal::WithArgsAction<InnerAction>
144template <
int k,
typename InnerAction>
145inline internal::WithArgsAction<InnerAction, k>
156# pragma warning(push)
157# pragma warning(disable:4100)
162 HAS_1_TEMPLATE_PARAMS(
int, k),
163 AND_0_VALUE_PARAMS()) {
164 return ::testing::get<k>(args);
170 HAS_1_TEMPLATE_PARAMS(
int, k),
172 *
pointer = ::testing::get<k>(args);
178 HAS_1_TEMPLATE_PARAMS(
int, k),
180 *
pointer = *::testing::get<k>(args);
186 HAS_1_TEMPLATE_PARAMS(
int, k),
187 AND_1_VALUE_PARAMS(
value)) {
188 typedef typename ::testing::tuple_element<k, args_type>::type argk_type;
193 SetArgReferee_must_be_used_with_a_reference_argument);
194 ::testing::get<k>(args) =
value;
203 HAS_1_TEMPLATE_PARAMS(
int, k),
204 AND_2_VALUE_PARAMS(first, last)) {
209 ::std::copy(first, last, ::testing::get<k>(args));
216 HAS_1_TEMPLATE_PARAMS(
int, k),
217 AND_0_VALUE_PARAMS()) {
218 delete ::testing::get<k>(args);
226#if GTEST_HAS_EXCEPTIONS
230# pragma warning(push)
231# pragma warning(disable:4702)
233ACTION_P(Throw, exception) {
throw exception; }
InvokeAction(FunctionImpl function_impl)
Result Perform(const ArgumentTuple &args)
InvokeMethodAction(Class *obj_ptr, MethodPtr method_ptr)
Result Perform(const ArgumentTuple &args) const
#define ACTION_P(name, p0)
#define ACTION_TEMPLATE(name, template_params, value_params)
#define GTEST_DISALLOW_ASSIGN_(type)
#define GTEST_COMPILE_ASSERT_(expr, msg)
OutputIterator CopyElements(InputIterator first, InputIterator last, OutputIterator output)
internal::WithArgsAction< InnerAction, k > WithArg(const InnerAction &action)
PolymorphicAction< Impl > MakePolymorphicAction(const Impl &impl)
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
const GenericPointer< typename T::ValueType > & pointer