Flecs v4.1
A fast entity component system (ECS) for C & C++
Loading...
Searching...
No Matches
c_types.hpp
Go to the documentation of this file.
1
6#pragma once
7
8namespace flecs {
9
20using id_t = ecs_id_t;
31using table_records_t = ecs_table_records_t;
35using flags32_t = ecs_flags32_t;
36using flags64_t = ecs_flags64_t;
47
58
66
68static const flecs::entity_t PAIR = ECS_PAIR;
69static const flecs::entity_t AUTO_OVERRIDE = ECS_AUTO_OVERRIDE;
70static const flecs::entity_t TOGGLE = ECS_TOGGLE;
75
81using Poly = EcsPoly;
86
88static const flecs::entity_t Query = EcsQuery;
90static const flecs::entity_t Observer = EcsObserver;
92static const flecs::entity_t Module = EcsModule;
94static const flecs::entity_t Prefab = EcsPrefab;
96static const flecs::entity_t Disabled = EcsDisabled;
98static const flecs::entity_t Empty = EcsEmpty;
100static const flecs::entity_t Monitor = EcsMonitor;
102static const flecs::entity_t System = EcsSystem;
104static const flecs::entity_t Pipeline = ecs_id(EcsPipeline);
106static const flecs::entity_t Phase = EcsPhase;
108static const flecs::entity_t Constant = EcsConstant;
110static const flecs::entity_t ParentDepth = EcsParentDepth;
111
113static const flecs::entity_t OnAdd = EcsOnAdd;
115static const flecs::entity_t OnRemove = EcsOnRemove;
117static const flecs::entity_t OnSet = EcsOnSet;
119static const flecs::entity_t OnTableCreate = EcsOnTableCreate;
121static const flecs::entity_t OnTableDelete = EcsOnTableDelete;
122
124static const uint64_t Self = EcsSelf;
126static const uint64_t Up = EcsUp;
128static const uint64_t Trav = EcsTrav;
130static const uint64_t Cascade = EcsCascade;
132static const uint64_t Desc = EcsDesc;
134static const uint64_t IsVariable = EcsIsVariable;
136static const uint64_t IsEntity = EcsIsEntity;
138static const uint64_t IsName = EcsIsName;
140static const uint64_t TraverseFlags = EcsTraverseFlags;
142static const uint64_t TermRefFlags = EcsTermRefFlags;
143
145static const flecs::entity_t Flecs = EcsFlecs;
147static const flecs::entity_t FlecsCore = EcsFlecsCore;
149static const flecs::entity_t World = EcsWorld;
150
152static const flecs::entity_t Wildcard = EcsWildcard;
154static const flecs::entity_t Any = EcsAny;
156static const flecs::entity_t This = EcsThis;
158static const flecs::entity_t Transitive = EcsTransitive;
160static const flecs::entity_t Reflexive = EcsReflexive;
162static const flecs::entity_t Final = EcsFinal;
164static const flecs::entity_t Inheritable = EcsInheritable;
166static const flecs::entity_t PairIsTag = EcsPairIsTag;
168static const flecs::entity_t Exclusive = EcsExclusive;
170static const flecs::entity_t Acyclic = EcsAcyclic;
172static const flecs::entity_t Traversable = EcsTraversable;
174static const flecs::entity_t Symmetric = EcsSymmetric;
176static const flecs::entity_t With = EcsWith;
178static const flecs::entity_t OneOf = EcsOneOf;
180static const flecs::entity_t Trait = EcsTrait;
182static const flecs::entity_t Relationship = EcsRelationship;
184static const flecs::entity_t Target = EcsTarget;
186static const flecs::entity_t CanToggle = EcsCanToggle;
187
189static const flecs::entity_t OnInstantiate = EcsOnInstantiate;
191static const flecs::entity_t Override = EcsOverride;
193static const flecs::entity_t Inherit = EcsInherit;
195static const flecs::entity_t DontInherit = EcsDontInherit;
196
198static const flecs::entity_t OnDelete = EcsOnDelete;
200static const flecs::entity_t OnDeleteTarget = EcsOnDeleteTarget;
202static const flecs::entity_t Remove = EcsRemove;
204static const flecs::entity_t Delete = EcsDelete;
206static const flecs::entity_t Panic = EcsPanic;
207
209static const flecs::entity_t IsA = EcsIsA;
211static const flecs::entity_t ChildOf = EcsChildOf;
213static const flecs::entity_t DependsOn = EcsDependsOn;
215static const flecs::entity_t SlotOf = EcsSlotOf;
216
218static const flecs::entity_t OrderedChildren = EcsOrderedChildren;
220static const flecs::entity_t Singleton = EcsSingleton;
221
223static const flecs::entity_t Name = EcsName;
225static const flecs::entity_t Symbol = EcsSymbol;
226
228static const flecs::entity_t Sparse = EcsSparse;
230static const flecs::entity_t DontFragment = EcsDontFragment;
231
233static const flecs::entity_t PredEq = EcsPredEq;
235static const flecs::entity_t PredMatch = EcsPredMatch;
237static const flecs::entity_t PredLookup = EcsPredLookup;
238
240static const flecs::entity_t ScopeOpen = EcsScopeOpen;
242static const flecs::entity_t ScopeClose = EcsScopeClose;
243
246}
struct EcsIdentifier EcsIdentifier
A (string) identifier.
struct EcsPoly EcsPoly
Component for storing a poly object.
struct EcsDefaultChildComponent EcsDefaultChildComponent
When added to an entity, this informs serialization formats which component to use when a value is as...
struct EcsParent EcsParent
Non-fragmenting ChildOf relationship.
struct EcsComponent EcsComponent
Component information.
const ecs_entity_t EcsScopeClose
Marker used to indicate the end of a scope (}) in queries.
const ecs_entity_t EcsOnRemove
Event that triggers when an ID is removed from an entity.
const ecs_entity_t EcsThis
This entity.
const ecs_entity_t EcsWildcard
Wildcard entity ("*").
const ecs_entity_t EcsName
Tag to indicate name identifier.
const ecs_entity_t EcsAcyclic
Mark a relationship as acyclic.
const ecs_entity_t EcsSymmetric
Mark relationship as commutative.
const ecs_entity_t EcsOnSet
Event that triggers when a component is set for an entity.
const ecs_entity_t EcsReflexive
Mark a relationship as reflexive.
const ecs_entity_t EcsTrait
Can be added to components to indicate it is a trait.
const ecs_entity_t EcsEmpty
Tag used to indicate a query is empty.
const ecs_entity_t EcsOneOf
Ensure that a relationship target is a child of the specified entity.
const ecs_entity_t EcsOnTableDelete
Event that triggers when a table is deleted.
const ecs_entity_t EcsOnTableCreate
Event that triggers when a table is created.
const ecs_entity_t EcsObserver
Tag added to observers.
const ecs_entity_t EcsQuery
Tag added to queries.
const ecs_entity_t EcsRelationship
Ensure that an entity is always used in a pair as a relationship.
const ecs_entity_t EcsSingleton
Mark component as singleton.
const ecs_entity_t EcsOrderedChildren
Tag that, when added to a parent, ensures stable order of ecs_children() results.
const ecs_entity_t EcsDontFragment
Mark component as non-fragmenting.
const ecs_entity_t EcsTraversable
Mark a relationship as traversable.
const ecs_entity_t EcsPredLookup
Marker used to indicate $var ~= "pattern" matching in queries.
const ecs_entity_t EcsIsA
Used to express inheritance relationships.
const ecs_entity_t EcsExclusive
Can be added to a relationship to indicate that the relationship can only occur once on an entity.
const ecs_entity_t EcsSymbol
Tag to indicate symbol identifier.
const ecs_entity_t EcsDependsOn
Used to express dependency relationships.
const ecs_entity_t EcsTransitive
Mark a relationship as transitive.
const ecs_entity_t EcsDelete
Delete cleanup policy.
const ecs_entity_t EcsChildOf
Used to express parent-child relationships.
const ecs_entity_t EcsFlecsCore
Core module scope.
const ecs_entity_t EcsMonitor
Event that triggers an observer when an entity starts or stops matching a query.
const ecs_entity_t EcsCanToggle
Mark a component as toggleable with ecs_enable_id().
const ecs_entity_t EcsPredEq
Marker used to indicate $var == ... matching in queries.
const ecs_entity_t EcsPhase
Phase pipeline phase.
const ecs_entity_t EcsWorld
Entity associated with world (used for "attaching" components to world).
const ecs_entity_t EcsScopeOpen
Marker used to indicate the start of a scope ({) in queries.
const ecs_entity_t EcsRemove
Remove cleanup policy.
const ecs_entity_t EcsOverride
Override component on instantiate.
const ecs_entity_t EcsPredMatch
Marker used to indicate $var == "name" matching in queries.
const ecs_entity_t EcsInherit
Inherit component on instantiate.
const ecs_entity_t EcsSlotOf
Used to express a slot (used with prefab inheritance).
const ecs_entity_t EcsModule
Tag added to module entities.
const ecs_entity_t EcsSparse
Mark component as sparse.
const ecs_entity_t EcsOnAdd
Event that triggers when an ID is added to an entity.
const ecs_entity_t EcsPrefab
Tag added to prefab entities.
const ecs_entity_t EcsOnInstantiate
Relationship that specifies component inheritance behavior.
const ecs_entity_t EcsInheritable
Mark component as inheritable.
const ecs_entity_t EcsAny
Any entity ("_").
const ecs_entity_t EcsTarget
Ensure that an entity is always used in a pair as a target.
const ecs_entity_t EcsParentDepth
Relationship storing the entity's depth in a non-fragmenting hierarchy.
const ecs_entity_t EcsWith
Ensure that a component is always added together with another component.
const ecs_entity_t EcsOnDelete
Relationship used for specifying cleanup behavior.
const ecs_entity_t EcsOnDeleteTarget
Relationship used to define what should happen when a target entity (second element of a pair) is del...
const ecs_entity_t EcsFlecs
Root scope for built-in Flecs entities.
const ecs_entity_t EcsSystem
Tag added to systems.
const ecs_entity_t EcsDisabled
When this tag is added to an entity, it is skipped by queries, unless EcsDisabled is explicitly queri...
const ecs_entity_t EcsDontInherit
Never inherit component on instantiate.
const ecs_entity_t EcsPairIsTag
Can be added to a relationship to indicate that it should never hold data, even when it or the relati...
const ecs_entity_t EcsPanic
Panic cleanup policy.
const ecs_entity_t EcsFinal
Ensure that an entity or component cannot be used as a target in an IsA relationship.
const ecs_entity_t EcsConstant
Tag added to enum or bitmask constants.
FLECS_API const ecs_entity_t ecs_id(EcsDocDescription)
Component ID for EcsDocDescription.
struct ecs_component_record_t ecs_component_record_t
Information about a (component) ID, such as type info and tables with the ID.
Definition flecs.h:493
struct ecs_term_t ecs_term_t
A term is a single element in a query.
Definition flecs.h:434
struct ecs_type_info_t ecs_type_info_t
Type information.
Definition flecs.h:487
struct ecs_observer_t ecs_observer_t
An observer is a system that is invoked when an event matches its query.
Definition flecs.h:456
struct ecs_ref_t ecs_ref_t
A ref is a fast way to fetch a component for a specific entity.
Definition flecs.h:477
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:381
struct ecs_table_record_t ecs_table_record_t
Opaque type for table record.
Definition flecs.h:527
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:425
struct ecs_type_hooks_t ecs_type_hooks_t
Type hooks are callbacks associated with component lifecycle events.
Definition flecs.h:482
uint64_t ecs_id_t
IDs are the things that can be added to an entity.
Definition flecs.h:374
struct ecs_query_t ecs_query_t
A query returns entities matching a list of constraints.
Definition flecs.h:437
struct ecs_table_t ecs_table_t
A table stores entities and components for a specific type.
Definition flecs.h:431
struct ecs_iter_t ecs_iter_t
Type used for iterating iterable objects.
Definition flecs.h:467
ecs_component_record_t component_record_t
Component record type.
Definition c_types.hpp:32
ecs_table_t table_t
Table type.
Definition c_types.hpp:23
ecs_id_t id_t
ID type.
Definition c_types.hpp:20
ecs_ref_t ref_t
Ref type.
Definition c_types.hpp:29
ecs_table_records_t table_records_t
Table records type.
Definition c_types.hpp:31
ecs_flags64_t flags64_t
64-bit flags type.
Definition c_types.hpp:36
ecs_table_record_t table_record_t
Table record type.
Definition c_types.hpp:30
oper_kind_t
Operator kind.
Definition c_types.hpp:49
ecs_entity_t entity_t
Entity type.
Definition c_types.hpp:21
ecs_flags32_t flags32_t
32-bit flags type.
Definition c_types.hpp:35
query_cache_kind_t
Query cache kind.
Definition c_types.hpp:60
ecs_world_t world_t
World type.
Definition c_types.hpp:18
inout_kind_t
Inout kind.
Definition c_types.hpp:39
@ NotFrom
NotFrom operator.
Definition c_types.hpp:56
@ OrFrom
OrFrom operator.
Definition c_types.hpp:55
@ AndFrom
AndFrom operator.
Definition c_types.hpp:54
@ And
And operator.
Definition c_types.hpp:50
@ Optional
Optional operator.
Definition c_types.hpp:53
@ Or
Or operator.
Definition c_types.hpp:51
@ Not
Not operator.
Definition c_types.hpp:52
@ QueryCacheNone
No caching.
Definition c_types.hpp:64
@ QueryCacheAll
Cache all.
Definition c_types.hpp:63
@ QueryCacheAuto
Auto query cache.
Definition c_types.hpp:62
@ QueryCacheDefault
Default query cache.
Definition c_types.hpp:61
@ In
In.
Definition c_types.hpp:44
@ Out
Out.
Definition c_types.hpp:45
@ InOutFilter
InOutFilter.
Definition c_types.hpp:42
@ InOutDefault
InOutDefault.
Definition c_types.hpp:40
@ InOut
InOut.
Definition c_types.hpp:43
@ InOutNone
InOutNone.
Definition c_types.hpp:41
const ecs_id_t ECS_PAIR
Indicate that the ID is a pair.
const ecs_id_t ECS_AUTO_OVERRIDE
Automatically override component when it is inherited.
const ecs_id_t ECS_TOGGLE
Add a bitset to storage, which allows a component to be enabled or disabled.
struct ecs_world_info_t ecs_world_info_t
Type that contains information about the world.
struct ecs_query_group_info_t ecs_query_group_info_t
Type that contains information about a query group.
#define EcsIsEntity
Term ID is an entity.
Definition flecs.h:774
#define EcsIsVariable
Term ID is a variable.
Definition flecs.h:768
#define EcsIsName
Term ID is a name (don't attempt to look up as an entity).
Definition flecs.h:780
#define EcsDesc
Iterate groups in descending order.
Definition flecs.h:762
#define EcsCascade
Sort results breadth-first.
Definition flecs.h:756
#define EcsTrav
Traverse relationship transitively.
Definition flecs.h:750
#define EcsTraverseFlags
All term traversal flags.
Definition flecs.h:786
#define EcsTermRefFlags
All term reference kind flags.
Definition flecs.h:792
#define EcsUp
Match by traversing upwards.
Definition flecs.h:744
#define EcsSelf
Term ID flags.
Definition flecs.h:738
@ EcsQueryCacheAll
Require that all query terms can be cached.
Definition flecs.h:728
@ EcsQueryCacheDefault
Behavior determined by query creation context.
Definition flecs.h:726
@ EcsQueryCacheNone
No caching.
Definition flecs.h:729
@ EcsQueryCacheAuto
Cache query terms that are cacheable.
Definition flecs.h:727
@ EcsOut
Term is only written.
Definition flecs.h:710
@ EcsInOut
Term is both read and written.
Definition flecs.h:708
@ EcsInOutFilter
Same as InOutNone + prevents term from triggering observers.
Definition flecs.h:707
@ EcsInOutDefault
InOut for regular terms, In for shared terms.
Definition flecs.h:705
@ EcsInOutNone
Term is neither read nor written.
Definition flecs.h:706
@ EcsIn
Term is only read.
Definition flecs.h:709
@ EcsNot
The term must not match.
Definition flecs.h:717
@ EcsOptional
The term may match.
Definition flecs.h:718
@ EcsOr
One of the terms in an or chain must match.
Definition flecs.h:716
@ EcsOrFrom
Term must match at least one component from term ID.
Definition flecs.h:720
@ EcsAnd
The term must match.
Definition flecs.h:715
@ EcsNotFrom
Term must match none of the components from term ID.
Definition flecs.h:721
@ EcsAndFrom
Term must match all components from term ID.
Definition flecs.h:719
Component information.
Definition flecs.h:1566
When added to an entity, this informs serialization formats which component to use when a value is as...
Definition flecs.h:1581
A (string) identifier.
Definition flecs.h:1557
Non-fragmenting ChildOf relationship.
Definition flecs.h:1586
Component for storing a poly object.
Definition flecs.h:1572
Iterator.
Definition flecs.h:1166
An observer reacts to events matching a query.
Definition flecs.h:875
Type that contains information about a query group.
Definition flecs.h:1540
Queries are lists of constraints (terms) that match entities.
Definition flecs.h:834
Type that describes a term (single element in a query).
Definition flecs.h:810
Type that contains component information (passed to ctors/dtors/...).
Definition flecs.h:1019
A type is a list of (component) IDs.
Definition flecs.h:398
Type that contains information about the world.
Definition flecs.h:1478