summaryrefslogtreecommitdiff
path: root/src/buildtool/serve_api/remote/serve_api.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-20 10:44:52 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-25 13:59:48 +0200
commitc7f83a2d2fa436bf78911e288e1f07576861601e (patch)
treebfa8e4c990473a9e0f2a36eb444a03dfb9713e87 /src/buildtool/serve_api/remote/serve_api.hpp
parent18092e2ff2d33f9f7c25eec995ffb4ac824fe96c (diff)
downloadjustbuild-c7f83a2d2fa436bf78911e288e1f07576861601e.tar.gz
Pass ApiBundle to ServeApi
Diffstat (limited to 'src/buildtool/serve_api/remote/serve_api.hpp')
-rw-r--r--src/buildtool/serve_api/remote/serve_api.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/buildtool/serve_api/remote/serve_api.hpp b/src/buildtool/serve_api/remote/serve_api.hpp
index 89e287a4..9175857b 100644
--- a/src/buildtool/serve_api/remote/serve_api.hpp
+++ b/src/buildtool/serve_api/remote/serve_api.hpp
@@ -29,6 +29,7 @@ class ServeApi final {};
#include "src/buildtool/common/artifact_digest.hpp"
#include "src/buildtool/common/remote/port.hpp"
#include "src/buildtool/common/remote/remote_common.hpp"
+#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/file_system/symlinks_map/pragma_special.hpp"
#include "src/buildtool/serve_api/remote/config.hpp"
#include "src/buildtool/serve_api/remote/configuration_client.hpp"
@@ -37,8 +38,9 @@ class ServeApi final {};
class ServeApi final {
public:
- explicit ServeApi(ServerAddress const& address) noexcept
- : stc_{address}, tc_{address}, cc_{address} {}
+ explicit ServeApi(ServerAddress const& address,
+ gsl::not_null<ApiBundle const*> const& apis) noexcept
+ : stc_{address}, tc_{address, apis}, cc_{address} {}
~ServeApi() noexcept = default;
ServeApi(ServeApi const&) = delete;
@@ -47,10 +49,12 @@ class ServeApi final {
auto operator=(ServeApi&&) -> ServeApi& = delete;
[[nodiscard]] static auto Create(
- RemoteServeConfig const& serve_config) noexcept
+ RemoteServeConfig const& serve_config,
+ gsl::not_null<ApiBundle const*> const& apis) noexcept
-> std::optional<ServeApi> {
if (serve_config.remote_address) {
- return std::make_optional<ServeApi>(*serve_config.remote_address);
+ return std::make_optional<ServeApi>(*serve_config.remote_address,
+ apis);
}
return std::nullopt;
}