Donner SVG main
0.8.0 ยท 766e862a0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::components::StyleSystem::PreparedBatch Class Reference

Holds bounded selector traces for a static document while the caller owns its access. More...

#include "donner/svg/components/style/StyleSystem.h"

Public Member Functions

 PreparedBatch (Registry &registry, std::span< const Entity > entities, std::size_t contexts, bool collectWarnings=true, bool enableFilter=false, const entt::sparse_set *preparedIndex=nullptr)
Worker * bindWorker ()
 Bind a context to the executing thread. A new context over the bound requests serial replay.
bool prepareDocumentRoot ()
 Publish a missing document root and its ancestor chain before admitting concurrent tasks.
 PreparedBatch (const PreparedBatch &)=delete
PreparedBatch & operator= (const PreparedBatch &)=delete
bool compute (Entity entity, Worker &worker)
 Compute one slot after its parent's publication, using a private worker pass.
bool computeAt (std::size_t index, Entity entity, Worker &worker, bool publishSlot=true)
 Process an input by its position in the immutable entity span. A caller may defer publication on a leaf that no other worker will read.
std::size_t commit (std::span< const Entity > requests, ParseWarningSink &warnings, bool useTraces)
 Discard provisional records, then replay requests with ordinary serial admission and diagnostics.

Static Public Member Functions

static std::size_t workerReservationBytes ()
 Per-context bytes reserved against the separate document and family preparation limits.

Static Public Attributes

static constexpr std::size_t kMaximumElements = 32768
 Above this bound the caller uses the existing serial path without allocating traces.

Detailed Description

Holds bounded selector traces for a static document while the caller owns its access.

Input slots must already exist and be empty, and each input entity occurs once. After workers join, commit visits the original requests through the serial cache and budget.

Constructor & Destructor Documentation

◆ PreparedBatch()

donner::svg::components::StyleSystem::PreparedBatch::PreparedBatch ( Registry & registry,
std::span< const Entity > entities,
std::size_t contexts,
bool collectWarnings = true,
bool enableFilter = false,
const entt::sparse_set * preparedIndex = nullptr )
Parameters
registryDocument under exclusive access until commit.
entitiesAll new slots, including missing ancestors of selective requests.
contextsMaximum executing contexts, including caller fallback.
collectWarningsWhether the caller collects diagnostics.
preparedIndexOptional immutable forest index whose packed span is entities.

Member Function Documentation

◆ commit()

std::size_t donner::svg::components::StyleSystem::PreparedBatch::commit ( std::span< const Entity > requests,
ParseWarningSink & warnings,
bool useTraces )

Discard provisional records, then replay requests with ordinary serial admission and diagnostics.

Parameters
requestsOriginal serial storage order for this pass.
warningsCanonical document warning sink.
useTracesFalse after speculative resource pressure or incomplete execution.
Returns
Number of elements whose recorded selector work the owner accepted.

◆ compute()

bool donner::svg::components::StyleSystem::PreparedBatch::compute ( Entity entity,
Worker & worker )

Compute one slot after its parent's publication, using a private worker pass.

Parameters
entityEntity exclusively assigned to this task.
workerContext returned by this batch on the executing thread.
Returns
True if the element produced a usable provisional result.

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