cleanup, timermanager in App is a dependency that takes timers again.

App now adds already constructed Timers
Timer is now an Invoker that takes a weak_ptr to a steppable with a
request()rather than a bool callback.
should eventually be changed to composition
This commit is contained in:
2026-08-23 23:25:04 +02:00
parent 54faab2a28
commit 273ff07a00
10 changed files with 74 additions and 68 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef INVOKER_HPP
#define INVOKER_HPP
#include "steppable.hpp"
#include <memory>
class Invoker {
public:
virtual ~Invoker() = default;
std::weak_ptr<Steppable> target;
void set_target(std::shared_ptr<Steppable> t) { target = t; }
void request() {
if (auto sp = target.lock()) {
sp->step();
}
}
};
#endif