Toast Engine
Loading...
Searching...
No Matches
toast::TickScheduler Class Reference
Collaboration diagram for toast::TickScheduler:

Classes

struct  DependencyGraph

Public Member Functions

auto registerDependency (Node &from, Node &to) -> bool
 Records a tick ordering constraint between two nodes.
auto unregisterDependency (Node &from, Node &to) -> bool
auto registerInteraction (Node &first, Node &second) -> bool
 Records that the scripts of two nodes call each other.
void compute (const std::vector< Box< Node > > &all_nodes)
 Rebuilds the tick schedule from the given node set.
void run () const
 Runs the four frame phases (early_tick → tick → post_physics → late_tick) of the schedule.
void runLifecycle (Node &root, TickFunctionList stage) const
 Runs a lifecycle stage on root and every node below it, parents before their children.
void runPhaseSerial (const std::vector< _detail::TickSchedule::Wave > &phase, TickFunctionList func, std::string_view name) const
 Runs a phase wave by wave on the calling thread; for phases that touch thread-bound state like the physics simulator.
void runPhase (const std::vector< _detail::TickSchedule::Wave > &phase, TickFunctionList func, std::string_view name) const
 Dispatches a single phase of the tick schedule.

Public Attributes

std::mutex graph_mutex
 Scripts register dependencies from init().
DependencyGraph graph
_detail::TickSchedule schedule
_detail::Interactions interactions
 The nodes that declared an interaction.

Member Function Documentation

◆ registerDependency()

auto toast::TickScheduler::registerDependency ( Node & from,
Node & to ) -> bool

Records a tick ordering constraint between two nodes.

Note
The schedule is NOT rebuilt automatically; the owner calls compute() when appropriate

◆ runLifecycle()

void toast::TickScheduler::runLifecycle ( Node & root,
TickFunctionList stage ) const

Runs a lifecycle stage on root and every node below it, parents before their children.

Parameters
stageinit, begin or on_enable

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