2#include "gaia/config/config.h"
7#include "gaia/cnt/sparse_storage.h"
8#include "gaia/core/hashing_policy.h"
9#include "gaia/core/utility.h"
10#include "gaia/ecs/id_fwd.h"
11#include "gaia/ser/ser_common.h"
15#define GAIA_ID(type) GAIA_ID_##type
17 using Identifier = uint64_t;
18 inline constexpr Identifier IdentifierBad = (Identifier)-1;
19 inline constexpr Identifier EntityCompMask = IdentifierBad << 1;
20 inline constexpr IdentifierId IdentifierIdBad = (IdentifierId)-1;
22 enum class DataStorageType : uint32_t {
34#define GAIA_STORAGE(storage_name) static constexpr auto gaia_Data_Storage = ::gaia::ecs::DataStorageType::storage_name
44 static constexpr uint32_t IdMask = IdentifierIdBad;
46 static constexpr uint32_t MaxComponentSize_Bits = 13;
48 static constexpr uint32_t MaxComponentSizeInBytes = (1 << MaxComponentSize_Bits) - 1;
50 static constexpr uint32_t MaxAlignment_Bits = MaxComponentSize_Bits;
52 static constexpr uint32_t MaxAlignment = MaxComponentSizeInBytes;
59 IdentifierData
size : MaxComponentSize_Bits;
61 IdentifierData
alig : MaxAlignment_Bits;
65 IdentifierData
soa : meta::StructToTupleMaxTypes_Bits;
69 static_assert(
sizeof(
InternalData) ==
sizeof(Identifier));
80 Component(uint32_t
id, uint32_t soa, uint32_t size, uint32_t alig, DataStorageType storage) noexcept {
85 data.storage = (IdentifierData)storage;
91 GAIA_NODISCARD
constexpr auto id() const noexcept {
92 return (uint32_t)data.id;
97 GAIA_NODISCARD
constexpr auto soa() const noexcept {
98 return (uint32_t)data.soa;
103 GAIA_NODISCARD
constexpr auto size() const noexcept {
104 return (uint32_t)data.size;
109 GAIA_NODISCARD
constexpr auto alig() const noexcept {
110 return (uint32_t)data.alig;
115 GAIA_NODISCARD
constexpr DataStorageType
storage_type() const noexcept {
116 return (DataStorageType)data.storage;
121 GAIA_NODISCARD
constexpr auto value() const noexcept {
125 GAIA_NODISCARD
constexpr bool operator==(
Component other)
const noexcept {
126 return value() == other.value();
129 GAIA_NODISCARD
constexpr bool operator!=(Component other)
const noexcept {
130 return value() != other.value();
133 GAIA_NODISCARD
constexpr bool operator<(Component other)
const noexcept {
134 return id() < other.id();
140 template <
typename Serializer>
141 void save(Serializer& s)
const;
146 template <
typename Serializer>
147 void load(Serializer& s);
154 enum EntityKind : uint8_t {
161 inline constexpr const char* EntityKindString[] = {
"Gen",
"Uni"};
168 template <
typename T>
170 static_assert(core::is_raw_v<T>);
172 std::is_trivial_v<T> ||
176 "Non-trivial Uni component must implement operator==");
179 static constexpr EntityKind
Kind = EntityKind::EK_Uni;
191 template <
typename,
typename =
void>
192 struct has_entity_kind: std::false_type {};
193 template <
typename T>
194 struct has_entity_kind<T, std::void_t<decltype(T::Kind)>>: std::true_type {};
196 template <
typename T>
197 struct ExtractComponentType_NoEntityKind {
199 static constexpr EntityKind Kind = EntityKind::EK_Gen;
202 using Type = core::raw_t<T>;
204 using TypeFull = Type;
206 using TypeOriginal = T;
209 template <
typename T>
210 struct ExtractComponentType_WithEntityKind {
212 static constexpr EntityKind Kind = T::Kind;
215 using Type =
typename T::TType;
217 using TypeFull = std::conditional_t<Kind == EntityKind::EK_Gen, Type, uni<Type>>;
219 using TypeOriginal =
typename T::TTypeOriginal;
222 template <
typename,
typename =
void>
223 struct is_gen_component: std::true_type {};
224 template <
typename T>
225 struct is_gen_component<T, std::void_t<decltype(T::Kind)>>: std::bool_constant<T::Kind == EntityKind::EK_Gen> {};
227 template <
typename T,
typename =
void>
228 struct component_type {
229 using type =
typename detail::ExtractComponentType_NoEntityKind<T>;
231 template <
typename T>
232 struct component_type<T, std::void_t<decltype(T::Kind)>> {
233 using type =
typename detail::ExtractComponentType_WithEntityKind<T>;
238 template <
typename T>
239 using component_type_t =
typename detail::component_type<T>::type;
241 template <
typename T>
242 inline constexpr EntityKind entity_kind_v = component_type_t<T>::Kind;
261 template <
typename Rel,
typename Tgt>
262 class pair:
public detail::pair_base {
263 using rel_comp_type = component_type_t<Rel>;
264 using tgt_comp_type = component_type_t<Tgt>;
268 using rel =
typename rel_comp_type::TypeFull;
270 using tgt =
typename tgt_comp_type::TypeFull;
280 using type = std::conditional_t<!std::is_empty_v<rel_type> || std::is_empty_v<tgt_type>,
rel,
tgt>;
284 template <
typename T>
287 static constexpr bool value = std::is_base_of<detail::pair_base, core::raw_t<T>>
::value;
298 static constexpr uint32_t IdMask = IdentifierIdBad;
324 static_assert(
sizeof(
InternalData) ==
sizeof(Identifier));
333 constexpr Entity() noexcept: val(IdentifierBad) {};
338 template <
typename T,
typename = std::enable_if_t<std::is_same_v<T, Identifier>>>
339 constexpr Entity(T value)
noexcept: val(value) {}
342 Entity(EntityId
id, IdentifierData gen)
noexcept {
348 Entity(EntityId
id, IdentifierData gen,
bool isEntity,
bool isPair, EntityKind kind)
noexcept {
359 GAIA_NODISCARD
constexpr auto id() const noexcept {
360 return (uint32_t)data.id;
365 GAIA_NODISCARD
constexpr auto gen() const noexcept {
366 return (uint32_t)data.gen;
371 GAIA_NODISCARD
constexpr bool entity() const noexcept {
372 return data.ent != 0;
377 GAIA_NODISCARD
constexpr bool pair() const noexcept {
378 return data.pair != 0;
383 GAIA_NODISCARD
constexpr bool comp() const noexcept {
384 return (data.pair | data.ent) == 0;
389 GAIA_NODISCARD
constexpr auto kind() const noexcept {
390 return (EntityKind)data.kind;
395 GAIA_NODISCARD
constexpr auto value() const noexcept {
399 GAIA_NODISCARD
constexpr bool operator==(
Entity other)
const noexcept {
400 return value() == other.value();
403 GAIA_NODISCARD
constexpr bool operator!=(Entity other)
const noexcept {
404 return value() != other.value();
407 GAIA_NODISCARD
constexpr bool operator<(Entity other)
const noexcept {
408 return value() < other.value();
410 GAIA_NODISCARD
constexpr bool operator<=(Entity other)
const noexcept {
411 return value() <= other.value();
414 GAIA_NODISCARD
constexpr bool operator>(Entity other)
const noexcept {
415 return value() > other.value();
417 GAIA_NODISCARD
constexpr bool operator>=(Entity other)
const noexcept {
418 return value() >= other.value();
424 template <
typename Serializer>
425 void save(Serializer& s)
const;
430 template <
typename Serializer>
431 void load(Serializer& s);
434 inline static const Entity EntityBad = Entity(IdentifierBad);
438 struct EntityLoadRemapState {
439 uint32_t savedLastCoreComponentId = 0;
440 uint32_t currLastCoreComponentId = 0;
441 bool remapComponentIds =
false;
449 inline thread_local EntityLoadRemapState g_entityLoadRemapState{};
451 struct EntityLoadRemapGuard {
452 EntityLoadRemapState prev;
454 EntityLoadRemapGuard(
455 uint32_t savedLastCoreComponentId, uint32_t currLastCoreComponentId,
bool remapComponentIds)
noexcept:
456 prev(g_entityLoadRemapState) {
457 g_entityLoadRemapState.savedLastCoreComponentId = savedLastCoreComponentId;
458 g_entityLoadRemapState.currLastCoreComponentId = currLastCoreComponentId;
459 g_entityLoadRemapState.remapComponentIds = remapComponentIds;
460 g_entityLoadRemapState.active =
true;
463 ~EntityLoadRemapGuard() {
464 g_entityLoadRemapState = prev;
467 EntityLoadRemapGuard(
const EntityLoadRemapGuard&) =
delete;
468 EntityLoadRemapGuard& operator=(
const EntityLoadRemapGuard&) =
delete;
469 EntityLoadRemapGuard(EntityLoadRemapGuard&&) =
delete;
470 EntityLoadRemapGuard& operator=(EntityLoadRemapGuard&&) =
delete;
473 GAIA_NODISCARD
inline uint32_t remap_loaded_entity_id(
474 uint32_t
id, uint32_t savedLastCoreComponentId, uint32_t currLastCoreComponentId)
noexcept {
476 id <= savedLastCoreComponentId ||
477 currLastCoreComponentId <= savedLastCoreComponentId
481 return id + (currLastCoreComponentId - savedLastCoreComponentId);
484 GAIA_NODISCARD
inline uint32_t remap_loaded_entity_id(uint32_t
id)
noexcept {
485 const auto& state = g_entityLoadRemapState;
489 return remap_loaded_entity_id(
id, state.savedLastCoreComponentId, state.currLastCoreComponentId);
492 GAIA_NODISCARD
inline Entity
493 remap_loaded_entity(Entity entity, uint32_t savedLastCoreComponentId, uint32_t currLastCoreComponentId)
noexcept {
494 if (entity == EntityBad)
497 if (!entity.pair()) {
499 (EntityId)remap_loaded_entity_id(entity.id(), savedLastCoreComponentId, currLastCoreComponentId),
500 entity.gen(), entity.entity(),
false, entity.kind());
504 (EntityId)remap_loaded_entity_id(entity.id(), savedLastCoreComponentId, currLastCoreComponentId),
505 (IdentifierData)remap_loaded_entity_id(entity.gen(), savedLastCoreComponentId, currLastCoreComponentId),
506 entity.entity(),
true, entity.kind());
509 GAIA_NODISCARD
inline Entity remap_loaded_entity(Entity entity)
noexcept {
510 const auto& state = g_entityLoadRemapState;
514 return remap_loaded_entity(entity, state.savedLastCoreComponentId, state.currLastCoreComponentId);
519 template <
typename Serializer>
524 template <
typename Serializer>
527 *
this = detail::remap_loaded_entity(*
this);
530 template <
typename Serializer>
535 template <
typename Serializer>
538 if (detail::g_entityLoadRemapState.active && detail::g_entityLoadRemapState.remapComponentIds)
554 return {core::calculate_hash64(entity.
value())};
559 static constexpr bool IsDirectHashKey =
true;
579 return (
size_t)m_hash.
hash;
583 if GAIA_LIKELY (m_hash != other.m_hash)
586 return m_entity == other.m_entity;
590 return !operator==(other);
594 inline static const EntityLookupKey EntityBadLookupKey = EntityLookupKey(EntityBad);
605 uint32_t alias_len{};
621 operator Entity()
const noexcept {
623 m_first.id(), m_second.
id(),
626 (
bool)m_first.kind(),
645 bool operator==(
const pair& other)
const {
646 return m_first == other.m_first && m_second == other.m_second;
648 bool operator!=(
const pair& other)
const {
649 return !operator==(other);
653 using Pair = pair<Entity, Entity>;
661 template <
typename T,
typename U =
void>
663 using type =
typename component_type<T>::type;
666 template <
typename T>
667 struct actual_type<T, std::enable_if_t<is_pair<T>::value>> {
668 using storage_type =
typename T::type;
669 using type =
typename component_type<storage_type>::type;
674 template <
typename T>
675 using actual_type_t =
typename detail::actual_type<T>::type;
729 inline Entity Core =
Entity(0, 0,
false,
false, EntityKind::EK_Gen);
733 inline Entity OnDelete =
Entity(3, 0,
false,
false, EntityKind::EK_Gen);
734 inline Entity OnDeleteTarget =
Entity(4, 0,
false,
false, EntityKind::EK_Gen);
735 inline Entity Remove =
Entity(5, 0,
false,
false, EntityKind::EK_Gen);
736 inline Entity Delete =
Entity(6, 0,
false,
false, EntityKind::EK_Gen);
737 inline Entity Error =
Entity(7, 0,
false,
false, EntityKind::EK_Gen);
741 inline Entity Requires =
Entity(8, 0,
false,
false, EntityKind::EK_Gen);
742 inline Entity CantCombine =
Entity(9, 0,
false,
false, EntityKind::EK_Gen);
743 inline Entity Exclusive =
Entity(10, 0,
false,
false, EntityKind::EK_Gen);
745 inline Entity DontFragment =
Entity(11, 0,
false,
false, EntityKind::EK_Gen);
746 inline Entity Sparse =
Entity(12, 0,
false,
false, EntityKind::EK_Gen);
748 inline Entity Acyclic =
Entity(13, 0,
false,
false, EntityKind::EK_Gen);
749 inline Entity Traversable =
Entity(14, 0,
false,
false, EntityKind::EK_Gen);
751 inline Entity All =
Entity(15, 0,
false,
false, EntityKind::EK_Gen);
754 inline Entity ChildOf =
Entity(16, 0,
false,
false, EntityKind::EK_Gen);
757 inline Entity Parent =
Entity(17, 0,
false,
false, EntityKind::EK_Gen);
759 inline Entity Is =
Entity(18, 0,
false,
false, EntityKind::EK_Gen);
761 inline Entity Prefab =
Entity(19, 0,
false,
false, EntityKind::EK_Gen);
763 inline Entity OnInstantiate =
Entity(20, 0,
false,
false, EntityKind::EK_Gen);
764 inline Entity Override =
Entity(21, 0,
false,
false, EntityKind::EK_Gen);
765 inline Entity Inherit =
Entity(22, 0,
false,
false, EntityKind::EK_Gen);
766 inline Entity DontInherit =
Entity(23, 0,
false,
false, EntityKind::EK_Gen);
768 inline Entity System =
Entity(24, 0,
false,
false, EntityKind::EK_Gen);
769 inline Entity DependsOn =
Entity(25, 0,
false,
false, EntityKind::EK_Gen);
771 inline Entity Observer =
Entity(26, 0,
false,
false, EntityKind::EK_Gen);
773 inline Entity Var0 =
Entity(27, 0,
false,
false, EntityKind::EK_Gen);
774 inline Entity Var1 =
Entity(28, 0,
false,
false, EntityKind::EK_Gen);
775 inline Entity Var2 =
Entity(29, 0,
false,
false, EntityKind::EK_Gen);
776 inline Entity Var3 =
Entity(30, 0,
false,
false, EntityKind::EK_Gen);
777 inline Entity Var4 =
Entity(31, 0,
false,
false, EntityKind::EK_Gen);
778 inline Entity Var5 =
Entity(32, 0,
false,
false, EntityKind::EK_Gen);
779 inline Entity Var6 =
Entity(33, 0,
false,
false, EntityKind::EK_Gen);
780 inline Entity Var7 =
Entity(34, 0,
false,
false, EntityKind::EK_Gen);
783 inline constexpr uint32_t RuntimePrimitiveTypeBaseId = 34;
785 GAIA_NODISCARD
inline bool is_runtime_primitive_serialization_type_id(uint32_t typeId)
noexcept {
786 return typeId >= (uint32_t)ser::serialization_type_id::s8 && typeId <= (uint32_t)ser::serialization_type_id::f64;
789 GAIA_NODISCARD
inline Entity runtime_primitive_type_entity(ser::serialization_type_id type)
noexcept {
790 const auto typeId = (uint32_t)type;
791 if (!is_runtime_primitive_serialization_type_id(typeId))
793 return Entity((EntityId)(RuntimePrimitiveTypeBaseId + typeId), 0,
false,
false, EntityKind::EK_Gen);
796 GAIA_NODISCARD
inline bool
797 runtime_primitive_serialization_type(Entity type, ser::serialization_type_id& out)
noexcept {
801 const auto typeId = type.id() - RuntimePrimitiveTypeBaseId;
802 if (!is_runtime_primitive_serialization_type_id(typeId))
805 out = (ser::serialization_type_id)typeId;
809 inline Entity S8 = runtime_primitive_type_entity(ser::serialization_type_id::s8);
810 inline Entity U8 = runtime_primitive_type_entity(ser::serialization_type_id::u8);
811 inline Entity S16 = runtime_primitive_type_entity(ser::serialization_type_id::s16);
812 inline Entity U16 = runtime_primitive_type_entity(ser::serialization_type_id::u16);
813 inline Entity S32 = runtime_primitive_type_entity(ser::serialization_type_id::s32);
814 inline Entity U32 = runtime_primitive_type_entity(ser::serialization_type_id::u32);
815 inline Entity S64 = runtime_primitive_type_entity(ser::serialization_type_id::s64);
816 inline Entity U64 = runtime_primitive_type_entity(ser::serialization_type_id::u64);
817 inline Entity Bool = runtime_primitive_type_entity(ser::serialization_type_id::b);
818 inline Entity Char8 = runtime_primitive_type_entity(ser::serialization_type_id::c8);
819 inline Entity Char16 = runtime_primitive_type_entity(ser::serialization_type_id::c16);
820 inline Entity Char32 = runtime_primitive_type_entity(ser::serialization_type_id::c32);
821 inline Entity F8 = runtime_primitive_type_entity(ser::serialization_type_id::f8);
822 inline Entity F16 = runtime_primitive_type_entity(ser::serialization_type_id::f16);
823 inline Entity F32 = runtime_primitive_type_entity(ser::serialization_type_id::f32);
824 inline Entity F64 = runtime_primitive_type_entity(ser::serialization_type_id::f64);
825 inline static constexpr uint32_t MaxVarCnt = 8;
837 inline Entity GAIA_ID(LastCoreComponent) = F64;
843 GAIA_NODISCARD
inline bool is_wildcard(EntityId entityId) {
844 return entityId == All.
id();
847 GAIA_NODISCARD
inline bool is_wildcard(Entity entity) {
848 return entity.pair() && (is_wildcard(entity.id()) || is_wildcard(entity.gen()));
851 GAIA_NODISCARD
inline bool is_wildcard(Pair pair) {
852 return pair.first() == All || pair.second() == All;
855 GAIA_NODISCARD
inline bool is_variable(EntityId entityId) {
856 return entityId <= Var7.
id() && entityId >= Var0.
id();
859 GAIA_NODISCARD
inline bool is_variable(Entity entity) {
860 return entity.id() <= Var7.
id() && entity.id() >= Var0.
id();
863 GAIA_NODISCARD
inline bool is_variable(Pair pair) {
864 return is_variable(pair.first()) || is_variable(pair.second());
Array with variable size of elements of type.
Definition darray_impl.h:27
Entity first() const noexcept
First entity of the pair.
Definition id.h:635
Entity second() const noexcept
Second entity of the pair.
Definition id.h:641
Wrapper for two types forming a relationship pair. Depending on what types are used to form a pair it...
Definition id.h:262
typename rel_comp_type::TypeFull rel
Full relation type, either the relation or a uni wrapper.
Definition id.h:268
typename tgt_comp_type::TypeOriginal tgt_original
Original target template type.
Definition id.h:278
typename tgt_comp_type::TypeFull tgt
Full target type, either the target or a uni wrapper.
Definition id.h:270
std::conditional_t<!std::is_empty_v< rel_type >||std::is_empty_v< tgt_type >, rel, tgt > type
Storage type for the pair value.
Definition id.h:280
typename rel_comp_type::TypeOriginal rel_original
Original relation template type.
Definition id.h:276
typename rel_comp_type::Type rel_type
Raw relation type.
Definition id.h:272
typename tgt_comp_type::Type tgt_type
Raw target type.
Definition id.h:274
void load(Reader &reader, T &data)
Read data using Reader at compile-time.
Definition ser_ct.h:112
void save(Writer &writer, const T &data)
Write data using Writer at compile-time.
Definition ser_ct.h:101
static sparse_id get(const ecs::Entity &item) noexcept
Returns the entity index as a sparse id.
Definition id.h:876
Converts an item to the sparse identifier used by sparse_storage.
Definition sparse_storage.h:49
T hash
Precomputed hash value.
Definition hashing_policy.h:51
Detects whether T supports a free operator==.
Definition utility.h:776
Detects whether T defines operator== as a member function.
Definition utility.h:768
Bit-packed storage layout of a component id.
Definition id.h:55
IdentifierData soa
Component is SoA.
Definition id.h:65
IdentifierData alig
Component alignment.
Definition id.h:61
IdentifierData size
Component size.
Definition id.h:59
uint32_t id
Component entity index.
Definition id.h:57
IdentifierData storage
Component storage kind. 0 = table, 1 = sparse.
Definition id.h:63
IdentifierData unused
Unused part.
Definition id.h:67
Identifier of a registered component type. Packs the component id, size, alignment,...
Definition id.h:42
GAIA_NODISCARD constexpr auto value() const noexcept
Raw identifier value.
Definition id.h:121
void save(Serializer &s) const
Serializes the component id.
Definition id.h:531
Identifier val
Raw 64-bit value.
Definition id.h:75
void load(Serializer &s)
Deserializes the component id.
Definition id.h:536
GAIA_NODISCARD constexpr auto alig() const noexcept
Component alignment in bytes.
Definition id.h:109
GAIA_NODISCARD constexpr auto id() const noexcept
Component id.
Definition id.h:91
GAIA_NODISCARD constexpr auto size() const noexcept
Component size in bytes.
Definition id.h:103
GAIA_NODISCARD constexpr DataStorageType storage_type() const noexcept
Storage mode of the component.
Definition id.h:115
GAIA_NODISCARD constexpr auto soa() const noexcept
Whether the component uses SoA storage.
Definition id.h:97
InternalData data
Structured view of the packed value.
Definition id.h:73
Component used to describe the entity name.
Definition id.h:597
Hashmap lookup structure used for Entity.
Definition id.h:543
size_t hash() const
Hash of the entity value.
Definition id.h:578
Bit-packed storage layout of an entity identifier.
Definition id.h:301
EntityId id
Index in the entity array.
Definition id.h:303
IdentifierData tmp
0-real entity, 1-temporary entity
Definition id.h:320
IdentifierData kind
0-EntityKind::CT_Gen, 1-EntityKind::CT_Uni
Definition id.h:318
IdentifierData gen
Generation index. Incremented every time an entity is deleted.
Definition id.h:312
IdentifierData pair
0-ordinary, 1-pair
Definition id.h:316
IdentifierData ent
0-component, 1-entity
Definition id.h:314
Identifier of an entity or component instance in the world. Packs the entity index,...
Definition id.h:296
void load(Serializer &s)
Deserializes the entity id, remapping it to the current world.
Definition id.h:525
GAIA_NODISCARD constexpr auto gen() const noexcept
Generation index of the entity.
Definition id.h:365
GAIA_NODISCARD constexpr auto value() const noexcept
Raw identifier value.
Definition id.h:395
GAIA_NODISCARD constexpr bool comp() const noexcept
Whether this id refers to a component.
Definition id.h:383
void save(Serializer &s) const
Serializes the entity id.
Definition id.h:520
InternalData data
Structured view of the packed value.
Definition id.h:328
static constexpr uint32_t IdMask
Bit mask covering all valid entity indices.
Definition id.h:298
GAIA_NODISCARD constexpr bool pair() const noexcept
Whether this id refers to a relationship pair.
Definition id.h:377
GAIA_NODISCARD constexpr auto kind() const noexcept
Entity kind of this id.
Definition id.h:389
Identifier val
Raw 64-bit value.
Definition id.h:330
GAIA_NODISCARD constexpr auto id() const noexcept
Entity index in the entity array.
Definition id.h:359
Entity(EntityId id, IdentifierData gen) noexcept
Special constructor for cnt::ilist.
Definition id.h:342
constexpr Entity(T value) noexcept
We need the entity to be braces-constructible and at the same type prevent it from getting constructe...
Definition id.h:339
GAIA_NODISCARD constexpr bool entity() const noexcept
Whether this id refers to an entity.
Definition id.h:371
Definition observer.h:237
Marks an id as required. Used directly on a non-pair id, it prevents removing that id from its owners...
Definition id.h:694
Definition system.inl:676
Detects whether a type is a relationship pair.
Definition id.h:285
static constexpr bool value
True when the type derives from the pair base.
Definition id.h:287
Wraps a type as a unique entity kind with one value per chunk.
Definition id.h:169
static constexpr EntityKind Kind
Component kind.
Definition id.h:179
T TTypeOriginal
Original template type.
Definition id.h:186
T TType
Raw type with no additional sugar.
Definition id.h:182