|
|
@@ -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}
|