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

Namespaces

namespace  detail
 

Classes

class  access_pattern_t
 Class representing an access pattern for components. More...
 
class  archetype
 Archetype groups entities that share the same types of components. Archetype has a list of fixed size chunks where entities and their components are stored in a packed arrays, in a so called SoA fashion. More...
 
class  archetypes
 Container for archetypes, holds a map from component set to archetype. More...
 
class  base_registry
 
struct  block_metadata
 Block metadata holds pointers where it begins, ends and a component metadata it holds. More...
 
class  chunk
 Chunk holds a 16 Kb block of memory that holds components in blocks: |A1|A2|A3|...padding|B1|B2|B3|...padding|C1|C2|C3...padding where A, B, C are component types and A1, B1, C1 and others are components instances. More...
 
class  chunk_view
 A type aware view into a chunk components. More...
 
class  command_buffer
 This class manages command buffers and facilitates command execution. More...
 
class  command_entity_ref
 This class provides a reference to a command entity, allowing operations such as setting, removing components, and cloning the entity. More...
 
class  command_writer
 This class is responsible for writing commands to a command_buffer. More...
 
struct  component_fetch
 Component fetch is a namespace for routines that figure out based on input component_reference how to fetch the component from the chunk. More...
 
struct  component_meta
 Component metadata. Stores an ID, size, alignment, destructor, etc. More...
 
class  component_meta_set
 Component set holds a set of components metadata. More...
 
class  component_not_found
 Exception raised when accessing entities component which was not assigned. More...
 
class  component_set
 Component set holds a set of component IDs. More...
 
class  component_set_hasher
 Component set hasher. More...
 
struct  const_component_reference
 Struct to determine const-ness of component reference type. More...
 
struct  const_component_references
 Struct to determine whether all component references are const. More...
 
class  const_entity_ref
 Represents a reference to an entity within a registry. More...
 
class  entity_location
 Entity location. More...
 
class  entity_not_found
 Exception raised when accessing non existing entity. More...
 
class  entity_ref
 Represents a reference to an entity within a registry. More...
 
class  insufficient_chunk_size
 Insufficient chunk size error. More...
 
struct  main_thread_execution_policty_t
 Structure representing the main thread execution policy. More...
 
struct  mutable_component_reference
 Struct to determine mutability of component reference type. More...
 
class  named_system
 System implementation class for generic F function-like type with it's name. More...
 
class  placeholder_entity
 Placeholder (reserved) entity. More...
 
class  registry
 Registry is a container for all our entities and components. Components are stored in continuously in memory allowing for very fast iterations, a so called SoA approach. A set of unique components form an archetype, where every entity is mapped to an archetype. More...
 
class  schedule
 Manages the execution of systems in different stages. More...
 
class  schedule_executor
 Executes the schedule by running all stages. More...
 
class  stage
 Class representing a stage in the schedule. More...
 
class  stage_executor
 Class representing a stage executor. More...
 
class  system_executor_interface
 System executor interface, a system is a type that implements run() method. More...
 
class  system_interface
 System interface. More...
 
class  task_pool
 Manages a pool of tasks, allocated from a circular array. Tasks are reused instead of being deallocated explicitly. More...
 
class  task_t
 Represents a task that can be executed, monitored for completion, and linked to a parent task. More...
 
class  thread_pool
 Generic thread pool implementation. More...
 
struct  type_meta
 Type meta information. More...
 
class  view
 A view lets you get a range over components of Args out of a registry. More...
 

Concepts

concept  component
 Component concept. The component must be a struct/class that can be move constructed and move assignable.
 
concept  component_reference
 Component reference concept. It should be a reference or const reference to C, where C satisfies component concept.
 

Typedefs

using blocks_type = detail::sparse_map<component_id_t, block_metadata>
 
using component_id_t = std::uint32_t
 Type for component ID.
 
