EnTT 3.15.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 = typename common_type::entity_type
 Underlying entity identifier.
 
using size_type = std::size_t
 Unsigned integer type.
 
using difference_type = std::ptrdiff_t
 Signed integer type.
 
using iterator = std::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 = std::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.
 
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, size_typesize () const noexcept
 Returns the number of entities that have the given element.
 
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol==deletion_policy::in_place, size_typesize_hint () const noexcept
 Estimates the number of entities iterated by the view.
 
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, 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.
 
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, reverse_iteratorrbegin () const noexcept
 Returns an iterator to the first entity of the reversed view.
 
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, reverse_iteratorrend () 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<typename 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 683 of file view.hpp.

Member Typedef Documentation

◆ common_type

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

Common type among all storage types.

Definition at line 698 of file view.hpp.

◆ difference_type

template<typename Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::difference_type = std::ptrdiff_t

Signed integer type.

Definition at line 704 of file view.hpp.

◆ entity_type

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

Underlying entity identifier.

Definition at line 700 of file view.hpp.

◆ iterator

template<typename Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::iterator = std::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 706 of file view.hpp.

◆ reverse_iterator

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

Reverse iterator type.

Definition at line 708 of file view.hpp.

◆ size_type

template<typename Type, deletion_policy Policy>
using entt::basic_storage_view< Type, Policy >::size_type = std::size_t

Unsigned integer type.

Definition at line 702 of file view.hpp.

Member Function Documentation

◆ back()

template<typename 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 841 of file view.hpp.

◆ begin()

template<typename 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 765 of file view.hpp.

◆ contains()

template<typename 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 888 of file view.hpp.

◆ empty()

template<typename Type, deletion_policy Policy>
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, bool > entt::basic_storage_view< Type, Policy >::empty ( ) const
inlinenodiscardnoexcept

Checks whether a view is empty.

Template Parameters
PolDummy template parameter used for sfinae purposes only.
Returns
True if the view is empty, false otherwise.

Definition at line 749 of file view.hpp.

◆ end()

template<typename 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 780 of file view.hpp.

◆ find()

template<typename 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 864 of file view.hpp.

◆ front()

template<typename 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 824 of file view.hpp.

◆ handle()

template<typename 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 714 of file view.hpp.

◆ operator bool()

template<typename 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 879 of file view.hpp.

◆ rbegin()

template<typename Type, deletion_policy Policy>
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, 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().

Template Parameters
PolDummy template parameter used for sfinae purposes only.
Returns
An iterator to the first entity of the reversed view.

Definition at line 798 of file view.hpp.

◆ rend()

template<typename Type, deletion_policy Policy>
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, reverse_iterator > entt::basic_storage_view< Type, Policy >::rend ( ) const
inlinenodiscardnoexcept

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

Template Parameters
PolDummy template parameter used for sfinae purposes only.
Returns
An iterator to the entity following the last entity of the reversed view.

Definition at line 810 of file view.hpp.

◆ size()

template<typename Type, deletion_policy Policy>
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol !=deletion_policy::in_place, size_type > entt::basic_storage_view< Type, Policy >::size ( ) const
inlinenodiscardnoexcept

Returns the number of entities that have the given element.

Template Parameters
PolDummy template parameter used for sfinae purposes only.
Returns
Number of entities that have the given element.

Definition at line 724 of file view.hpp.

◆ size_hint()

template<typename Type, deletion_policy Policy>
template<typename..., deletion_policy Pol = Policy>
std::enable_if_t< Pol==deletion_policy::in_place, size_type > entt::basic_storage_view< Type, Policy >::size_hint ( ) const
inlinenodiscardnoexcept

Estimates the number of entities iterated by the view.

Template Parameters
PolDummy template parameter used for sfinae purposes only.
Returns
Estimated number of entities iterated by the view.

Definition at line 739 of file view.hpp.


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