EnTT 4.0.0
Loading...
Searching...
No Matches
entt::basic_storage_view< Type, Policy > Class Template Reference

Basic storage view implementation. More...

#include <view.hpp>

Public Types

using common_type = Type
 Common type among all storage types.
using entity_type = common_type::entity_type
 Underlying entity identifier.
using size_type = stl::size_t
 Unsigned integer type.
using difference_type = stl::ptrdiff_t
 Signed integer type.
using iterator = stl::conditional_t<Policy == deletion_policy::in_place, internal::view_iterator<common_type, true, 1u, 0u>, typename common_type::iterator>
 Random access iterator type.
using reverse_iterator = stl::conditional_t<Policy == deletion_policy::in_place, void, typename common_type::reverse_iterator>
 Reverse iterator type.

Public Member Functions

const common_typehandle () const noexcept
 Returns the leading storage of a view, if any.
size_type size () const noexcept
 Returns the number of entities that have the given element.
size_type size_hint () const noexcept
 Estimates the number of entities iterated by the view.
bool empty () const noexcept
 Checks whether a view is empty.
iterator begin () const noexcept
 Returns an iterator to the first entity of the view.
iterator end () const noexcept
 Returns an iterator that is past the last entity of the view.
reverse_iterator rbegin () const noexcept
 Returns an iterator to the first entity of the reversed view.
reverse_iterator rend () const noexcept
 Returns an iterator that is past the last entity of the reversed view.
entity_type front () const noexcept
 Returns the first entity of the view, if any.
entity_type back () const noexcept
 Returns the last entity of the view, if any.
iterator find (const entity_type entt) const noexcept
 Finds an entity.
 operator bool () const noexcept
 Checks if a view is fully initialized.
bool contains (const entity_type entt) const noexcept
 Checks if a view contains an entity.

Detailed Description

template<cvref_unqualified Type, deletion_policy Policy>
class entt::basic_storage_view< Type, Policy >

Basic storage view implementation.

Warning
For internal use only, backward compatibility not guaranteed.
Template Parameters
TypeCommon type among all storage types.
PolicyStorage policy.

Definition at line 675 of file view.hpp.

Member Typedef Documentation

◆ common_type

template<cvref_unqualified Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::common_type = Type

Common type among all storage types.

Definition at line 688 of file view.hpp.

◆ difference_type

template<cvref_unqualified Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::difference_type = stl::ptrdiff_t

Signed integer type.

Definition at line 694 of file view.hpp.

◆ entity_type

template<cvref_unqualified Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::entity_type = common_type::entity_type

Underlying entity identifier.

Definition at line 690 of file view.hpp.

◆ iterator

template<cvref_unqualified Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::iterator = stl::conditional_t<Policy == deletion_policy::in_place, internal::view_iterator<common_type, true, 1u, 0u>, typename common_type::iterator>

Random access iterator type.

Definition at line 696 of file view.hpp.

◆ reverse_iterator

template<cvref_unqualified Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::reverse_iterator = stl::conditional_t<Policy == deletion_policy::in_place, void, typename common_type::reverse_iterator>

Reverse iterator type.

Definition at line 698 of file view.hpp.

◆ size_type

template<cvref_unqualified Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::size_type = stl::size_t

Unsigned integer type.

Definition at line 692 of file view.hpp.

Member Function Documentation

◆ back()

template<cvref_unqualified Type, deletion_policy Policy>
entity_type entt::basic_storage_view< Type, Policy >::back ( ) const
inlinenodiscardnoexcept

Returns the last entity of the view, if any.

Returns
The last entity of the view if one exists, the null entity otherwise.

Definition at line 826 of file view.hpp.

◆ begin()

template<cvref_unqualified Type, deletion_policy Policy>
iterator entt::basic_storage_view< Type, Policy >::begin ( ) const
inlinenodiscardnoexcept

Returns an iterator to the first entity of the view.

If the view is empty, the returned iterator will be equal to end().

