Helios Engine
A modular ECS based data-oriented C++23 game engine framework
Loading...
Searching...
No Matches

Local data for a system. More...

#include <system_local_data.hpp>

Public Member Functions

 SystemLocalData ()=default
 SystemLocalData (SystemLocalDataOptions options)
 SystemLocalData (const SystemLocalData &)=delete
 SystemLocalData (SystemLocalData &&other) noexcept
 ~SystemLocalData ()=default
SystemLocalDataoperator= (SystemLocalData &&other) noexcept
SystemLocalDataoperator= (const SystemLocalData &)=delete
void Update (World &world)
 Updates the system local data by executing commands and merging messages.
void Clear ()
 Clears the system local data.
bool HasPendingWork () const noexcept
 Checks whether commands or messages are still pending application.
void ExecuteCommands (World &world)
 Executes all commands in the local command queue.
void MergeMessages (World &world)
 Merges messages from the local message queue into the world message manager.
void ResetArena () noexcept
 Resets the arena allocator and clears all local data.

Static Public Member Functions

static SystemLocalData From (SystemLocalDataOptions options={})
 Creates system local data from system local data options.

Public Attributes

mem::ArenaAllocator allocator
 local arena allocator
PmrCmdQueue cmd_queue {&allocator}
 local command queue
PmrMessageQueue message_queue {&allocator}
 local message queue
PmrConsumedMessagesRegistry consumed_messages {&allocator}
 local consumed messages registry
ResourceManager resource_manager
 local resource manager

Detailed Description

Local data for a system.

Definition at line 23 of file system_local_data.hpp.

Constructor & Destructor Documentation

◆ SystemLocalData() [1/4]

helios::ecs::SystemLocalData::SystemLocalData ( )
default

◆ SystemLocalData() [2/4]

helios::ecs::SystemLocalData::SystemLocalData ( SystemLocalDataOptions options)
inlineexplicit

Definition at line 44 of file system_local_data.hpp.

◆ SystemLocalData() [3/4]

helios::ecs::SystemLocalData::SystemLocalData ( const SystemLocalData & )
delete

◆ SystemLocalData() [4/4]

helios::ecs::SystemLocalData::SystemLocalData ( SystemLocalData && other)
inlinenoexcept

Definition at line 51 of file system_local_data.hpp.

◆ ~SystemLocalData()

helios::ecs::SystemLocalData::~SystemLocalData ( )
default

Member Function Documentation

◆ Clear()

void helios::ecs::SystemLocalData::Clear ( )
inline

Clears the system local data.

Definition at line 99 of file system_local_data.hpp.

◆ ExecuteCommands()

void helios::ecs::SystemLocalData::ExecuteCommands ( World & world)
inline

Executes all commands in the local command queue.

Parameters
worldWorld to execute commands on

Definition at line 115 of file system_local_data.hpp.

◆ From()

SystemLocalData helios::ecs::SystemLocalData::From ( SystemLocalDataOptions options = {})
inlinestaticnodiscard

Creates system local data from system local data options.

Parameters
optionsSystem local data options
Returns
System local data

Definition at line 38 of file system_local_data.hpp.

◆ HasPendingWork()

bool helios::ecs::SystemLocalData::HasPendingWork ( ) const
inlinenodiscardnoexcept

Checks whether commands or messages are still pending application.

Returns
True if local commands, messages, or consumed-message bookkeeping remain unapplied

Definition at line 106 of file system_local_data.hpp.

◆ MergeMessages()

void helios::ecs::SystemLocalData::MergeMessages ( World & world)
inline

Merges messages from the local message queue into the world message manager.

Parameters
worldWorld to merge messages into

Definition at line 122 of file system_local_data.hpp.

◆ operator=() [1/2]

SystemLocalData & helios::ecs::SystemLocalData::operator= ( const SystemLocalData & )
delete

◆ operator=() [2/2]

SystemLocalData & helios::ecs::SystemLocalData::operator= ( SystemLocalData && other)
inlinenoexcept

Definition at line 63 of file system_local_data.hpp.

◆ ResetArena()

void helios::ecs::SystemLocalData::ResetArena ( )
inlinenoexcept

Resets the arena allocator and clears all local data.

Polymorphic allocator types are move-constructible but not move-assignable, so fresh objects are constructed in place after destroying the stale ones whose internal storage was invalidated by the arena reset.

Definition at line 139 of file system_local_data.hpp.

◆ Update()

void helios::ecs::SystemLocalData::Update ( World & world)
inline

Updates the system local data by executing commands and merging messages.

Call after World::Flush() so reserved entities exist before command execution.

Parameters
worldWorld to update

Definition at line 90 of file system_local_data.hpp.

Member Data Documentation

◆ allocator

mem::ArenaAllocator helios::ecs::SystemLocalData::allocator

local arena allocator

Definition at line 24 of file system_local_data.hpp.

◆ cmd_queue

PmrCmdQueue helios::ecs::SystemLocalData::cmd_queue {&allocator}

local command queue

Definition at line 26 of file system_local_data.hpp.

◆ consumed_messages

PmrConsumedMessagesRegistry helios::ecs::SystemLocalData::consumed_messages {&allocator}

local consumed messages registry

Definition at line 30 of file system_local_data.hpp.

◆ message_queue

PmrMessageQueue helios::ecs::SystemLocalData::message_queue {&allocator}

local message queue

Definition at line 27 of file system_local_data.hpp.

◆ resource_manager

ResourceManager helios::ecs::SystemLocalData::resource_manager

local resource manager

Definition at line 31 of file system_local_data.hpp.