Timer now contains an invoker instead of inheriting
the idea is that an invoker holds a weak_ptr to a steppable. and anything with an invoker can advance a steppable app::add_sort has become too heavy because of the way timer and invoker are initialized now.
This commit is contained in:
+2
-4
@@ -30,14 +30,12 @@ int main() {
|
||||
|
||||
auto myviewsession = make_unique<ViewSession>();
|
||||
auto mytimermanager = make_unique<TimerManager>();
|
||||
|
||||
|
||||
//create app with initialized dependencies
|
||||
App myapp(std::move(myviewsession),std::move(mytimermanager));
|
||||
|
||||
//add and connect data
|
||||
Timer timer(0, chrono::milliseconds(250));
|
||||
myapp.timermanager->timers.push_back(timer);
|
||||
myapp.add_sort(myinput, "bsort", myapp.timermanager->timers.back());
|
||||
myapp.add_sort(myinput, "bsort");
|
||||
|
||||
//actually start the app
|
||||
myapp.run();
|
||||
|
||||
Reference in New Issue
Block a user