Michele Caini 6 лет назад
Родитель
Сommit
8278c8eedd
2 измененных файлов с 34 добавлено и 50 удалено
  1. 20 28
      src/entt/entity/group.hpp
  2. 14 22
      src/entt/entity/view.hpp

+ 20 - 28
src/entt/entity/group.hpp

@@ -29,11 +29,9 @@ class basic_group;
 /**
  * @brief Non-owning group.
  *
- * A non-owning group returns all the entities and only the entities that have
- * at least the given components. Moreover, it's guaranteed that the entity list
- * is tightly packed in memory for fast iterations.<br/>
- * In general, non-owning groups don't stay true to the order of any set of
- * components unless users explicitly sort them.
+ * A non-owning group returns all entities and only the entities that have at
+ * least the given components. Moreover, it's guaranteed that the entity list
+ * is tightly packed in memory for fast iterations.
  *
  * @b Important
  *
@@ -44,18 +42,17 @@ class basic_group;
  *   given components is removed from the entity to which the iterator points).
  * * 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 and using them results in undefined
- * behavior.
+ * In all other cases, modifying the pools iterated by the group in any way
+ * invalidates all the iterators and using them results in undefined behavior.
  *
  * @note
  * Groups 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 all the
  * groups.<br/>
- * Moreover, sorting a non-owning group affects all the instance of the same
+ * Moreover, sorting a non-owning group affects all the instances of the same
  * group (it means that users don't have to call `sort` on each instance to sort
- * all of them because they share the set of entities).
+ * all of them because they _share_ entities and components).
  *
  * @warning
  * Lifetime of a group must overcome the one of the registry that generated it.
@@ -131,11 +128,9 @@ public:
     }
 
     /**
-     * @brief Checks whether the group or the pools of the given components are
-     * empty.
+     * @brief Checks whether a group or some pools are empty.
      * @tparam Component Types of components in which one is interested.
-     * @return True if the group or the pools of the given components are empty,
-     * false otherwise.
+     * @return True if the group or the pools are empty, false otherwise.
      */
     template<typename... Component>
     bool empty() const ENTT_NOEXCEPT {
@@ -270,7 +265,7 @@ public:
      * @brief Returns the components assigned to the given entity.
      *
      * Prefer this function instead of `registry::get` during iterations. It has
-     * far better performance than its companion function.
+     * far better performance than its counterpart.
      *
      * @warning
      * Attempting to use an invalid component type results in a compilation
@@ -409,7 +404,7 @@ public:
      * @brief Sort the shared pool of entities according to the given component.
      *
      * Non-owning groups of the same type share with the registry a pool of
-     * entities with  its own order that doesn't depend on the order of any pool
+     * entities with its own order that doesn't depend on the order of any pool
      * of components. Users can order the underlying data structure so that it
      * respects the order of the pool of the given component.
      *
@@ -435,15 +430,15 @@ private:
 /**
  * @brief Owning group.
  *
- * Owning groups return all the entities and only the entities that have at
- * least the given components. Moreover:
+ * Owning groups return all entities and only the entities that have at least
+ * the given components. Moreover:
  *
  * * It's guaranteed that the entity list is tightly packed in memory for fast
  *   iterations.
  * * It's guaranteed that the lists of owned components are tightly packed in
  *   memory for even faster iterations and to allow direct access.
- * * They stay true to the order of the owned components and all the owned
- *   components have the same order in memory.
+ * * They stay true to the order of the owned components and all instances have
+ *   the same order in memory.
  *
  * The more types of components are owned by a group, the faster it is to
  * iterate them.
@@ -457,9 +452,8 @@ private:
  *   given components is removed from the entity to which the iterator points).
  * * 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 and using them results in undefined
- * behavior.
+ * In all other cases, modifying the pools iterated by the group in any way
+ * invalidates all the iterators and using them results in undefined behavior.
  *
  * @note
  * Groups share references to the underlying data structures of the registry
@@ -544,11 +538,9 @@ public:
     }
 
     /**
-     * @brief Checks whether the group or the pools of the given components are
-     * empty.
+     * @brief Checks whether a group or some pools are empty.
      * @tparam Component Types of components in which one is interested.
-     * @return True if the group or the pools of the given components are empty,
-     * false otherwise.
+     * @return True if the group or the pools are empty, false otherwise.
      */
     template<typename... Component>
     bool empty() const ENTT_NOEXCEPT {
@@ -689,7 +681,7 @@ public:
      * @brief Returns the components assigned to the given entity.
      *
      * Prefer this function instead of `registry::get` during iterations. It has
-     * far better performance than its companion function.
+     * far better performance than its counterpart.
      *
      * @warning
      * Attempting to use an invalid component type results in a compilation

+ 14 - 22
src/entt/entity/view.hpp

@@ -35,11 +35,8 @@ class basic_view;
  *
  * Multi component views iterate over those entities that have at least all the
  * given components in their bags. During initialization, a multi component 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 for more details.
+ * looks at the number of entities available for each component and uses the
+ * smallest set in order to get a performance boost when iterate.
  *
  * @b Important
  *
@@ -50,9 +47,8 @@ class basic_view;
  *   given components is removed from the entity to which the iterator points).
  * * 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 and using them results in undefined
- * behavior.
+ * In all other cases, modifying the pools iterated by the view in any way
+ * invalidates all the iterators and using them results in undefined behavior.
  *
  * @note
  * Views share references to the underlying data structures of the registry that
@@ -241,16 +237,14 @@ public:
     }
 
     /**
-     * @brief Checks whether the view or the pools of the given components are
-     * empty.
+     * @brief Checks whether a view or some pools are empty.
      *
-     * The view is definitely empty if one of the pools of the given components
-     * is empty. In all other cases, the view may be empty and not return
-     * entities even if this function returns false.
+     * The view is definitely empty if one of the pools it uses is empty. In all
+     * other cases, the view may be empty and not return entities even if this
+     * function returns false.
      *
      * @tparam Comp Types of components in which one is interested.
-     * @return True if the view or the pools of the given components are empty,
-     * false otherwise.
+     * @return True if the view or the pools are empty, false otherwise.
      */
     template<typename... Comp>
     bool empty() const ENTT_NOEXCEPT {
@@ -367,7 +361,7 @@ public:
      * @brief Returns the components assigned to the given entity.
      *
      * Prefer this function instead of `registry::get` during iterations. It has
-     * far better performance than its companion function.
+     * far better performance than its counterpart.
      *
      * @warning
      * Attempting to use an invalid component type results in a compilation
@@ -529,9 +523,7 @@ private:
  *
  * Single component views are specialized in order to get a boost in terms of
  * performance. This kind of views can access the underlying data structure
- * directly and avoid superfluous checks.<br/>
- * Order of elements during iterations are highly dependent on the order of the
- * underlying data structure. See sparse_set for more details.
+ * directly and avoid superfluous checks.
  *
  * @b Important
  *
@@ -542,7 +534,7 @@ private:
  *   component is removed from the entity to which the iterator points).
  * * The entity currently pointed is destroyed.
  *
- * In all the other cases, modifying the pool of the given component in any way
+ * In all other cases, modifying the pool iterated by the view in any way
  * invalidates all the iterators and using them results in undefined behavior.
  *
  * @note
@@ -587,7 +579,7 @@ public:
     }
 
     /**
-     * @brief Checks whether the view is empty.
+     * @brief Checks whether a view is empty.
      * @return True if the view is empty, false otherwise.
      */
     bool empty() const ENTT_NOEXCEPT {
@@ -696,7 +688,7 @@ public:
      * @brief Returns the component assigned to the given entity.
      *
      * Prefer this function instead of `registry::get` during iterations. It has
-     * far better performance than its companion function.
+     * far better performance than its counterpart.
      *
      * @warning
      * Attempting to use an entity that doesn't belong to the view results in