EnTT 3.14.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
entt::basic_common_view< Type, Get, Exclude > 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 Type::entity_type
 Underlying entity identifier.
 
using size_type = std::size_t
 Unsigned integer type.
 
using iterator = internal::view_iterator<common_type, Get, Exclude>
 Forward iterator type.
 

Public Member Functions

void refresh () noexcept
 Updates the internal leading view if required.
 
const common_typehandle () const noexcept
 Returns the leading storage of a view, if any.
 
size_type size_hint () const noexcept
 Estimates the number of entities iterated by the view.
 
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.
 
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.
 

Friends

template<typename Return , typename View , typename Other , std::size_t... GLhs, std::size_t... ELhs, std::size_t... GRhs, std::size_t... ERhs>
Return internal::view_pack (const View &, const Other &, std::index_sequence< GLhs... >, std::index_sequence< ELhs... >, std::index_sequence< GRhs... >, std::index_sequence< ERhs... >)
 

Detailed Description

template<typename Type, std::size_t Get, std::size_t Exclude>
class entt::basic_common_view< Type, Get, Exclude >

Basic storage view implementation.

Warning
For internal use only, backward compatibility not guaranteed.
Template Parameters
TypeCommon type among all storage types.
GetNumber of storage iterated by the view.
ExcludeNumber of storage used to filter the view.

Definition at line 226 of file view.hpp.

Member Typedef Documentation

◆ common_type

template<typename Type , std::size_t Get, std::size_t Exclude>
using entt::basic_common_view< Type, Get, Exclude >::common_type = Type

Common type among all storage types.

Definition at line 302 of file view.hpp.

◆ entity_type

template<typename Type , std::size_t Get, std::size_t Exclude>
using entt::basic_common_view< Type, Get, Exclude >::entity_type = typename Type::entity_type

Underlying entity identifier.

Definition at line 304 of file view.hpp.

◆ iterator

template<typename Type , std::size_t Get, std::size_t Exclude>
using entt::basic_common_view< Type, Get, Exclude >::iterator = internal::view_iterator<common_type, Get, Exclude>

Forward iterator type.

Definition at line 308 of file view.hpp.

◆ size_type

template<typename Type , std::size_t Get, std::size_t Exclude>
using entt::basic_common_view< Type, Get, Exclude >::size_type = std::size_t

Unsigned integer type.

Definition at line 306 of file view.hpp.

Member Function Documentation

◆ back()

template<typename Type , std::size_t Get, std::size_t Exclude>
entity_type entt::basic_common_view< Type, Get, Exclude >::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 370 of file view.hpp.

◆ begin()

template<typename Type , std::size_t Get, std::size_t Exclude>
iterator entt::basic_common_view< Type, Get, Exclude >::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 343 of file view.hpp.

◆ contains()

template<typename Type , std::size_t Get, std::size_t Exclude>
bool entt::basic_common_view< Type, Get, Exclude >::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 404 of file view.hpp.

◆ end()

template<typename Type , std::size_t Get, std::size_t Exclude>
iterator entt::basic_common_view< Type, Get, Exclude >::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 351 of file view.hpp.

◆ find()

template<typename Type , std::size_t Get, std::size_t Exclude>
iterator entt::basic_common_view< Type, Get, Exclude >::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 387 of file view.hpp.

◆ front()

template<typename Type , std::size_t Get, std::size_t Exclude>
entity_type entt::basic_common_view< Type, Get, Exclude >::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 360 of file view.hpp.

◆ handle()

template<typename Type , std::size_t Get, std::size_t Exclude>
const common_type * entt::basic_common_view< Type, Get, Exclude >::handle ( ) const
inlinenoexcept

Returns the leading storage of a view, if any.

Returns
The leading storage of the view.

Definition at line 324 of file view.hpp.

◆ operator bool()

template<typename Type , std::size_t Get, std::size_t Exclude>
entt::basic_common_view< Type, Get, Exclude >::operator bool ( ) const
inlineexplicitnoexcept

Checks if a view is fully initialized.

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

Definition at line 395 of file view.hpp.

◆ refresh()

template<typename Type , std::size_t Get, std::size_t Exclude>
void entt::basic_common_view< Type, Get, Exclude >::refresh ( )
inlinenoexcept

Updates the internal leading view if required.

Definition at line 311 of file view.hpp.

◆ size_hint()

template<typename Type , std::size_t Get, std::size_t Exclude>
size_type entt::basic_common_view< Type, Get, Exclude >::size_hint ( ) const
inlinenoexcept

Estimates the number of entities iterated by the view.

Returns
Estimated number of entities iterated by the view.

Definition at line 332 of file view.hpp.


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