Skip to main content

core Folder

Folders Index

folderbuffer
folderdata
folderspatial

Files Index

filehelios/core/_module.ixx

Aggregate module for helios::core namespace. More...

filealgorithms.ixx

Core algorithms and hash functions for the helios engine. More...

filetypes.ixx

Core type definitions and tag types for the helios engine. More...

Description

helios::core

Core-level utilities shared across the helios engine.

This module provides foundational infrastructure including double-buffering for thread-safe message passing, spatial transformations, type definitions, hash algorithms, and data structures used by higher-level subsystems.

Modules

algorithms

The helios.core.algorithms module provides core algorithms used throughout the engine.

FNV-1a Hash

A fast, compile-time capable hash function for generating identifiers from strings:

 import helios.core.algorithms;
 
 // Compile-time hash
 constexpr uint32_t id = helios::core::algorithms::fnv1a_hash("enemy_spawn");
 
 // Used internally by strongly-typed ID constructors
 constexpr GameObjectPoolId POOL{"bullets"}; // calls fnv1a_hash
 constexpr SpawnProfileId PROFILE{"enemies"}; // calls fnv1a_hash
 constexpr SpawnRuleId RULE{"wave_spawn"}; // calls fnv1a_hash

Note: FNV-1a is not a cryptographic hash. Do not use for security purposes.

types

The helios.core.types module provides core type definitions and tag types used throughout the engine.

Tag Types

TypeDescription
no_init_tTag type to skip default initialization
no_initConvenience constant for uninitialized construction

Uninitialized Construction

The no_init tag enables performance-critical code to skip default initialization when objects will be immediately overwritten:

 import helios.util.Guid;
 import helios.core.types;
 
 // Generate a new unique Guid
 
 // Declare uninitialized Guid for later assignment
 
 // Assign later when the value is known

Warning: Objects constructed with no_init are in an indeterminate state. Reading from them before assignment is undefined behavior.

Supporting no_init in Custom Types

The helios::util::Guid class demonstrates how to add no_init support:

 import helios.core.types;
 
 class Guid final {
  uint64_t value_{};
 
 public:
  // Skip initialization for deferred assignment
  explicit Guid(helios::core::types::no_init_t) {}
 
  // Factory method for generating valid Guids
  static Guid generate() noexcept;
 };


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.