using component_id = detail::type_id<struct _component_family_t, component_id_t>
 Type for family used to generated component IDs.
 
template<component_reference T>
using decay_component_t = std::decay_t<T>
 Decay component; converts component_reference to component by removing cv-qualifiers and reference.
 
using entity = detail::handle<struct entity_tag_t>
 Represents an entity, consisting of an ID and generation.
 
using entity_pool = detail::handle_pool<entity>
 Pool of entities that generates and recycles entity IDs.
 
using vector_of_executors_t = std::vector<std::unique_ptr<system_executor_interface>>
 Vector of systems.
 

Enumerations

enum  access_type { none , read , write }
 Enumeration representing the type of access. More...
 

Functions

template<typename R >
void parallel_for (R &&range, auto &&func)
 Parallelize func over elements in range.
 

Variables

constexpr auto invalid_component_id = std::numeric_limits<component_id_t>::max()
 Invalid component ID.
 
template<component_reference T>
constexpr bool const_component_reference_v = const_component_reference<T>::value
 Returns true for const component references.
 
template<component_reference T>
constexpr bool mutable_component_reference_v = mutable_component_reference<T>::value
 Returns true for non-const component references.
 
template<component_reference... Args>
constexpr bool const_component_references_v = const_component_references<Args...>::value
 Returns true when all Args are const references.
 
constexpr main_thread_execution_policty_t main_thread_execution_policy {}
 Constant instance of the main thread execution policy.
 

Typedef Documentation

◆ blocks_type

◆ component_id

using co_ecs::component_id = detail::type_id<struct _component_family_t, component_id_t>

Type for family used to generated component IDs.

◆ component_id_t

using co_ecs::component_id_t = std::uint32_t

Type for component ID.

◆ decay_component_t

template<component_reference T>
using co_ecs::decay_component_t = std::decay_t<T>

Decay component; converts component_reference to component by removing cv-qualifiers and reference.

Template Parameters
TType

◆ entity

using co_ecs::entity = detail::handle<struct entity_tag_t>

Represents an entity, consisting of an ID and generation.

◆ entity_pool

using co_ecs::entity_pool = detail::handle_pool<entity>

Pool of entities that generates and recycles entity IDs.

◆ vector_of_executors_t

using co_ecs::vector_of_executors_t = std::vector<std::unique_ptr<system_executor_interface>>

Vector of systems.

This type alias defines a vector of unique pointers to system executor interfaces.

Enumeration Type Documentation

◆ access_type

Enumeration representing the type of access.

This enum defines the different types of access permissions: none, read, and write.

Enumerator
none 

No access.

read 

Read access.

write 

Write access.

Function Documentation

◆ parallel_for()

template<typename R >
void co_ecs::parallel_for ( R && range,
auto && func )

Parallelize func over elements in range.

Template Parameters
RRange type
Parameters
rangeRange to apply func to
funcFunction

Variable Documentation

◆ const_component_reference_v

template<component_reference T>
constexpr bool co_ecs::const_component_reference_v = const_component_reference<T>::value
constexpr

Returns true for const component references.

Template Parameters
Tcomponent_reference type

◆ const_component_references_v

template<component_reference... Args>
constexpr bool co_ecs::const_component_references_v = const_component_references<Args...>::value
constexpr

Returns true when all Args are const references.

Template Parameters
ArgsComponent references

◆ invalid_component_id

constexpr auto co_ecs::invalid_component_id = std::numeric_limits<component_id_t>::max()
constexpr

Invalid component ID.

◆ main_thread_execution_policy

constexpr main_thread_execution_policty_t co_ecs::main_thread_execution_policy {}
inlineconstexpr

Constant instance of the main thread execution policy.

◆ mutable_component_reference_v

template<component_reference T>
constexpr bool co_ecs::mutable_component_reference_v = mutable_component_reference<T>::value
constexpr

Returns true for non-const component references.

Template Parameters
Tcomponent_reference type