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
68
70static const flecs::entity_t PAIR = ECS_PAIR;
71static const flecs::entity_t AUTO_OVERRIDE = ECS_AUTO_OVERRIDE;
72static const flecs::entity_t TOGGLE = ECS_TOGGLE;
73static const flecs::entity_t VALUE_PAIR = ECS_VALUE_PAIR;
78
84using Poly = EcsPoly;
87
89static const flecs::entity_t Query = EcsQuery;
91static const flecs::entity_t Observer = EcsObserver;
93static const flecs::entity_t Module = EcsModule;
94
95#ifdef FLECS_PREFAB
97static const flecs::entity_t Prefab = EcsPrefab;
98#endif
99
101static const flecs::entity_t Disabled = EcsDisabled;
103static const flecs::entity_t Empty = EcsEmpty;
105static const flecs::entity_t Monitor = EcsMonitor;
107static const flecs::entity_t System = EcsSystem;
108#ifdef FLECS_PIPELINE
110static const flecs::entity_t Pipeline = ecs_id(EcsPipeline);
112static const flecs::entity_t Phase = EcsPhase;
113#endif
115static const flecs::entity_t Constant = EcsConstant;
117static const flecs::entity_t ParentDepth = EcsParentDepth;
118
120static const flecs::entity_t OnAdd = EcsOnAdd;
122static const flecs::entity_t OnRemove = EcsOnRemove;
124static const flecs::entity_t OnSet = EcsOnSet;
126static const flecs::entity_t OnTableCreate = EcsOnTableCreate;
128static const flecs::entity_t OnTableDelete = EcsOnTableDelete;
129
130#ifdef FLECS_CONSTRAINT_TRAITS
132static const flecs::entity_t Acyclic = EcsAcyclic;
134static const flecs::entity_t Final = EcsFinal;
136static const flecs::entity_t OneOf = EcsOneOf;
138static const flecs::entity_t Relationship = EcsRelationship;
140static const flecs::entity_t Target = EcsTarget;
142static const flecs::entity_t Trait = EcsTrait;
144static const flecs::entity_t Singleton = EcsSingleton;
146static const flecs::entity_t Symmetric = EcsSymmetric;
147#endif
148
150static const uint64_t Self = EcsSelf;
152static const uint64_t Up = EcsUp;
154static const uint64_t Trav = EcsTrav;
156static const uint64_t Cascade = EcsCascade;
158static const uint64_t Desc = EcsDesc;
160static const uint64_t IsVariable = EcsIsVariable;
162static const uint64_t IsEntity = EcsIsEntity;
164static const uint64_t IsName = EcsIsName;
166static const uint64_t TraverseFlags = EcsTraverseFlags;
168static const uint64_t TermRefFlags = EcsTermRefFlags;
169
171static const flecs::entity_t Flecs = EcsFlecs;
173static const flecs::entity_t FlecsCore = EcsFlecsCore;
175static const flecs::entity_t World = EcsWorld;
176
178static const flecs::entity_t Wildcard = EcsWildcard;
180static const flecs::entity_t Any = EcsAny;
182static const flecs::entity_t This = EcsThis;
184static const flecs::entity_t Transitive = EcsTransitive;
186static const flecs::entity_t Reflexive = EcsReflexive;
188static const flecs::entity_t Inheritable = EcsInheritable;
190static const flecs::entity_t PairIsTag = EcsPairIsTag;
192static const flecs::entity_t Exclusive = EcsExclusive;
194static const flecs::entity_t Traversable = EcsTraversable;
196static const flecs::entity_t With = EcsWith;
198static const flecs::entity_t CanToggle = EcsCanToggle;
199
201static const flecs::entity_t OnInstantiate = EcsOnInstantiate;
202#ifdef FLECS_PREFAB
204static const flecs::entity_t Override = EcsOverride;
206static const flecs::entity_t Inherit = EcsInherit;
207#endif
209static const flecs::entity_t DontInherit = EcsDontInherit;
210
212static const flecs::entity_t OnDelete = EcsOnDelete;
214static const flecs::entity_t OnDeleteTarget = EcsOnDeleteTarget;
216static const flecs::entity_t Remove = EcsRemove;
218static const flecs::entity_t Delete = EcsDelete;
220static const flecs::entity_t Panic = EcsPanic;
221
223static const flecs::entity_t IsA = EcsIsA;
225static const flecs::entity_t ChildOf = EcsChildOf;
227static const flecs::entity_t DependsOn = EcsDependsOn;
229static const flecs::entity_t OrderedChildren = EcsOrderedChildren;
230
232static const flecs::entity_t Name = EcsName;
234static const flecs::entity_t Symbol = EcsSymbol;
235
237static const flecs::entity_t Sparse = EcsSparse;
239static const flecs::entity_t DontFragment = EcsDontFragment;
240
242static const flecs::entity_t PredEq = EcsPredEq;
244static const flecs::entity_t PredMatch = EcsPredMatch;
246static const flecs::entity_t PredLookup = EcsPredLookup;
247
249static const flecs::entity_t ScopeOpen = EcsScopeOpen;
251static const flecs::entity_t ScopeClose = EcsScopeClose;
252
255}
struct EcsIdentifier EcsIdentifier
A (string) identifier.
struct EcsPoly EcsPoly
Component for storing a poly object.
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 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 EcsEmpty
Tag used to indicate a query is empty.
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 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 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 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 EcsConstant
Tag added to enum or bitmask constants.
FLECS_API const ecs_entity_t EcsTrait
Can be added to components to indicate it is a trait.
FLECS_API const ecs_entity_t EcsOneOf
Ensure that a relationship target is a child of the specified entity.
FLECS_API const ecs_entity_t EcsSingleton
Mark component as singleton.
FLECS_API const ecs_entity_t EcsSymmetric
Mark relationship as commutative.
FLECS_API const ecs_entity_t EcsFinal
Ensure that an entity or component cannot be used as a target in an IsA relationship.
FLECS_API const ecs_entity_t EcsTarget
Ensure that an entity is always used in a pair as a target.
FLECS_API const ecs_entity_t EcsRelationship
Ensure that an entity is always used in a pair as a relationship.
FLECS_API const ecs_entity_t EcsAcyclic
Mark a relationship as acyclic.
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:505
struct ecs_term_t ecs_term_t
A term is a single element in a query.
Definition flecs.h:446
struct ecs_type_info_t ecs_type_info_t
Type information.
Definition flecs.h:499
struct ecs_observer_t ecs_observer_t
An observer is a system that is invoked when an event matches its query.
Definition flecs.h:468
struct ecs_ref_t ecs_ref_t
A ref is a fast way to fetch a component for a specific entity.
Definition flecs.h:489
ecs_id_t ecs_entity_t
An entity identifier.
Definition flecs.h:393
struct ecs_table_record_t ecs_table_record_t
Opaque type for table record.
Definition flecs.h:539
struct ecs_world_t ecs_world_t
A world is the container for all ECS data and supporting features.
Definition flecs.h:437
struct ecs_type_hooks_t ecs_type_hooks_t
Type hooks are callbacks associated with component lifecycle events.
Definition flecs.h:494
uint64_t ecs_id_t
IDs are the things that can be added to an entity.
Definition flecs.h:386
struct ecs_query_t ecs_query_t
A query returns entities matching a list of constraints.
Definition flecs.h:449
struct ecs_table_t ecs_table_t
A table stores entities and components for a specific type.
Definition flecs.h:443
struct ecs_iter_t ecs_iter_t
Type used for iterating iterable objects.
Definition flecs.h:479
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:66
@ QueryCacheAll
Cache all.
Definition c_types.hpp:64
@ 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.
const ecs_id_t ECS_VALUE_PAIR
Indicate that the target of a pair is an integer value.
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:796
#define EcsIsVariable
Term ID is a variable.
Definition flecs.h:790
#define EcsIsName
Term ID is a name (don't attempt to look up as an entity).
Definition flecs.h:802
#define EcsDesc
Iterate groups in descending order.
Definition flecs.h:784
#define EcsCascade
Sort results breadth-first.
Definition flecs.h:778
#define EcsTrav
Traverse relationship transitively.
Definition flecs.h:772
#define EcsTraverseFlags
All term traversal flags.
Definition flecs.h:808
#define EcsTermRefFlags
All term reference kind flags.
Definition flecs.h:814
#define EcsUp
Match by traversing upwards.
Definition flecs.h:766
#define EcsSelf
Term ID flags.
Definition flecs.h:760
@ EcsQueryCacheAll
Require that all query terms can be cached.
Definition flecs.h:749
@ EcsQueryCacheDefault
Behavior determined by query creation context.
Definition flecs.h:746
@ EcsQueryCacheNone
No caching.
Definition flecs.h:751
@ EcsQueryCacheAuto
Cache query terms that are cacheable.
Definition flecs.h:747
@ EcsOut
Term is only written.
Definition flecs.h:730
@ EcsInOut
Term is both read and written.
Definition flecs.h:728
@ EcsInOutFilter
Same as InOutNone + prevents term from triggering observers.
Definition flecs.h:727
@ EcsInOutDefault
InOut for regular terms, In for shared terms.
Definition flecs.h:725
@ EcsInOutNone
Term is neither read nor written.
Definition flecs.h:726
@ EcsIn
Term is only read.
Definition flecs.h:729
@ EcsNot
The term must not match.
Definition flecs.h:737
@ EcsOptional
The term may match.
Definition flecs.h:738
@ EcsOr
One of the terms in an or chain must match.
Definition flecs.h:736
@ EcsOrFrom
Term must match at least one component from term ID.
Definition flecs.h:740
@ EcsAnd
The term must match.
Definition flecs.h:735
@ EcsNotFrom
Term must match none of the components from term ID.
Definition flecs.h:741
@ EcsAndFrom
Term must match all components from term ID.
Definition flecs.h:739
Component information.
Definition flecs.h:1618
A (string) identifier.
Definition flecs.h:1609
Non-fragmenting ChildOf relationship.
Definition flecs.h:1629
Component for storing a poly object.
Definition flecs.h:1624
Iterator.
Definition flecs.h:1190
An observer reacts to events matching a query.
Definition flecs.h:901
Type that contains information about a query group.
Definition flecs.h:1592
Queries are lists of constraints (terms) that match entities.
Definition flecs.h:856
Type that describes a term (single element in a query).
Definition flecs.h:832
Type that contains component information (passed to ctors/dtors/...).
Definition flecs.h:1050
A type is a list of (component) IDs.
Definition flecs.h:410
Type that contains information about the world.
Definition flecs.h:1532