co_ecs 0.9.0
Cobalt ECS
Loading...
Searching...
No Matches
co_ecs::detail Namespace Reference

Classes

class  dynamic_bitset
 Dynamically growing bitset.
 
struct  func_decomposer
 
struct  function_traits
 Function traits primary template.
 
struct  function_traits< std::function< R(Args...)> >
 Function trait, specialization for std::function.
 
class  handle
 Represents a handle with an ID and a generation index.
 
class  handle_pool
 Pool of handles that generates and recycles handle IDs.
 
class  hash_table
 Hash Table implementation. This implementation uses open addressing hash table implementation using robin hood hashing algorithm.
 
class  linear_allocator
 
class  sparse_table
 Sparse table implementation.
 
class  stack_allocator
 Stack allocator.
 
class  temp_allocator
 Frame allocator, use for temporary allocations.
 
struct  type_id
 Generate unique sequential IDs for types.
 
class  type_registry
 Type registry is a container holding a mapping between type to its assigned ID.
 
struct  unique_types
 Unique type is a structure that helps to statically check whether all types are unique.
 
struct  unique_types< T1 >
 Unique type specialization for at least 1 type.
 
struct  unique_types< T1, T2 >
 Unique type specialization for at 2 types.
 
struct  unique_types< T1, T2, Rest... >
 Unique type specialization for at least 3 types.
 
struct  unique_types<>
 Unique type specialization for 0 types.
 
struct  view_arguments
 view_arguments metadata, like a flag whether all references are const, etc.
 
struct  view_converter
 
struct  view_converter< std::tuple< Args... > >
 
class  work_stealing_queue
 Work stealing queue.
 

Typedefs

template<typename K , typename T , typename Hash = std::hash<K>, typename KeyEqual = std::equal_to<K>, typename Allocator = std::allocator<std::pair<K, T>>>
using hash_map = hash_table<K, T, true, Hash, KeyEqual, Allocator>
 Hash map.
 
template<std::unsigned_integral K, typename T , typename Allocator = std::allocator<std::pair<K, T>>>
using sparse_map = sparse_table<K, T, true, Allocator>
 Sparse map.
 
template<std::size_t I, typename... Args>
using nth_type_t = std::tuple_element_t<I, std::tuple<Args...>>
 Extracts Nth type parameter from parameter pack.
 
template<typename... Args>
using first_type_t = nth_type_t<0, Args...>
 Extracts the first type parameter in parameter pack.
 
template<typename... Args>
using second_type_t = nth_type_t<1, Args...>
 Extracts the second type parameter in parameter pack.
 

Functions

constexpr auto mod_2n (auto value, auto divisor) noexcept -> decltype(auto)
 Calculate the value % b=2^n.
 
constexpr auto is_power_of_2 (auto value) -> bool
 Check if value is a power of 2.
 
constexpr auto approx_85_percent (auto value) noexcept -> decltype(auto)
 Approximately calculate 85% of passed value. 85% is used as a reserve threshold.
 
constexpr auto approx_40_percent (auto value) noexcept -> decltype(auto)
 Approximately calculate 40% of passed value. 40% is used as a reserve threshold.
 

Variables

constexpr auto global_stack_allocator_size = 16ull * 1024 * 1024
 

Typedef Documentation

◆ first_type_t

template<typename... Args>
using co_ecs::detail::first_type_t = nth_type_t<0, Args...>

Extracts the first type parameter in parameter pack.

Template Parameters
ArgsParameter pack

◆ hash_map

template<typename K , typename T , typename Hash = std::hash<K>, typename KeyEqual = std::equal_to<K>, typename Allocator = std::allocator<std::pair<K, T>>>
using co_ecs::detail::hash_map = hash_table<K, T, true, Hash, KeyEqual, Allocator>

Hash map.

Template Parameters
KKey type
TMapped value type
HashHash type for K
KeyEqualKeyEqual type for K
AllocatorAllocator type for std::pair<K, T>

◆ nth_type_t

template<std::size_t I, typename... Args>
using co_ecs::detail::nth_type_t = std::tuple_element_t<I, std::tuple<Args...>>

Extracts Nth type parameter from parameter pack.

Template Parameters
IIndex in parameter pack
ArgsParameter pack

◆ second_type_t

template<typename... Args>
using co_ecs::detail::second_type_t = nth_type_t<1, Args...>

Extracts the second type parameter in parameter pack.

Template Parameters
ArgsParameter pack

◆ sparse_map

template<std::unsigned_integral K, typename T , typename Allocator = std::allocator<std::pair<K, T>>>
using co_ecs::detail::sparse_map = sparse_table<K, T, true, Allocator>

Sparse map.

Template Parameters
KKey type
TValue type
AllocatorAllocator type

Function Documentation

◆ approx_40_percent()

constexpr auto co_ecs::detail::approx_40_percent ( auto value) -> decltype(auto)
constexprnoexcept

Approximately calculate 40% of passed value. 40% is used as a reserve threshold.

Parameters
valueValue
Returns
decltype(auto) Result

◆ approx_85_percent()

constexpr auto co_ecs::detail::approx_85_percent ( auto value) -> decltype(auto)
constexprnoexcept

Approximately calculate 85% of passed value. 85% is used as a reserve threshold.

Parameters
valueValue
Returns
decltype(auto) Result

◆ is_power_of_2()

constexpr auto co_ecs::detail::is_power_of_2 ( auto value) -> bool
constexpr

Check if value is a power of 2.

Parameters
valuePower of two value
Returns
True if power of two, false otherwise

◆ mod_2n()

constexpr auto co_ecs::detail::mod_2n ( auto value,
auto divisor ) -> decltype(auto)
constexprnoexcept

Calculate the value % b=2^n.

Parameters
valueValue
divisorPower of 2 divisor
Returns
decltype(auto) Result

Variable Documentation

◆ global_stack_allocator_size

constexpr auto co_ecs::detail::global_stack_allocator_size = 16ull * 1024 * 1024
constexpr