36 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ 37 #define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ 53 template <
typename FunctionImpl>
62 template <
typename Result,
typename ArgumentTuple>
63 Result
Perform(
const ArgumentTuple & args)
75 template <
class Class,
typename MethodPtr>
80 : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
82 template <
typename Result,
typename ArgumentTuple>
83 Result
Perform(
const ArgumentTuple & args)
const 86 obj_ptr_, method_ptr_, args);
90 Class *
const obj_ptr_;
91 const MethodPtr method_ptr_;
102 template <
typename FunctionImpl>
104 FunctionImpl function_impl)
112 template <
class Class,
typename MethodPtr>
114 Class * obj_ptr, MethodPtr method_ptr)
124 template <
typename InnerAction>
136 template <
int k,
typename InnerAction>
138 WithArg(
const InnerAction & action)
149 # pragma warning(push) 150 # pragma warning(disable:4100) 155 HAS_1_TEMPLATE_PARAMS(
int, k),
156 AND_0_VALUE_PARAMS())
158 return std::tr1::get<k>(args);
164 HAS_1_TEMPLATE_PARAMS(
int, k),
165 AND_1_VALUE_PARAMS(pointer))
167 *pointer = ::std::tr1::get<k>(args);
173 HAS_1_TEMPLATE_PARAMS(
int, k),
174 AND_1_VALUE_PARAMS(pointer))
176 *pointer = *::std::tr1::get<k>(args);
182 HAS_1_TEMPLATE_PARAMS(
int, k),
183 AND_1_VALUE_PARAMS(value))
185 typedef typename ::std::tr1::tuple_element<k, args_type>::type argk_type;
190 SetArgReferee_must_be_used_with_a_reference_argument);
191 ::std::tr1::get<k>(args) = value;
200 HAS_1_TEMPLATE_PARAMS(
int, k),
201 AND_2_VALUE_PARAMS(first, last))
206 # pragma warning(push) // Saves the current warning state. 207 # pragma warning(disable:4996) // Temporarily disables warning 4996. 209 ::std::copy(first, last, ::std::tr1::get<k>(args));
211 # pragma warning(pop) // Restores the warning state. 218 HAS_1_TEMPLATE_PARAMS(
int, k),
219 AND_0_VALUE_PARAMS())
221 delete ::std::tr1::get<k>(args);
225 ACTION_P(ReturnPointee, pointer) {
return *pointer; }
229 #if GTEST_HAS_EXCEPTIONS 233 # pragma warning(push) // Saves the current warning state. 234 # pragma warning(disable:4702) // Temporarily disables warning 4702. 236 ACTION_P(Throw, exception) {
throw exception; }
238 # pragma warning(pop) // Restores the warning state. 241 #endif // GTEST_HAS_EXCEPTIONS 244 # pragma warning(pop) 249 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
InvokeMethodAction(Class *obj_ptr, MethodPtr method_ptr)
PolymorphicAction< Impl > MakePolymorphicAction(const Impl &impl)
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
Result Perform(const ArgumentTuple &args) const
#define GTEST_COMPILE_ASSERT_(expr, msg)
InvokeAction(FunctionImpl function_impl)
ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS())
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
GTEST_DISALLOW_ASSIGN_(InvokeAction)
Result Perform(const ArgumentTuple &args)
internal::WithArgsAction< InnerAction, k > WithArg(const InnerAction &action)
ACTION_P(ReturnPointee, pointer)
FunctionImpl function_impl_