aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/include
diff options
context:
space:
mode:
authorras0219 <533828+ras0219@users.noreply.github.com>2020-12-15 10:28:20 -0800
committerGitHub <noreply@github.com>2020-12-15 10:28:20 -0800
commit595777db2332a3442b73f9af9f656355f207aec9 (patch)
treef29e58eee430f15354698f40101f074722eb00bb /toolsrc/include
parentef7e1abfb1df7b150710f06fb3041daaff939da8 (diff)
downloadvcpkg-595777db2332a3442b73f9af9f656355f207aec9.tar.gz
vcpkg-595777db2332a3442b73f9af9f656355f207aec9.zip
[vcpkg] Remove extra indirection in IVersionedPortfileProvider/IBaselineProvider (#15010)
* [vcpkg] Remove extra indirection in IVersionedPortfileProvider/IBaselineProvider * [vcpkg] Address CR comment Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'toolsrc/include')
-rw-r--r--toolsrc/include/vcpkg/portfileprovider.h37
1 files changed, 6 insertions, 31 deletions
diff --git a/toolsrc/include/vcpkg/portfileprovider.h b/toolsrc/include/vcpkg/portfileprovider.h
index 1ce934c9e..9dbd5ec51 100644
--- a/toolsrc/include/vcpkg/portfileprovider.h
+++ b/toolsrc/include/vcpkg/portfileprovider.h
@@ -41,6 +41,7 @@ namespace vcpkg::PortFileProvider
struct IVersionedPortfileProvider
{
virtual const std::vector<vcpkg::Versions::VersionSpec>& get_port_versions(StringView port_name) const = 0;
+ virtual ~IVersionedPortfileProvider() = default;
virtual ExpectedS<const SourceControlFileLocation&> get_control_file(
const vcpkg::Versions::VersionSpec& version_spec) const = 0;
@@ -48,38 +49,12 @@ namespace vcpkg::PortFileProvider
struct IBaselineProvider
{
- virtual Optional<VersionT> get_baseline_version(StringView port_name) const = 0;
- };
-
- namespace details
- {
- struct BaselineProviderImpl;
- struct VersionedPortfileProviderImpl;
- }
-
- struct VersionedPortfileProvider : IVersionedPortfileProvider, Util::ResourceBase
- {
- explicit VersionedPortfileProvider(const vcpkg::VcpkgPaths& paths);
- ~VersionedPortfileProvider();
-
- const std::vector<vcpkg::Versions::VersionSpec>& get_port_versions(StringView port_name) const override;
-
- ExpectedS<const SourceControlFileLocation&> get_control_file(
- const vcpkg::Versions::VersionSpec& version_spec) const override;
+ virtual ~IBaselineProvider() = default;
- private:
- std::unique_ptr<details::VersionedPortfileProviderImpl> m_impl;
+ virtual Optional<VersionT> get_baseline_version(StringView port_name) const = 0;
};
- struct BaselineProvider : IBaselineProvider, Util::ResourceBase
- {
- explicit BaselineProvider(const vcpkg::VcpkgPaths& paths);
- BaselineProvider(const vcpkg::VcpkgPaths& paths, const std::string& baseline);
- ~BaselineProvider();
-
- Optional<VersionT> get_baseline_version(StringView port_name) const override;
-
- private:
- std::unique_ptr<details::BaselineProviderImpl> m_impl;
- };
+ std::unique_ptr<IBaselineProvider> make_baseline_provider(const vcpkg::VcpkgPaths& paths);
+ std::unique_ptr<IBaselineProvider> make_baseline_provider(const vcpkg::VcpkgPaths& paths, StringView baseline);
+ std::unique_ptr<IVersionedPortfileProvider> make_versioned_portfile_provider(const vcpkg::VcpkgPaths& paths);
}