Adding std::vector storing all fakes.

This commit is contained in:
sergiotarxz 2022-08-02 05:21:16 +02:00
parent 1739ccc619
commit 1e4f54fe68

2
Fake.h
View File

@ -16,6 +16,7 @@ namespace spy
*/
template <typename H, typename ReturnType, typename... ArgTypes>
extern std::vector<Fake *> fake_list;
class Fake
{
public:
@ -33,6 +34,7 @@ Fake(H& hook, ReturnType (*func)(ArgTypes...))
:hook_(hook)
{
func_ = hook_.patch(func);
fake_list.push_back(&this);
}
template <typename H, typename ReturnType, typename... ArgTypes>