diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-21 09:31:47 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-06-25 13:59:48 +0200 |
commit | f77492425703122c9b977ba3e0f9f5fdd80a08d1 (patch) | |
tree | 7d6eef47217d715c04d74f0d7c83e1ce0b2f2f6f /src | |
parent | 2ad759136ae9f39e1842ef80779dfe127a19beba (diff) | |
download | justbuild-f77492425703122c9b977ba3e0f9f5fdd80a08d1.tar.gz |
Make IExecutionApi::Ptr a shared pointer to const
...and use it in ApiBundle.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/execution_api/common/api_bundle.cpp | 2 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/api_bundle.hpp | 6 | ||||
-rw-r--r-- | src/buildtool/execution_api/common/execution_api.hpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/buildtool/execution_api/common/api_bundle.cpp b/src/buildtool/execution_api/common/api_bundle.cpp index 85ab49f1..bbcaa3b5 100644 --- a/src/buildtool/execution_api/common/api_bundle.cpp +++ b/src/buildtool/execution_api/common/api_bundle.cpp @@ -25,7 +25,7 @@ ApiBundle::ApiBundle( remote{CreateRemote(remote_address)} {} auto ApiBundle::CreateRemote(std::optional<ServerAddress> const& address) const - -> gsl::not_null<std::shared_ptr<IExecutionApi>> { + -> gsl::not_null<IExecutionApi::Ptr> { if (address) { ExecutionConfiguration config; config.skip_cache_lookup = false; diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp index 2f393dba..58a80677 100644 --- a/src/buildtool/execution_api/common/api_bundle.hpp +++ b/src/buildtool/execution_api/common/api_bundle.hpp @@ -33,10 +33,10 @@ struct ApiBundle final { std::optional<ServerAddress> const& remote_address); [[nodiscard]] auto CreateRemote(std::optional<ServerAddress> const& address) - const -> gsl::not_null<std::shared_ptr<IExecutionApi>>; + const -> gsl::not_null<IExecutionApi::Ptr>; - gsl::not_null<std::shared_ptr<IExecutionApi>> const local; - gsl::not_null<std::shared_ptr<IExecutionApi>> const remote; + gsl::not_null<IExecutionApi::Ptr> const local; + gsl::not_null<IExecutionApi::Ptr> const remote; }; #endif // INCLUDED_SRC_BUILDTOOL_EXECUTION_API_COMMON_API_BUNDLE_HPP diff --git a/src/buildtool/execution_api/common/execution_api.hpp b/src/buildtool/execution_api/common/execution_api.hpp index 5b6743e3..72663c2e 100644 --- a/src/buildtool/execution_api/common/execution_api.hpp +++ b/src/buildtool/execution_api/common/execution_api.hpp @@ -34,7 +34,7 @@ /// Can be used to create actions. class IExecutionApi { public: - using Ptr = std::unique_ptr<IExecutionApi>; + using Ptr = std::shared_ptr<IExecutionApi const>; IExecutionApi() = default; IExecutionApi(IExecutionApi const&) = delete; |