EnTT: entt::basic_common_view< Type, Checked, Get, Exclude > Class Template Reference

EnTT 3.15.0

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
entt::basic_common_view< Type, Checked, 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 | difference_type = std::ptrdiff_t
| Signed integer type.
using | iterator = internal::view_iterator<common_type, Checked, Get, Exclude>
| Forward iterator type.

## Public Member Functions
void | refresh () noexcept
| Updates the internal leading view if required.
const common_type * | handle () 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, bool Checked, std::size_t Get, std::size_t Exclude>
class entt::basic_common_view< Type, Checked, Get, Exclude >

Basic storage view implementation.

Warning
  For internal use only, backward compatibility not guaranteed.

Template Parameters

  Type | Common type among all storage types.
  Checked | True to enable the tombstone check, false otherwise.
  Get | Number of storage iterated by the view.
  Exclude | Number of storage used to filter the view.

Definition at line 233 of file view.hpp.

## Member Typedef Documentation

## ◆ common_type

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

using entt::basic_common_view< Type, Checked, Get, Exclude >::common_type = Type

Common type among all storage types.

Definition at line 301 of file view.hpp.

## ◆ difference_type

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

using entt::basic_common_view< Type, Checked, Get, Exclude >::difference_type = std::ptrdiff_t

Signed integer type.

Definition at line 307 of file view.hpp.

## ◆ entity_type

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

using entt::basic_common_view< Type, Checked, Get, Exclude >::entity_type = typename Type::entity_type

Underlying entity identifier.

Definition at line 303 of file view.hpp.

## ◆ iterator

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

using entt::basic_common_view< Type, Checked, Get, Exclude >::iterator = internal::view_iterator<common_type, Checked, Get, Exclude>

Forward iterator type.

Definition at line 309 of file view.hpp.

## ◆ size_type

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

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

Unsigned integer type.

Definition at line 305 of file view.hpp.

## Member Function Documentation

## ◆ back()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

entity_type entt::basic_common_view< Type, Checked, Get, Exclude >::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 371 of file view.hpp.

## ◆ begin()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

iterator entt::basic_common_view< Type, Checked, Get, Exclude >::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 344 of file view.hpp.

## ◆ contains()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

bool entt::basic_common_view< Type, Checked, Get, Exclude >::contains | ( | const entity_type | entt | ) | const
| inlinenodiscardnoexcept

Checks if a view contains an entity.

Parameters

  entt | A valid identifier.

Returns
  True if the view contains the given entity, false otherwise.

Definition at line 405 of file view.hpp.

## ◆ end()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

iterator entt::basic_common_view< Type, Checked, Get, Exclude >::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 352 of file view.hpp.

## ◆ find()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

iterator entt::basic_common_view< Type, Checked, Get, Exclude >::find | ( | const entity_type | entt | ) | const
| inlinenodiscardnoexcept

Finds an entity.

Parameters

  entt | A valid identifier.

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

Definition at line 388 of file view.hpp.

## ◆ front()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

entity_type entt::basic_common_view< Type, Checked, Get, Exclude >::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 361 of file view.hpp.

## ◆ handle()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

const common_type * entt::basic_common_view< Type, Checked, Get, Exclude >::handle | ( |  | ) | const
| inlinenodiscardnoexcept

Returns the leading storage of a view, if any.

Returns
  The leading storage of the view.

Definition at line 325 of file view.hpp.

## ◆ operator bool()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

entt::basic_common_view< Type, Checked, Get, Exclude >::operator bool | ( |  | ) | const
| inlineexplicitnodiscardnoexcept

Checks if a view is fully initialized.

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

Definition at line 396 of file view.hpp.

## ◆ refresh()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

void entt::basic_common_view< Type, Checked, Get, Exclude >::refresh | ( |  | ) |
| inlinenoexcept

Updates the internal leading view if required.

Definition at line 312 of file view.hpp.

## ◆ size_hint()

template<typename Type, bool Checked, std::size_t Get, std::size_t Exclude>

size_type entt::basic_common_view< Type, Checked, Get, Exclude >::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 333 of file view.hpp.

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

- src/entt/entity/view.hpp