2#include <score/tools/std/Optional.hpp>
5#if __cplusplus > 202302L
12template <
typename T,
bool Order>
15template <
typename Element,
typename Model,
bool Order>
57template <
typename tag,
typename impl>
66 template <
typename Element,
typename Model,
bool Order>
70 using value_type = impl;
79 : m_id{std::move(other.m_id)}
82 template <
typename other>
83 requires(std::is_base_of_v<tag, other>)
89 template <
typename other>
90 requires(std::is_base_of_v<tag, other>)
112 explicit id_base_t(value_type val) noexcept
113 : m_id{std::move(val)}
117 explicit id_base_t(tag& element) noexcept
123 id_base_t& operator=(tag& element)
noexcept
133 return lhs.m_id == rhs.m_id;
138 return lhs.m_id != rhs.m_id;
143 return lhs.val() < rhs.val();
146 explicit operator value_type()
const noexcept {
return m_id; }
148 const value_type& val()
const noexcept {
return m_id; }
150 void setVal(value_type val)
noexcept { m_id = val; }
153 mutable QPointer<QObject> m_ptr;
160template <
typename tag>
166template <
typename tag>
167using OptionalId = std::optional<Id<tag>>;
171template <
typename tag>
174 std::size_t operator()(
const Id<tag>&
id)
const
176 return std::hash<int32_t>{}(
id.val());
181uint qHash(
const Id<T>&
id, uint seed)
183 return qHash(*
id.val(), seed);
A map to access child objects through their id.
Definition IdentifiedObjectMap.hpp:16
The IdentifiedObject class.
Definition IdentifiedObject.hpp:19
The id_base_t class.
Definition Identifier.hpp:59
The EntityMap class.
Definition EntityMap.hpp:36
Base toolkit upon which the software is built.
Definition Application.cpp:97