EnTT 3.14.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
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 iterator = std::conditional_t<Policy == deletion_policy::in_place, internal::view_iterator<common_type, 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, boolempty () 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 659 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 674 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 676 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, 1u, 0u>, typename common_type::iterator>

Random access iterator type.

Definition at line 680 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 682 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 678 of file view.hpp.

Member Function Documentation

◆ back()

template<typename Type , deletion_policy Policy>
entity_type entt::basic_storage_view< Type, Policy >::back ( ) const
inlinenoexcept

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 815 of file view.hpp.

◆ begin()

template<typename Type , deletion_policy Policy>
iterator entt::basic_storage_view< Type, Policy >::begin ( ) const
inlinenoexcept

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 739 of file view.hpp.

◆ contains()

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

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 863 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
inlinenoexcept

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 723 of file view.hpp.

◆ end()

template<typename Type , deletion_policy Policy>
iterator entt::basic_storage_view< Type, Policy >::end ( ) const
inlinenoexcept

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 754 of file view.hpp.

◆ find()

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

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 838 of file view.hpp.

◆ front()

template<typename Type , deletion_policy Policy>
entity_type entt::basic_storage_view< Type, Policy >::front ( ) const
inlinenoexcept

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 798 of file view.hpp.

◆ handle()

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

Returns the leading storage of a view, if any.

Returns
The leading storage of the view.

Definition at line 688 of file view.hpp.

◆ operator bool()

template<typename Type , deletion_policy Policy>
entt::basic_storage_view< Type, Policy >::operator bool ( ) const
inlineexplicitnoexcept

Checks if a view is fully initialized.

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

Definition at line 854 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
inlinenoexcept

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 772 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
inlinenoexcept

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 784 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
inlinenoexcept

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 698 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
inlinenoexcept

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 713 of file view.hpp.


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