Browse Source

group: removed ::data<T>, misleading information (breaking change)

Michele Caini 5 years ago
parent
commit
c1bfc29e7f
2 changed files with 4 additions and 53 deletions
  1. 4 45
      src/entt/entity/group.hpp
  2. 0 8
      test/entt/entity/group.cpp

+ 4 - 45
src/entt/entity/group.hpp

@@ -197,8 +197,8 @@ public:
      * @brief Direct access to the list of components of a given pool.
      *
      * The returned pointer is such that range
-     * `[raw<Component>(), raw<Component>() + size<Component>())` is always a
-     * valid range, even if the container is empty.
+     * `[raw<Component>(), raw<Component>() + size())` is always a valid range,
+     * even if the container is empty.
      *
      * @note
      * Components are in the reverse order as returned by the `begin`/`end`
@@ -212,25 +212,6 @@ public:
         return std::get<storage_type<Component> *>(pools)->raw();
     }
 
-    /**
-     * @brief Direct access to the list of entities of a given pool.
-     *
-     * The returned pointer is such that range
-     * `[data<Component>(), data<Component>() + size<Component>())` is always a
-     * valid range, even if the container is empty.
-     *
-     * @note
-     * Entities are in the reverse order as returned by the `begin`/`end`
-     * iterators.
-     *
-     * @tparam Component Type of component in which one is interested.
-     * @return A pointer to the array of entities.
-     */
-    template<typename Component>
-    [[nodiscard]] const entity_type * data() const ENTT_NOEXCEPT {
-        return std::get<storage_type<Component> *>(pools)->data();
-    }
-
     /**
      * @brief Direct access to the list of entities.
      *
@@ -702,8 +683,8 @@ public:
      * @brief Direct access to the list of components of a given pool.
      *
      * The returned pointer is such that range
-     * `[raw<Component>(), raw<Component>() + size<Component>())` is always a
-     * valid range, even if the container is empty.<br/>
+     * `[raw<Component>(), raw<Component>() + size())` is always a valid range,
+     * even if the container is empty.<br/>
      * Moreover, in case the group owns the given component, the range
      * `[raw<Component>(), raw<Component>() + size())` is such that it contains
      * the instances that are part of the group itself.
@@ -720,28 +701,6 @@ public:
         return std::get<storage_type<Component> *>(pools)->raw();
     }
 
-    /**
-     * @brief Direct access to the list of entities of a given pool.
-     *
-     * The returned pointer is such that range
-     * `[data<Component>(), data<Component>() + size<Component>())` is always a
-     * valid range, even if the container is empty.<br/>
-     * Moreover, in case the group owns the given component, the range
-     * `[data<Component>(), data<Component>() + size())` is such that it
-     * contains the entities that are part of the group itself.
-     *
-     * @note
-     * Entities are in the reverse order as returned by the `begin`/`end`
-     * iterators.
-     *
-     * @tparam Component Type of component in which one is interested.
-     * @return A pointer to the array of entities.
-     */
-    template<typename Component>
-    [[nodiscard]] const entity_type * data() const ENTT_NOEXCEPT {
-        return std::get<storage_type<Component> *>(pools)->data();
-    }
-
     /**
      * @brief Direct access to the list of entities.
      *

+ 0 - 8
test/entt/entity/group.cpp

@@ -55,10 +55,6 @@ TEST(NonOwningGroup, Functionalities) {
 
     ASSERT_EQ(*(group.data() + 0), e1);
 
-    ASSERT_EQ(*(group.data<int>() + 0), e1);
-    ASSERT_EQ(*(group.data<char>() + 0), e0);
-    ASSERT_EQ(*(cgroup.data<const char>() + 1), e1);
-
     ASSERT_EQ(*(group.raw<int>() + 0), 42);
     ASSERT_EQ(*(group.raw<char>() + 0), '1');
     ASSERT_EQ(*(cgroup.raw<const char>() + 1), '2');
@@ -616,10 +612,6 @@ TEST(OwningGroup, Functionalities) {
 
     ASSERT_EQ(*(group.data() + 0), e1);
 
-    ASSERT_EQ(*(group.data<int>() + 0), e1);
-    ASSERT_EQ(*(group.data<char>() + 0), e0);
-    ASSERT_EQ(*(cgroup.data<const char>() + 1), e1);
-
     ASSERT_EQ(*(group.raw<int>() + 0), 42);
     ASSERT_EQ(*(group.raw<char>() + 0), '1');
     ASSERT_EQ(*(cgroup.raw<const char>() + 1), '2');