template<class Hash, hasher_t<Hash> Hasher>
bsa::components::key class

A generic key used to uniquely identify an object inside the virtual filesystem.

Template parameters
Hash The hash type used as the underlying key.
Hasher The function used to generate the hash.

Assignment

auto operator=(const key&) -> key& defaulted noexcept
auto operator=(key&&) -> key& defaulted noexcept

Comparison

auto operator<=>(const key& a_lhs, const key& a_rhs) -> std::strong_ordering noexcept
auto operator<=>(const key& a_lhs, const hash_type& a_rhs) -> std::strong_ordering noexcept
auto operator==(const key& a_lhs, const key& a_rhs) -> bool noexcept
auto operator==(const key& a_lhs, const hash_type& a_rhs) -> bool noexcept

Constructors

key() deleted
key(hash_type a_hash) noexcept
Construct a key using a raw hash.
template<concepts::stringable String>
key(String&& a_string) noexcept
Construct a key using a string-like object.
key(const key&) defaulted noexcept
key(key&&) defaulted noexcept

Destructor

~key() defaulted noexcept

Member types

using hash_type = Hash
The underlying hash type.

Observers

auto hash() const -> const hash_type& noexcept
Retrieve a reference to the underlying hash.
auto name() const -> std::string_view noexcept
Retrieve the name that generated the underlying hash.

Function documentation

template<class Hash, hasher_t<Hash> Hasher>
bsa::components::key<Hash, Hasher>::key(hash_type a_hash) noexcept

Construct a key using a raw hash.

Parameters
a_hash The raw hash that identifies the key.

template<class Hash, hasher_t<Hash> Hasher>
template<concepts::stringable String>
bsa::components::key<Hash, Hasher>::key(String&& a_string) noexcept

Construct a key using a string-like object.

Parameters
a_string The string-like object used to generate the underlying hash.