Skip to content

Commit

Permalink
allocate and pass in the results writer; writing results should take …
Browse files Browse the repository at this point in the history
…const reference
  • Loading branch information
sbashford committed Nov 3, 2023
1 parent 88c19c9 commit 0ee3569
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct Result {
Point point{};
};

void write(std::ostream &, std::vector<Result> &);
void write(std::ostream &, const std::vector<Result> &);

class Interactor {
public:
Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/EyeTrackerCalibration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ static void write(std::ostream &stream, const std::vector<Point> &v) {
stream << ']';
}

void write(std::ostream &stream, std::vector<Result> &v) {
void write(std::ostream &stream, const std::vector<Result> &v) {
stream << "Point|Left|Right\n";
for (const auto &result : v) {
stream << '[';
Expand Down
3 changes: 2 additions & 1 deletion macos/main/with-tobii.mm
Original file line number Diff line number Diff line change
Expand Up @@ -424,8 +424,9 @@ static void initialize(TobiiProTracker &tracker,
validationSubjectPresenter, validationTesterPresenter, validator,
{{0.5, 0.5}, {0.3F, 0.3F}, {0.3F, 0.7F}, {0.7F, 0.3F}, {0.7F, 0.7F}}};
static auto calibrator{tracker.calibrator()};
static NaiveResultsWriter resultsWriter;
static InteractorImpl interactor{subjectPresenter, testerPresenter,
calibrator,
calibrator, resultsWriter,
{{0.5, 0.5}, {0.1F, 0.1F}, {0.1F, 0.9F}, {0.9F, 0.1F}, {0.9F, 0.9F}}};
static Controller controller{testerUI, interactor};
static validation::Controller validationController{
Expand Down

0 comments on commit 0ee3569

Please sign in to comment.