Bicameral Engine
GPU-resident engine for a magic-research open-world game
Loading...
Searching...
No Matches
bicameral::frame::TableHotReload Class Reference

#include <table_hot_reload.h>

Classes

struct  Scheduled

Public Member Functions

 TableHotReload (script::ReactionTableSource source, std::shared_ptr< const script::LoadedReactionTable > initial, bool watch)
void Poll (uint64_t frameNumber)
std::expected< std::vector< sim::ProbeTableSwap >, std::string > TakeSwaps (uint64_t firstUnit, uint32_t unitCount, uint32_t unitsPerTick, bool replaying, bool canAddCommand, uint32_t &nextSequence, std::vector< sim::ProbeCommand > &commands)
uint64_t AppliedVersion () const
uint32_t AppliedCount () const
uint32_t FailedCount () const
bool Watching () const
bool Waiting () const
const std::string & LastMessage () const
bool LastFailed () const

Private Member Functions

void Remember (const std::shared_ptr< const script::LoadedReactionTable > &table)
std::expected< void, std::string > ScheduleReplayed (std::span< const sim::ProbeCommand > commands)

Private Attributes

std::optional< script::ReactionTableHotReload > m_reload
std::map< uint64_t, std::shared_ptr< const script::LoadedReactionTable > > m_known
std::shared_ptr< const script::LoadedReactionTable > m_waiting
std::vector< Scheduled > m_scheduled
std::vector< std::shared_ptr< const script::LoadedReactionTable > > m_inFlight
uint64_t m_appliedVersion = 0
uint32_t m_appliedCount = 0
uint32_t m_failedCount = 0
std::string m_lastMessage
bool m_lastFailed = false

Detailed Description

Definition at line 28 of file table_hot_reload.h.

Constructor & Destructor Documentation

◆ TableHotReload()

bicameral::frame::TableHotReload::TableHotReload ( script::ReactionTableSource source,
std::shared_ptr< const script::LoadedReactionTable > initial,
bool watch )

Definition at line 20 of file table_hot_reload.cpp.

References m_appliedVersion, m_reload, and Remember().

Here is the call graph for this function:

Member Function Documentation

◆ AppliedCount()

uint32_t bicameral::frame::TableHotReload::AppliedCount ( ) const
inlinenodiscard

Definition at line 47 of file table_hot_reload.h.

References m_appliedCount.

◆ AppliedVersion()

uint64_t bicameral::frame::TableHotReload::AppliedVersion ( ) const
inlinenodiscard

Definition at line 46 of file table_hot_reload.h.

References m_appliedVersion.

◆ FailedCount()

uint32_t bicameral::frame::TableHotReload::FailedCount ( ) const
inlinenodiscard

Definition at line 48 of file table_hot_reload.h.

References m_failedCount.

◆ LastFailed()

bool bicameral::frame::TableHotReload::LastFailed ( ) const
inlinenodiscard

Definition at line 52 of file table_hot_reload.h.

References m_lastFailed.

◆ LastMessage()

const std::string & bicameral::frame::TableHotReload::LastMessage ( ) const
inlinenodiscard

Definition at line 51 of file table_hot_reload.h.

References m_lastMessage.

◆ Poll()

void bicameral::frame::TableHotReload::Poll ( uint64_t frameNumber)

◆ Remember()

void bicameral::frame::TableHotReload::Remember ( const std::shared_ptr< const script::LoadedReactionTable > & table)
private

Definition at line 28 of file table_hot_reload.cpp.

References m_known.

Referenced by Poll(), and TableHotReload().

Here is the caller graph for this function:

◆ ScheduleReplayed()

std::expected< void, std::string > bicameral::frame::TableHotReload::ScheduleReplayed ( std::span< const sim::ProbeCommand > commands)
nodiscardprivate

Definition at line 57 of file table_hot_reload.cpp.

References m_appliedVersion, m_known, m_scheduled, and bicameral::sim::TableCommandVersion().

Referenced by TakeSwaps().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TakeSwaps()

std::expected< std::vector< sim::ProbeTableSwap >, std::string > bicameral::frame::TableHotReload::TakeSwaps ( uint64_t firstUnit,
uint32_t unitCount,
uint32_t unitsPerTick,
bool replaying,
bool canAddCommand,
uint32_t & nextSequence,
std::vector< sim::ProbeCommand > & commands )
nodiscard

Definition at line 78 of file table_hot_reload.cpp.

References bicameral::sim::CommandPrecedes(), bicameral::Info, bicameral::Log(), m_appliedCount, m_appliedVersion, m_inFlight, m_scheduled, m_waiting, bicameral::sim::MakeTableCommand(), ScheduleReplayed(), and bicameral::Sim.

Here is the call graph for this function:

◆ Waiting()

bool bicameral::frame::TableHotReload::Waiting ( ) const
inlinenodiscard

Definition at line 50 of file table_hot_reload.h.

References m_waiting.

◆ Watching()

bool bicameral::frame::TableHotReload::Watching ( ) const
inlinenodiscard

Definition at line 49 of file table_hot_reload.h.

References m_reload.

Member Data Documentation

◆ m_appliedCount

uint32_t bicameral::frame::TableHotReload::m_appliedCount = 0
private

Definition at line 71 of file table_hot_reload.h.

Referenced by AppliedCount(), and TakeSwaps().

◆ m_appliedVersion

uint64_t bicameral::frame::TableHotReload::m_appliedVersion = 0
private

Definition at line 70 of file table_hot_reload.h.

Referenced by AppliedVersion(), ScheduleReplayed(), TableHotReload(), and TakeSwaps().

◆ m_failedCount

uint32_t bicameral::frame::TableHotReload::m_failedCount = 0
private

Definition at line 72 of file table_hot_reload.h.

Referenced by FailedCount(), and Poll().

◆ m_inFlight

std::vector<std::shared_ptr<const script::LoadedReactionTable> > bicameral::frame::TableHotReload::m_inFlight
private

Definition at line 68 of file table_hot_reload.h.

Referenced by TakeSwaps().

◆ m_known

std::map<uint64_t, std::shared_ptr<const script::LoadedReactionTable> > bicameral::frame::TableHotReload::m_known
private

Definition at line 64 of file table_hot_reload.h.

Referenced by Remember(), and ScheduleReplayed().

◆ m_lastFailed

bool bicameral::frame::TableHotReload::m_lastFailed = false
private

Definition at line 74 of file table_hot_reload.h.

Referenced by LastFailed(), and Poll().

◆ m_lastMessage

std::string bicameral::frame::TableHotReload::m_lastMessage
private

Definition at line 73 of file table_hot_reload.h.

Referenced by LastMessage(), and Poll().

◆ m_reload

std::optional<script::ReactionTableHotReload> bicameral::frame::TableHotReload::m_reload
private

Definition at line 63 of file table_hot_reload.h.

Referenced by Poll(), TableHotReload(), and Watching().

◆ m_scheduled

std::vector<Scheduled> bicameral::frame::TableHotReload::m_scheduled
private

Definition at line 66 of file table_hot_reload.h.

Referenced by ScheduleReplayed(), and TakeSwaps().

◆ m_waiting

std::shared_ptr<const script::LoadedReactionTable> bicameral::frame::TableHotReload::m_waiting
private

Definition at line 65 of file table_hot_reload.h.

Referenced by Poll(), TakeSwaps(), and Waiting().


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