diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-25 14:53:18 +0200 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-07-30 12:10:06 +0200 |
commit | 8669d48933731f224474a9b1dc55824f87ae26a7 (patch) | |
tree | 7d097fdf3f89e5fc88899c8e7f4723a4870f3e60 /src/buildtool/serve_api/serve_service/target.hpp | |
parent | 69f56ad981da59f026c83b321522ad68283934c5 (diff) | |
download | justbuild-8669d48933731f224474a9b1dc55824f87ae26a7.tar.gz |
Use LocalContext in execution and serve services
The context is passed by not_null const pointer in order to avoid
binding to temporaries, and it or parts of it get stored by const
ref where needed.
Diffstat (limited to 'src/buildtool/serve_api/serve_service/target.hpp')
-rw-r--r-- | src/buildtool/serve_api/serve_service/target.hpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/buildtool/serve_api/serve_service/target.hpp b/src/buildtool/serve_api/serve_service/target.hpp index aaf9bb39..88e5a205 100644 --- a/src/buildtool/serve_api/serve_service/target.hpp +++ b/src/buildtool/serve_api/serve_service/target.hpp @@ -30,12 +30,10 @@ #include "src/buildtool/common/remote/remote_common.hpp" #include "src/buildtool/execution_api/common/api_bundle.hpp" #include "src/buildtool/execution_api/common/execution_api.hpp" -#include "src/buildtool/execution_api/local/config.hpp" +#include "src/buildtool/execution_api/local/context.hpp" #include "src/buildtool/logging/logger.hpp" #include "src/buildtool/serve_api/remote/config.hpp" #include "src/buildtool/serve_api/remote/serve_api.hpp" -#include "src/buildtool/storage/config.hpp" -#include "src/buildtool/storage/storage.hpp" #include "src/utils/cpp/expected.hpp" // The target-level cache service. @@ -43,15 +41,11 @@ class TargetService final : public justbuild::just_serve::Target::Service { public: explicit TargetService( gsl::not_null<RemoteServeConfig const*> const& serve_config, - gsl::not_null<StorageConfig const*> const& storage_config, - gsl::not_null<Storage const*> const& storage, - gsl::not_null<LocalExecutionConfig const*> const& local_exec_config, + gsl::not_null<LocalContext const*> const& local_context, gsl::not_null<ApiBundle const*> const& apis, ServeApi const* serve = nullptr) noexcept : serve_config_{*serve_config}, - storage_config_{*storage_config}, - storage_{*storage}, - local_exec_config_{*local_exec_config}, + local_context_{*local_context}, apis_{*apis}, serve_{serve} {} @@ -132,9 +126,7 @@ class TargetService final : public justbuild::just_serve::Target::Service { private: RemoteServeConfig const& serve_config_; - StorageConfig const& storage_config_; - Storage const& storage_; - LocalExecutionConfig const& local_exec_config_; + LocalContext const& local_context_; ApiBundle const& apis_; ServeApi const* const serve_ = nullptr; std::shared_ptr<Logger> logger_{std::make_shared<Logger>("target-service")}; |