app now just coordinates the components initialized in main

reduced responsibilities of constructors
started using more pointers.
sessions through app rather than app itself.
mostly split view away from app (still hard coded)
haven't decoupled sorts from timers as their actuator yet
This commit is contained in:
2026-08-15 03:04:32 +02:00
parent afdf73ca2e
commit 6e71aeebb4
9 changed files with 123 additions and 98 deletions
+14 -4
View File
@@ -1,4 +1,5 @@
// for now juist CLI, print an arr, then print each it
#include <memory>
#include <string>
#include <vector>
@@ -11,6 +12,7 @@
#include <SFML/Graphics.hpp>
#include "core/app.hpp"
#include "sessions.hpp"
#include "sorters.hpp"
using namespace std::chrono;
@@ -22,13 +24,21 @@ vector<int> dataprovider(){
}
int main() {
vector<SortInput> inputs;
SortInput myinput("arr1", dataprovider());
SortInput myinput2("arr2", dataprovider());
//create data
vector<shared_ptr<SortInput>> inputs;
auto myinput = make_shared<SortInput>("arr1", dataprovider());
auto myinput2 = make_shared<SortInput>("arr2", dataprovider());
inputs.push_back(myinput);
inputs.push_back(myinput2);
App myapp(inputs);
//connect data with sorter
auto myssession = make_unique<SortSession>();
myssession->add_session(myinput, "bsort");
auto myviewsession = make_unique<ViewSession>();
//create app with initialized dependencies
App myapp(std::move(inputs), std::move(myssession), std::move(myviewsession));
myapp.run();
}