EnTT  3.10.0
Public Types | Static Public Member Functions | Static Public Attributes | List of all members
entt::entt_traits< Type > Class Template Reference

Entity traits. More...

#include <entity.hpp>

Inheritance diagram for entt::entt_traits< Type >:
Inheritance graph
[legend]
Collaboration diagram for entt::entt_traits< Type >:
Collaboration graph
[legend]

Public Types

using value_type = Type
 Value type.
 
using entity_type = typename base_type::entity_type
 Underlying entity type.
 
using version_type = typename base_type::version_type
 Underlying version type.
 

Static Public Member Functions

static constexpr entity_type to_integral (const value_type value)
 Converts an entity to its underlying type. More...
 
static constexpr entity_type to_entity (const value_type value)
 Returns the entity part once converted to the underlying type. More...
 
static constexpr version_type to_version (const value_type value)
 Returns the version part once converted to the underlying type. More...
 
static constexpr value_type construct (const entity_type entity, const version_type version)
 Constructs an identifier from its parts. More...
 
static constexpr value_type combine (const entity_type lhs, const entity_type rhs)
 Combines two identifiers in a single one. More...
 

Static Public Attributes

static constexpr entity_type reserved = base_type::entity_mask | (base_type::version_mask << base_type::entity_shift)
 Reserved identifier.
 
static constexpr auto page_size = 4096
 Page size, default is ENTT_SPARSE_PAGE.
 

Detailed Description

template<typename Type>
class entt::entt_traits< Type >

Entity traits.

Template Parameters
TypeType of identifier.

Definition at line 62 of file entity.hpp.

Member Function Documentation

◆ combine()

template<typename Type >
static constexpr value_type entt::entt_traits< Type >::combine ( const entity_type  lhs,
const entity_type  rhs 
)
inlinestaticconstexpr

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 128 of file entity.hpp.

◆ construct()

template<typename Type >
static constexpr value_type entt::entt_traits< Type >::construct ( const entity_type  entity,
const version_type  version 
)
inlinestaticconstexpr

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 114 of file entity.hpp.

◆ to_entity()

template<typename Type >
static constexpr entity_type entt::entt_traits< Type >::to_entity ( const value_type  value)
inlinestaticconstexpr

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 91 of file entity.hpp.

◆ to_integral()

template<typename Type >
static constexpr entity_type entt::entt_traits< Type >::to_integral ( const value_type  value)
inlinestaticconstexpr

Converts an entity to its underlying type.

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

Definition at line 82 of file entity.hpp.

◆ to_version()

template<typename Type >
static constexpr version_type entt::entt_traits< Type >::to_version ( const value_type  value)
inlinestaticconstexpr

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 100 of file entity.hpp.


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