3#include "ll/api/reflection/Reflection.h"
4#include "ll/api/utils/HashUtils.h"
17 [[nodiscard]]
constexpr explicit ServiceId(std::string_view
id,
size_t ver) noexcept
18 : HashedIdBase(hash_utils::HashCombiner{hash_utils::doHash(
id)}.add(ver)),
27 std::string_view name;
29 [[nodiscard]]
constexpr explicit ServiceIdView(std::string_view
id,
size_t ver) noexcept
30 : HashedIdBase(hash_utils::HashCombiner{hash_utils::doHash(
id)}.add(ver)),
34 : HashedIdBase(
id.hash),
36 version(
id.version) {}
40 :
ServiceIdView{ll::reflection::type_unprefix_name_v<T>, version} {}
42[[nodiscard]]
constexpr ServiceId::ServiceId(
ServiceIdView const&
id) noexcept
43: HashedIdBase(
id.hash),
45 version(
id.version) {}
47constexpr ServiceIdView EmptyServiceId{{}, 0};
50constexpr ServiceIdView getServiceId = []() -> ServiceIdView {
51 using self = std::remove_cvref_t<T>;
52 if constexpr (
requires { self::ServiceId; } && self::ServiceId != EmptyServiceId) {
53 return self::ServiceId;
55 static_assert(traits::always_false<T>,
"ServiceId not defined for type");
Definition ServiceId.h:24
Definition ServiceId.h:12