From 2a0bb102db0a2b29fc2140aa73af2f5d48b50de5 Mon Sep 17 00:00:00 2001 From: HampusM Date: Wed, 22 Jun 2022 19:27:12 +0200 Subject: refactor: use the new yacppdic DI container name --- src/bootstrap.cpp | 46 +++++++++++++++++++++++----------------------- src/bootstrap.hpp | 2 +- 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/bootstrap.cpp b/src/bootstrap.cpp index 16d38a3..0b9d972 100644 --- a/src/bootstrap.cpp +++ b/src/bootstrap.cpp @@ -33,34 +33,34 @@ #include -auto bootstrap() noexcept -> yacppdic::Container +auto bootstrap() noexcept -> yacppdic::DIContainer { - auto container = yacppdic::Container(); + auto di_container = yacppdic::DIContainer(); - container.bind().to(); - container.bind().to(); - container.bind().to(); - container.bind().to(); - container.bind().to(); - container.bind().to(); + di_container.bind().to(); + di_container.bind().to(); + di_container.bind().to(); + di_container.bind().to(); + di_container.bind().to(); + di_container.bind().to(); - container.bind().to_factory( - [&container]( + di_container.bind().to_factory( + [&di_container]( const std::shared_ptr &scene, const std::shared_ptr &cursor_controller, const std::shared_ptr &user_input_observer) { - const auto statusline_factory = container.get(); + const auto statusline_factory = di_container.get(); std::shared_ptr status_manager = - container.get(); + di_container.get(); std::shared_ptr generation_tracker = - container.get()(true); + di_container.get()(true); - const auto cell_helper_factory = container.get>(); + const auto cell_helper_factory = di_container.get>(); - std::shared_ptr rle_reader = container.get(); + std::shared_ptr rle_reader = di_container.get(); return std::make_unique( statusline_factory, @@ -73,38 +73,38 @@ auto bootstrap() noexcept -> yacppdic::Container rle_reader); }); - container.bind>().to_factory( + di_container.bind>().to_factory( [](const Bounds &bounds) { return std::make_unique>(bounds); }); - container.bind().to_factory( - [&container](const Bounds &size) + di_container.bind().to_factory( + [&di_container](const Bounds &size) { const auto matrix_factory = - container.get>(); + di_container.get>(); return std::make_unique(matrix_factory(size)); }); - container.bind().to_factory( + di_container.bind().to_factory( [](bool is_paused) { return std::make_unique(is_paused); }); - container.bind>().to_factory( + di_container.bind>().to_factory( [](const IMatrix &matrix) { return std::make_unique>(matrix); }); - container.bind().to_factory( + di_container.bind().to_factory( [](const std::shared_ptr &cursor_controller) { return std::make_unique(cursor_controller); }); - return container; + return di_container; } diff --git a/src/bootstrap.hpp b/src/bootstrap.hpp index 3fd3288..bbe4264 100644 --- a/src/bootstrap.hpp +++ b/src/bootstrap.hpp @@ -2,4 +2,4 @@ #include -auto bootstrap() noexcept -> yacppdic::Container; +auto bootstrap() noexcept -> yacppdic::DIContainer; -- cgit v1.2.3-18-g5258