Returns
An iterator to the first entity of the view.

Definition at line 752 of file view.hpp.

◆ contains()

template<cvref_unqualified Type, deletion_policy Policy>
bool entt::basic_storage_view< Type, Policy >::contains ( const entity_type entt) const
inlinenodiscardnoexcept

Checks if a view contains an entity.

Parameters
enttA valid identifier.
Returns
True if the view contains the given entity, false otherwise.

Definition at line 873 of file view.hpp.

◆ empty()

template<cvref_unqualified Type, deletion_policy Policy>
bool entt::basic_storage_view< Type, Policy >::empty ( ) const
inlinenodiscardnoexcept

Checks whether a view is empty.

Returns
True if the view is empty, false otherwise.

Definition at line 735 of file view.hpp.

◆ end()

template<cvref_unqualified Type, deletion_policy Policy>
iterator entt::basic_storage_view< Type, Policy >::end ( ) const
inlinenodiscardnoexcept

Returns an iterator that is past the last entity of the view.

Returns
An iterator to the entity following the last entity of the view.

Definition at line 767 of file view.hpp.

◆ find()

template<cvref_unqualified Type, deletion_policy Policy>
iterator entt::basic_storage_view< Type, Policy >::find ( const entity_type entt) const
inlinenodiscardnoexcept

Finds an entity.

Parameters
enttA valid identifier.
Returns
An iterator to the given entity if it's found, past the end iterator otherwise.

Definition at line 849 of file view.hpp.

◆ front()

template<cvref_unqualified Type, deletion_policy Policy>
entity_type entt::basic_storage_view< Type, Policy >::front ( ) const
inlinenodiscardnoexcept

Returns the first entity of the view, if any.

Returns
The first entity of the view if one exists, the null entity otherwise.

Definition at line 809 of file view.hpp.

◆ handle()

template<cvref_unqualified Type, deletion_policy Policy>
const common_type * entt::basic_storage_view< Type, Policy >::handle ( ) const
inlinenodiscardnoexcept

Returns the leading storage of a view, if any.

Returns
The leading storage of the view.

Definition at line 704 of file view.hpp.

◆ operator bool()

template<cvref_unqualified Type, deletion_policy Policy>
entt::basic_storage_view< Type, Policy >::operator bool ( ) const
inlineexplicitnodiscardnoexcept

Checks if a view is fully initialized.

Returns
True if the view is fully initialized, false otherwise.

Definition at line 864 of file view.hpp.

◆ rbegin()

template<cvref_unqualified Type, deletion_policy Policy>
reverse_iterator entt::basic_storage_view< Type, Policy >::rbegin ( ) const
inlinenodiscardnoexcept

Returns an iterator to the first entity of the reversed view.

If the view is empty, the returned iterator will be equal to rend().

Returns
An iterator to the first entity of the reversed view.

Definition at line 783 of file view.hpp.

◆ rend()

template<cvref_unqualified Type, deletion_policy Policy>
reverse_iterator entt::basic_storage_view< Type, Policy >::rend ( ) const
inlinenodiscardnoexcept

Returns an iterator that is past the last entity of the reversed view.

Returns
An iterator to the entity following the last entity of the reversed view.

Definition at line 794 of file view.hpp.

◆ size()

template<cvref_unqualified Type, deletion_policy Policy>
size_type entt::basic_storage_view< Type, Policy >::size ( ) const
inlinenodiscardnoexcept

Returns the number of entities that have the given element.

Returns
Number of entities that have the given element.

Definition at line 712 of file view.hpp.

◆ size_hint()

template<cvref_unqualified Type, deletion_policy Policy>
size_type entt::basic_storage_view< Type, Policy >::size_hint ( ) const
inlinenodiscardnoexcept

Estimates the number of entities iterated by the view.

Returns
Estimated number of entities iterated by the view.

Definition at line 726 of file view.hpp.


The documentation for this class was generated from the following file: