Przeglądaj źródła

doc: added section pool to entity.md (close #505)

Michele Caini 5 lat temu
rodzic
commit
f89c5cc072
1 zmienionych plików z 17 dodań i 0 usunięć
  1. 17 0
      docs/md/entity.md

+ 17 - 0
docs/md/entity.md

@@ -12,6 +12,7 @@
   * [All or nothing](#all-or-nothing)
   * [All or nothing](#all-or-nothing)
   * [Stateless systems](#stateless-systems)
   * [Stateless systems](#stateless-systems)
 * [Vademecum](#vademecum)
 * [Vademecum](#vademecum)
+* [Pools](#pools)
 * [The Registry, the Entity and the Component](#the-registry-the-entity-and-the-component)
 * [The Registry, the Entity and the Component](#the-registry-the-entity-and-the-component)
   * [Observe changes](#observe-changes)
   * [Observe changes](#observe-changes)
     * [They call me Reactive System](#they-call-me-reactive-system)
     * [They call me Reactive System](#they-call-me-reactive-system)
@@ -140,6 +141,22 @@ the core part of the whole library.<br/>
 The project is composed of many other classes in addition to those describe
 The project is composed of many other classes in addition to those describe
 below. For more details, please refer to the inline documentation.
 below. For more details, please refer to the inline documentation.
 
 
+# Pools
+
+In `EnTT`, pools of components are made available through a specialized version
+of a sparse set.
+
+Each pool contains all the instances of a single component, as well as all the
+entities to which it's assigned. Sparse arrays are also _paged_ to avoid wasting
+memory in some cases while packed arrays are not for obvious reasons.<br/>
+Pools also make available at any time a pointer to the packed lists of entities
+and components they contain, in addition to the number of elements in use. For
+this reason, pools can rearrange their items in order to keep the internal
+arrays tightly packed and maximize performance.
+
+At the moment, it's possible to specialize pools within certain limits, although
+a more flexible and user-friendly model is under development.
+
 # The Registry, the Entity and the Component
 # The Registry, the Entity and the Component
 
 
 A registry can store and manage entities, as well as create views and groups to
 A registry can store and manage entities, as well as create views and groups to