EnTT: entt::basic_entt_traits< Traits > Class Template Reference

EnTT 3.16.0

Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
entt::basic_entt_traits< Traits > Class Template Reference

Common basic entity traits implementation. More...

`#include <entity.hpp>`

Inheritance diagram for entt::basic_entt_traits< Traits >:
[legend]

## Public Types
using | value_type = typename Traits::value_type
| Value type.
using | entity_type = typename Traits::entity_type
| Underlying entity type.
using | version_type = typename Traits::version_type
| Underlying version type.

## Static Public Member Functions
static constexpr entity_type | to_integral (const value_type value) noexcept
| Converts an entity to its underlying type.
static constexpr entity_type | to_entity (const value_type value) noexcept
| Returns the entity part once converted to the underlying type.
static constexpr version_type | to_version (const value_type value) noexcept
| Returns the version part once converted to the underlying type.
static constexpr value_type | next (const value_type value) noexcept
| Returns the successor of a given identifier.
static constexpr value_type | construct (const entity_type entity, const version_type version) noexcept
| Constructs an identifier from its parts.
static constexpr value_type | combine (const entity_type lhs, const entity_type rhs) noexcept
| Combines two identifiers in a single one.

## Static Public Attributes
static constexpr entity_type | entity_mask = Traits::entity_mask
| Entity mask size.
static constexpr entity_type | version_mask = Traits::version_mask
| Version mask size.

## Detailed Description

template<typename Traits>
class entt::basic_entt_traits< Traits >

Common basic entity traits implementation.

Template Parameters

  Traits | Actual entity traits to use.

Definition at line 61 of file entity.hpp.

## Member Typedef Documentation

## ◆ entity_type

template<typename Traits>

using entt::basic_entt_traits< Traits >::entity_type = typename Traits::entity_type

Underlying entity type.

Definition at line 71 of file entity.hpp.

## ◆ value_type

template<typename Traits>

using entt::basic_entt_traits< Traits >::value_type = typename Traits::value_type

Value type.

Definition at line 69 of file entity.hpp.

## ◆ version_type

template<typename Traits>

using entt::basic_entt_traits< Traits >::version_type = typename Traits::version_type

Underlying version type.

Definition at line 73 of file entity.hpp.

## Member Function Documentation

## ◆ combine()

template<typename Traits>

constexpr value_type entt::basic_entt_traits< Traits >::combine | ( | const entity_type | lhs,
|  | const entity_type | rhs )
| inlinestaticnodiscardconstexprnoexcept

Combines two identifiers in a single one.

The returned identifier is a copy of the first element except for its version, which is taken from the second element.

Parameters

  lhs | The identifier from which to take the entity part.
  rhs | The identifier from which to take the version part.

Returns
  A properly constructed identifier.

Definition at line 149 of file entity.hpp.

## ◆ construct()

template<typename Traits>

constexpr value_type entt::basic_entt_traits< Traits >::construct | ( | const entity_type | entity,
|  | const version_type | version )
| inlinestaticnodiscardconstexprnoexcept

Constructs an identifier from its parts.

If the version part is not provided, a tombstone is returned.
If the entity part is not provided, a null identifier is returned.

Parameters

  entity | The entity part of the identifier.
  version | The version part of the identifier.

Returns
  A properly constructed identifier.

Definition at line 131 of file entity.hpp.

## ◆ next()

template<typename Traits>

constexpr value_type entt::basic_entt_traits< Traits >::next | ( | const value_type | value | ) |
| inlinestaticnodiscardconstexprnoexcept

Returns the successor of a given identifier.

Parameters

  value | The identifier of which to return the successor.

Returns
  The successor of the given identifier.

Definition at line 116 of file entity.hpp.

## ◆ to_entity()

template<typename Traits>

constexpr entity_type entt::basic_entt_traits< Traits >::to_entity | ( | const value_type | value | ) |
| inlinestaticnodiscardconstexprnoexcept

Returns the entity part once converted to the underlying type.

Parameters

  value | The value to convert.

Returns
  The integral representation of the entity part.

Definition at line 94 of file entity.hpp.

## ◆ to_integral()

template<typename Traits>

constexpr entity_type entt::basic_entt_traits< Traits >::to_integral | ( | const value_type | value | ) |
| inlinestaticnodiscardconstexprnoexcept

Converts an entity to its underlying type.

Parameters

  value | The value to convert.

Returns
  The integral representation of the given value.

Definition at line 85 of file entity.hpp.

## ◆ to_version()

template<typename Traits>

constexpr version_type entt::basic_entt_traits< Traits >::to_version | ( | const value_type | value | ) |
| inlinestaticnodiscardconstexprnoexcept

Returns the version part once converted to the underlying type.

Parameters

  value | The value to convert.

Returns
  The integral representation of the version part.

Definition at line 103 of file entity.hpp.

## Member Data Documentation

## ◆ entity_mask

template<typename Traits>

entity_type entt::basic_entt_traits< Traits >::entity_mask = Traits::entity_mask
| staticconstexpr

Entity mask size.

Definition at line 76 of file entity.hpp.

## ◆ version_mask

template<typename Traits>

entity_type entt::basic_entt_traits< Traits >::version_mask = Traits::version_mask
| staticconstexpr

Version mask size.

Definition at line 78 of file entity.hpp.

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

- src/entt/entity/entity.hpp