EnTT 3.13.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 >:
Inheritance graph
[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
TraitsActual entity traits to use.

Definition at line 66 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 76 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 74 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 78 of file entity.hpp.

Member Function Documentation

◆ combine()

template<typename Traits >
static constexpr value_type entt::basic_entt_traits< Traits >::combine ( const entity_type  lhs,
const entity_type  rhs 
)
inlinestaticconstexprnoexcept

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
lhsThe identifier from which to take the entity part.
rhsThe identifier from which to take the version part.
Returns
A properly constructed identifier.

Definition at line 146 of file entity.hpp.

◆ construct()

template<typename Traits >
static constexpr value_type entt::basic_entt_traits< Traits >::construct ( const entity_type  entity,
const version_type  version 
)
inlinestaticconstexprnoexcept

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
entityThe entity part of the identifier.
versionThe version part of the identifier.
Returns
A properly constructed identifier.

Definition at line 132 of file entity.hpp.

◆ next()

template<typename Traits >
static constexpr value_type entt::basic_entt_traits< Traits >::next ( const value_type  value)
inlinestaticconstexprnoexcept

Returns the successor of a given identifier.

Parameters
valueThe identifier of which to return the successor.
Returns
The successor of the given identifier.

Definition at line 117 of file entity.hpp.

◆ to_entity()

template<typename Traits >
static constexpr entity_type entt::basic_entt_traits< Traits >::to_entity ( const value_type  value)
inlinestaticconstexprnoexcept

Returns the entity part once converted to the underlying type.

Parameters
valueThe value to convert.
Returns
The integral representation of the entity part.

Definition at line 99 of file entity.hpp.

◆ to_integral()

template<typename Traits >
static constexpr entity_type entt::basic_entt_traits< Traits >::to_integral ( const value_type  value)
inlinestaticconstexprnoexcept

Converts an entity to its underlying type.

Parameters
valueThe value to convert.
Returns
The integral representation of the given value.

Definition at line 90 of file entity.hpp.

◆ to_version()

template<typename Traits >
static constexpr version_type entt::basic_entt_traits< Traits >::to_version ( const value_type  value)
inlinestaticconstexprnoexcept

Returns the version part once converted to the underlying type.

Parameters
valueThe value to convert.
Returns
The integral representation of the version part.

Definition at line 108 of file entity.hpp.

Member Data Documentation

◆ entity_mask

template<typename Traits >
constexpr entity_type entt::basic_entt_traits< Traits >::entity_mask = Traits::entity_mask
staticconstexpr

Entity mask size.

Definition at line 81 of file entity.hpp.

◆ version_mask

template<typename Traits >
constexpr entity_type entt::basic_entt_traits< Traits >::version_mask = Traits::version_mask
staticconstexpr

Version mask size.

Definition at line 83 of file entity.hpp.


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