Changeset View
Changeset View
Standalone View
Standalone View
3rdparty/mockitopp/detail/stubbing/action.hpp
Show All 16 Lines | 7 | { | |||
---|---|---|---|---|---|
17 | struct returnable_action : public action<R> | 17 | struct returnable_action : public action<R> | ||
18 | { | 18 | { | ||
19 | R _returnable; | 19 | R _returnable; | ||
20 | 20 | | |||
21 | returnable_action(const R& returnable) | 21 | returnable_action(const R& returnable) | ||
22 | : _returnable(returnable) | 22 | : _returnable(returnable) | ||
23 | {} | 23 | {} | ||
24 | 24 | | |||
25 | R invoke() { return _returnable; } | 25 | R invoke() override { return _returnable; } | ||
26 | }; | 26 | }; | ||
27 | 27 | | |||
28 | template <> | 28 | template <> | ||
29 | struct returnable_action<void> : public action<void> | 29 | struct returnable_action<void> : public action<void> | ||
30 | { | 30 | { | ||
31 | void invoke() {} | 31 | void invoke() override {} | ||
32 | }; | 32 | }; | ||
33 | 33 | | |||
34 | template <typename R, typename T> | 34 | template <typename R, typename T> | ||
35 | struct throwable_action : public action<R> | 35 | struct throwable_action : public action<R> | ||
36 | { | 36 | { | ||
37 | T _throwable; | 37 | T _throwable; | ||
38 | 38 | | |||
39 | throwable_action(const T& throwable) | 39 | throwable_action(const T& throwable) | ||
40 | : _throwable(throwable) | 40 | : _throwable(throwable) | ||
41 | {} | 41 | {} | ||
42 | 42 | | |||
43 | R invoke() { throw _throwable; } | 43 | R invoke() override { throw _throwable; } | ||
44 | }; | 44 | }; | ||
45 | } // namespace detail | 45 | } // namespace detail | ||
46 | } // namespace mockitopp | 46 | } // namespace mockitopp | ||
47 | 47 | | |||
48 | #endif //__MOCKITOPP_ACTION_HPP__ | 48 | #endif //__MOCKITOPP_ACTION_HPP__ |