Michele Caini 2 gadi atpakaļ
vecāks
revīzija
5a9f6d211c
2 mainītis faili ar 10 papildinājumiem un 30 dzēšanām
  1. 10 26
      src/entt/entity/runtime_view.hpp
  2. 0 4
      src/entt/entity/sparse_set.hpp

+ 10 - 26
src/entt/entity/runtime_view.hpp

@@ -104,37 +104,22 @@ private:
 /**
  * @brief Generic runtime view.
  *
- * Runtime views iterate over those entities that have at least all the given
- * components in their bags. During initialization, a runtime view looks at the
- * number of entities available for each component and picks up a reference to
- * the smallest set of candidate entities in order to get a performance boost
- * when iterate.<br/>
- * Order of elements during iterations are highly dependent on the order of the
- * underlying data structures. See sparse_set and its specializations for more
- * details.
+ * Runtime views iterate over those entities that are at least in the given
+ * storage. During initialization, a runtime view looks at the number of
+ * entities available for each component and uses the smallest set in order to
+ * get a performance boost when iterating.
  *
  * @b Important
  *
  * Iterators aren't invalidated if:
  *
- * * New instances of the given components are created and assigned to entities.
- * * The entity currently pointed is modified (as an example, if one of the
- *   given components is removed from the entity to which the iterator points).
+ * * New elements are added to the storage.
+ * * The entity currently pointed is modified (for example, components are added
+ *   or removed from it).
  * * The entity currently pointed is destroyed.
  *
- * In all the other cases, modifying the pools of the given components in any
- * way invalidates all the iterators.
- *
- * @note
- * Views share references to the underlying data structures of the registry that
- * generated them. Therefore any change to the entities and to the components
- * made by means of the registry are immediately reflected by the views, unless
- * a pool was missing when the view was built (in this case, the view won't
- * have a valid reference and won't be updated accordingly).
- *
- * @warning
- * Lifetime of a view must not overcome that of the registry that generated it.
- * In any other case, attempting to use a view results in undefined behavior.
+ * In all other cases, modifying the storage iterated by the view in any way
+ * invalidates all the iterators.
  *
  * @tparam Type Common base type.
  * @tparam Allocator Type of allocator used to manage memory and elements.
@@ -299,8 +284,7 @@ public:
      * @brief Iterates entities and applies the given function object to them.
      *
      * The function object is invoked for each entity. It is provided only with
-     * the entity itself. To get the components, users can use the registry with
-     * which the view was built.<br/>
+     * the entity itself.<br/>
      * The signature of the function should be equivalent to the following:
      *
      * @code{.cpp}

+ 0 - 4
src/entt/entity/sparse_set.hpp

@@ -150,10 +150,6 @@ template<typename Container>
  * Two arrays: an _external_ one and an _internal_ one; a _sparse_ one and a
  * _packed_ one; one used for direct access through contiguous memory, the other
  * one used to get the data through an extra level of indirection.<br/>
- * This is largely used by the registry to offer users the fastest access ever
- * to the components. Views and groups in general are almost entirely designed
- * around sparse sets.
- *
  * This type of data structure is widely documented in the literature and on the
  * web. This is nothing more than a customized implementation suitable for the
  * purpose of the framework.