EnTT 3.13.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
entt::basic_storage_view< Type > 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 = typename common_type::iterator
 Random access iterator type.
 
using reverse_iterator = typename common_type::reverse_iterator
 Reversed 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 component.
 
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<typename Type>
class entt::basic_storage_view< Type >

Basic storage view implementation.

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

Definition at line 625 of file view.hpp.

Member Typedef Documentation

◆ common_type

template<typename Type >
using entt::basic_storage_view< Type >::common_type = Type

Common type among all storage types.

Definition at line 636 of file view.hpp.

◆ entity_type

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

Underlying entity identifier.

Definition at line 638 of file view.hpp.

◆ iterator

template<typename Type >
using entt::basic_storage_view< Type >::iterator = typename common_type::iterator

Random access iterator type.

Definition at line 642 of file view.hpp.

◆ reverse_iterator

template<typename Type >
using entt::basic_storage_view< Type >::reverse_iterator = typename common_type::reverse_iterator

Reversed iterator type.

Definition at line 644 of file view.hpp.

◆ size_type

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

Unsigned integer type.

Definition at line 640 of file view.hpp.

Member Function Documentation

◆ back()

template<typename Type >
entity_type entt::basic_storage_view< Type >::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 724 of file view.hpp.

◆ begin()

template<typename Type >
iterator entt::basic_storage_view< Type >::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 677 of file view.hpp.

◆ contains()

template<typename Type >
bool entt::basic_storage_view< Type >::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 751 of file view.hpp.

◆ empty()

template<typename Type >
bool entt::basic_storage_view< Type >::empty ( ) const
inlinenoexcept

Checks whether a view is empty.

Returns
True if the view is empty, false otherwise.

Definition at line 666 of file view.hpp.

◆ end()

template<typename Type >
iterator entt::basic_storage_view< Type >::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 685 of file view.hpp.

◆ find()

template<typename Type >
iterator entt::basic_storage_view< Type >::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 734 of file view.hpp.

◆ front()

template<typename Type >
entity_type entt::basic_storage_view< Type >::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 715 of file view.hpp.

◆ handle()

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

Returns the leading storage of a view, if any.

Returns
The leading storage of the view.

Definition at line 650 of file view.hpp.

◆ operator bool()

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

Checks if a view is fully initialized.

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

Definition at line 742 of file view.hpp.

◆ rbegin()

template<typename Type >
reverse_iterator entt::basic_storage_view< Type >::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().

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

Definition at line 696 of file view.hpp.

◆ rend()

template<typename Type >
reverse_iterator entt::basic_storage_view< Type >::rend ( ) const
inlinenoexcept

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

◆ size()

template<typename Type >
size_type entt::basic_storage_view< Type >::size ( ) const
inlinenoexcept

Returns the number of entities that have the given component.

Returns
Number of entities that have the given component.

Definition at line 658 of file view.hpp.


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