Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
profile_registry.hpp
Go to the documentation of this file.
1#pragma once
2
9
14
15#include <cstdint>
16#include <filesystem>
17#include <functional>
18#include <memory>
19#include <string>
20#include <vector>
21
23
27public:
28 virtual ~ProfileValidator() = default;
29
32 virtual std::string_view profile_id() const noexcept = 0;
33
37 virtual std::uint32_t max_profile_version() const noexcept = 0;
38
54 virtual std::vector<std::string> required_roles() const = 0;
55
57 virtual bool supports_capability(std::string_view name) const noexcept = 0;
58
60 virtual runtime::Result<void, CapsuleError>
61 check_compatibility(const Manifest& manifest) const = 0;
62
64 virtual runtime::Result<void, CapsuleError>
65 validate_staged(const Manifest& manifest, const std::filesystem::path& staging_root) const = 0;
66};
67
69public:
73 ProfileRegistry& operator=(ProfileRegistry&&) noexcept;
74
75 void register_profile(std::shared_ptr<ProfileValidator> validator);
76
80 const ProfileValidator* find(std::string_view profile_id) const noexcept;
81
82 std::vector<std::string> registered_profiles() const;
83
84private:
85 struct Impl;
86 std::unique_ptr<Impl> impl_;
87};
88
89} // namespace pulp::authoring_capsule
void register_profile(std::shared_ptr< ProfileValidator > validator)
ProfileRegistry(ProfileRegistry &&) noexcept
std::vector< std::string > registered_profiles() const
const ProfileValidator * find(std::string_view profile_id) const noexcept
Null when the profile is not registered here.
Semantic validation of an extracted staging tree.
Definition profile_registry.hpp:26
virtual std::vector< std::string > required_roles() const =0
Roles this profile requires.
virtual runtime::Result< void, CapsuleError > validate_staged(const Manifest &manifest, const std::filesystem::path &staging_root) const =0
Validate the extracted staging tree without executing it.
virtual std::uint32_t max_profile_version() const noexcept=0
Highest profile version understood.
virtual bool supports_capability(std::string_view name) const noexcept=0
Capabilities this profile can satisfy locally.
virtual std::string_view profile_id() const noexcept=0
The profile this validator answers for, e.g.
virtual runtime::Result< void, CapsuleError > check_compatibility(const Manifest &manifest) const =0
Is the local runtime new enough for this capsule?
The capsule envelope: the only authority for what a capsule is.
Definition archive.hpp:24
Definition generated_event_source.hpp:33
STL namespace.
The result of inspecting a capsule without running any of it.
Result<T, E> — success / failure union for fallible operations.
Admission failure vocabulary for authoring capsules.
A rejection with the exact subject that caused it.
Definition status.hpp:69
Definition manifest.hpp:47