27constexpr ServiceId WrapServiceId(uint32_t
id);
28constexpr uint32_t UnwrapServiceId(ServiceId
id);
37 constexpr explicit ServiceId(uint32_t
id) : id_(
id) {}
38 friend constexpr ServiceId internal::WrapServiceId(uint32_t
id);
39 friend constexpr uint32_t internal::UnwrapServiceId(
ServiceId id);
44 return internal::UnwrapServiceId(lhs) == internal::UnwrapServiceId(rhs);
47constexpr bool operator!=(ServiceId lhs, ServiceId rhs) {
53constexpr bool operator<(ServiceId lhs, ServiceId rhs) {
54 return internal::UnwrapServiceId(lhs) < internal::UnwrapServiceId(rhs);
57constexpr bool operator>(ServiceId lhs, ServiceId rhs) {
return rhs < lhs; }
59constexpr bool operator<=(ServiceId lhs, ServiceId rhs) {
return !(lhs > rhs); }
61constexpr bool operator>=(ServiceId lhs, ServiceId rhs) {
return !(lhs < rhs); }
65constexpr ServiceId WrapServiceId(uint32_t
id) {
return ServiceId(
id); }
66constexpr uint32_t UnwrapServiceId(ServiceId
id) {
return id.id_; }
74struct hash<
pw::rpc::ServiceId> {
76 return hash<uint32_t>{}(::pw::rpc::internal::UnwrapServiceId(
id));
Definition: service_id.h:35
The Pigweed namespace.
Definition: alignment.h:27