36 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ 37 #define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ 51 template <
typename FunctionImpl>
59 template <
typename Result,
typename ArgumentTuple>
60 Result
Perform(
const ArgumentTuple& args) {
71 template <
class Class,
typename MethodPtr>
75 : obj_ptr_(obj_ptr), method_ptr_(method_ptr) {}
77 template <
typename Result,
typename ArgumentTuple>
78 Result
Perform(
const ArgumentTuple& args)
const {
80 obj_ptr_, method_ptr_, args);
96 template <
typename FunctionImpl>
98 FunctionImpl function_impl) {
105 template <
class Class,
typename MethodPtr>
107 Class* obj_ptr, MethodPtr method_ptr) {
116 template <
typename InnerAction>
127 template <
int k,
typename InnerAction>
139 # pragma warning(push) 140 # pragma warning(disable:4100) 145 HAS_1_TEMPLATE_PARAMS(
int, k),
146 AND_0_VALUE_PARAMS()) {
147 return std::tr1::get<k>(args);
153 HAS_1_TEMPLATE_PARAMS(
int, k),
154 AND_1_VALUE_PARAMS(pointer)) {
155 *pointer = ::std::tr1::get<k>(args);
161 HAS_1_TEMPLATE_PARAMS(
int, k),
162 AND_1_VALUE_PARAMS(pointer)) {
163 *pointer = *::std::tr1::get<k>(args);
169 HAS_1_TEMPLATE_PARAMS(
int, k),
170 AND_1_VALUE_PARAMS(value)) {
171 typedef typename ::std::tr1::tuple_element<k, args_type>::type argk_type;
176 SetArgReferee_must_be_used_with_a_reference_argument);
177 ::std::tr1::get<k>(args) = value;
186 HAS_1_TEMPLATE_PARAMS(
int, k),
187 AND_2_VALUE_PARAMS(first, last)) {
191 # pragma warning(push) // Saves the current warning state. 192 # pragma warning(disable:4996) // Temporarily disables warning 4996. 194 ::std::copy(first, last, ::std::tr1::get<k>(args));
196 # pragma warning(pop) // Restores the warning state. 203 HAS_1_TEMPLATE_PARAMS(
int, k),
204 AND_0_VALUE_PARAMS()) {
205 delete ::std::tr1::get<k>(args);
209 ACTION_P(ReturnPointee, pointer) {
return *pointer; }
213 #if GTEST_HAS_EXCEPTIONS 217 # pragma warning(push) // Saves the current warning state. 218 # pragma warning(disable:4702) // Temporarily disables warning 4702. 220 ACTION_P(Throw, exception) {
throw exception; }
222 # pragma warning(pop) // Restores the warning state. 225 #endif // GTEST_HAS_EXCEPTIONS 228 # pragma warning(pop) 233 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ Definition: gmock-actions.h:49
Definition: gmock-generated-actions.h:589
Definition: gmock-more-actions.h:72
Definition: gmock-generated-actions.h:51
PolymorphicAction< Impl > MakePolymorphicAction(const Impl &impl)
Definition: gmock-actions.h:398
internal::WithArgsAction< InnerAction, k > WithArg(const InnerAction &action)
Definition: gmock-more-actions.h:129
Definition: gmock-more-actions.h:52
Class *const obj_ptr_
Definition: gmock-more-actions.h:84
const MethodPtr method_ptr_
Definition: gmock-more-actions.h:85
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:699
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
Definition: gmock-more-actions.h:97
ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS())
Definition: gmock-generated-actions.h:2265
InvokeMethodAction(Class *obj_ptr, MethodPtr method_ptr)
Definition: gmock-more-actions.h:74
Result Perform(const ArgumentTuple &args)
Definition: gmock-more-actions.h:60
Definition: gmock-internal-utils.h:338
InvokeAction(FunctionImpl function_impl)
Definition: gmock-more-actions.h:56
GTEST_DISALLOW_ASSIGN_(InvokeAction)
Definition: gmock-actions.h:350
Result Perform(const ArgumentTuple &args) const
Definition: gmock-more-actions.h:78
FunctionImpl function_impl_
Definition: gmock-more-actions.h:65
PolymorphicAction< internal::InvokeMethodAction< Class, MethodPtr > > Invoke(Class *obj_ptr, MethodPtr method_ptr)
Definition: gmock-more-actions.h:106
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
Definition: gmock-more-actions.h:118
ACTION_P(ReturnPointee, pointer)
Definition: gmock-more-actions.h:209
#define Class(ClassName)
Returns the Identifier of the given class.
Definition: CoreIncludes.h:147