36 #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ 37 #define GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_ 51 template <
typename FunctionImpl>
57 : function_impl_(function_impl) {}
59 template <
typename Result,
typename ArgumentTuple>
60 Result
Perform(
const ArgumentTuple& args) {
65 FunctionImpl function_impl_;
71 template <
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_;
97 template<
typename InputIterator,
typename OutputIterator>
100 OutputIterator output) {
101 for (; first != last; ++first, ++output) {
113 template <
typename FunctionImpl>
115 FunctionImpl function_impl) {
122 template <
class Class,
typename MethodPtr>
124 Class* obj_ptr, MethodPtr method_ptr) {
133 template <
typename InnerAction>
144 template <
int k,
typename InnerAction>
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),
171 AND_1_VALUE_PARAMS(pointer)) {
172 *pointer = ::testing::get<k>(args);
178 HAS_1_TEMPLATE_PARAMS(
int, k),
179 AND_1_VALUE_PARAMS(pointer)) {
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);
222 ACTION_P(ReturnPointee, pointer) {
return *pointer; }
226 #if GTEST_HAS_EXCEPTIONS 230 # pragma warning(push) // Saves the current warning state. 231 # pragma warning(disable:4702) // Temporarily disables warning 4702. 233 ACTION_P(Throw, exception) {
throw exception; }
235 # pragma warning(pop) // Restores the warning state. 238 #endif // GTEST_HAS_EXCEPTIONS 241 # pragma warning(pop) 246 #endif // GMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
InvokeMethodAction(Class *obj_ptr, MethodPtr method_ptr)
Result Perform(const ArgumentTuple &args) const
InvokeAction(FunctionImpl function_impl)
PolymorphicAction< Impl > MakePolymorphicAction(const Impl &impl)
#define GTEST_DISALLOW_ASSIGN_(type)
internal::WithArgsAction< InnerAction, k > WithArg(const InnerAction &action)
#define GTEST_COMPILE_ASSERT_(expr, msg)
PolymorphicAction< internal::InvokeAction< FunctionImpl > > Invoke(FunctionImpl function_impl)
ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS())
Result Perform(const ArgumentTuple &args)
PolymorphicAction< internal::InvokeMethodAction< Class, MethodPtr > > Invoke(Class *obj_ptr, MethodPtr method_ptr)
internal::WithArgsAction< InnerAction > WithoutArgs(const InnerAction &action)
OutputIterator CopyElements(InputIterator first, InputIterator last, OutputIterator output)
ACTION_P(ReturnPointee, pointer)