79 inline type::type(const ::platform::type &
type) :
80 m_typeid(
type.m_typeid),
81 m_customid(
type.m_customid)
86 inline type::type(const ::std::type_info &info) :
92 inline type::type(const ::scoped_string &scopedstrTypeName) :
93 m_customid(scopedstrTypeName)
98 inline type::type(const ::type_iptr_pair &ipairId):
104 inline type::type(const ::atom &
atom) :
113 template<
typename TYPE>
114 inline type::type(
const TYPE *p) : type(typeid(*(TYPE *)p))
117 template<
typename TYPE>
118 inline type::type(
const TYPE &t)
119 requires (!is_raw_pointer <TYPE>) : type(typeid(t))
122 template<
typename BASE>
123 inline type::type(const ::pointer<BASE> &p) : type(p.m_p)
128 inline const ::string &type::raw_name()
const {
return m_typeid.m_strRawTypeName; }
129 inline const ::string &type::name()
const {
return m_typeid.m_strTypeName; }
130 inline const ::string &type::text()
const {
return m_typeid.m_strTypeName.has_character() ? m_typeid.m_strTypeName : m_customid.m_strNameId; }
131 inline const_char_pointer type::c_str()
const {
return m_typeid.m_strTypeName.c_str(); }
132 inline bool type::is_set()
const
134 return m_typeid.is_set() || m_customid.is_set();
137 inline bool type::is_empty()
const {
return !is_set(); }
138 inline type::operator bool()
const {
return is_set(); }
144 inline bool type::operator==(const ::platform::type &type)
const
147 if (m_typeid.is_set() && type.m_typeid.is_set())
150 return m_typeid == type.m_typeid;
153 else if (m_customid.is_set() && type.m_customid.is_set())
156 return m_customid == type.m_customid;
165 inline ::std::strong_ordering type::operator<=>(const ::platform::type &type)
const
168 if (m_typeid.is_set() && type.m_typeid.is_set())
171 return m_typeid <=> type.m_typeid;
174 else if (m_customid.is_set() && type.m_customid.is_set())
177 return m_customid <=> type.m_customid;
181 return ::order(this->is_set(), type.is_set());
191template<
typename TYPE>
192inline ::platform::type type()
198inline ::platform::type type(const ::std::type_info &info) {
return info; }
201inline ::platform::type type(const ::scoped_string &scopedstrTypeName) {
return scopedstrTypeName; }
204template<
typename TYPE>
205inline ::platform::type type(
const TYPE *p)
207 return typeid(*(TYPE *)p);
211template<
typename TYPE>
212inline ::platform::type type(
const TYPE &t)
218template<
typename BASE>
219inline ::platform::type type(const ::pointer<BASE> &p)
228inline type_custom_id::type_custom_id()
232inline type_custom_id::type_custom_id(const_char_pointer pszNameId):
233m_strNameId(pszNameId)
239inline type_custom_id::type_custom_id(const ::string_literal& strliteralNameId) :
240 m_strNameId(strliteralNameId)
246inline type_custom_id::type_custom_id(const ::scoped_string & scopedstrNameId):
247m_strNameId(scopedstrNameId)
252inline type_custom_id::type_custom_id(const ::type_iptr_pair & ipairId) :
257inline type_custom_id::type_custom_id(const ::scoped_string & scopedstrNameId, const ::type_iptr_pair & ipairId):
258m_strNameId(scopedstrNameId),
265inline type_custom_id::type_custom_id(enum_task_tool etasktool) :
273inline type_custom_id::type_custom_id(const ::atom &
atom)
280 else if (atom.is_integer())
282 m_ipairId.m_element1 = (::iptr)atom.m_etype;
283 m_ipairId.m_element2 = (::iptr)atom.m_iLargest;
290inline constexpr bool type_custom_id::is_set()
const
297type_id::type_id() :m_typeindex(::std::type_index(typeid(void)))
304type_id::type_id(const ::type_id &
type_id):
305m_typeindex(
type_id.m_typeindex),
306m_strRawTypeName(
type_id.m_strRawTypeName),
307m_strTypeName(
type_id.m_strTypeName)
313type_id::type_id(const ::std::type_info &info) :
315m_strRawTypeName(::type_raw_name(info)),
316m_strTypeName(::type_name(info))
326inline bool type_id::is_set()
const
335bool type_id::operator == (const ::type_id &
type_id)
const
338 if (::is_type_index_set(
m_typeindex) && ::is_type_index_set(type_id.m_typeindex))
344 else if (
m_strRawTypeName.has_character() && type_id.m_strRawTypeName.has_character())
350 else if (
m_strTypeName.has_character() && type_id.m_strTypeName.has_character())
357 return ::is_equivalent(this->is_set(), type_id.is_set());
362::std::strong_ordering type_id::operator <=> (const ::type_id &
type_id)
const
365 if (::is_type_index_set(
m_typeindex) && ::is_type_index_set(type_id.m_typeindex))
371 else if (
m_strRawTypeName.has_character() && type_id.m_strRawTypeName.has_character())
377 else if (
m_strTypeName.has_character() && type_id.m_strTypeName.has_character())
384 return ::order(this->is_set(), type_id.is_set());
389inline bool type_custom_id::operator == (const ::type_custom_id & typecustomid)
const
392 if (
m_ipairId.is_set() && typecustomid.m_ipairId.is_set())
395 return m_ipairId == typecustomid.m_ipairId;
398 else if (
m_strNameId.has_character() && typecustomid.m_strNameId.has_character())
405 return ::is_equivalent(this->is_set(), typecustomid.is_set());
410inline ::std::strong_ordering type_custom_id::operator <=> (const ::type_custom_id & typecustomid)
const
413 if (
m_ipairId.is_set() && typecustomid.m_ipairId.is_set())
419 else if (
m_strNameId.has_character() && typecustomid.m_strNameId.has_character())
426 return ::order(this->is_set(), typecustomid.is_set());
::string m_strNameId
Definition type.h:163
::type_iptr_pair m_ipairId
m_ipair isn't empty it can be used as a key
Definition type.h:165
::string m_strTypeName
type name as obtained from demangle(typeid().name())
Definition type.h:55
::std::type_index m_typeindex
type index as obtained from std::type_index(typeid())
Definition type.h:51
::string m_strRawTypeName
raw type name as obtained from typeid().raw_name()
Definition type.h:53