Donner SVG main
0.8.0 ยท 382bd0190.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::svg::detail::DecorationWorkBudget< Count > Class Template Reference

Counts geometry before allocation without allowing accumulated costs to exceed the allowance. More...

#include "donner/svg/renderer/DecorationWorkBudget.h"

Public Member Functions

 DecorationWorkBudget (Count allowance)
 Creates a preflight with the draw's remaining allowance.
void add (Count points)
 Charges one segment, permanently exhausting the allowance if it cannot fit.
bool exceeded () const
 Whether any segment exceeded the allowance.
Count remaining () const
 Work left after all admitted segments, or zero after rejection.
Count points () const
 Number of points admitted, valid for geometry construction only when not exceeded.

Detailed Description

template<std::unsigned_integral Count>
class donner::svg::detail::DecorationWorkBudget< Count >

Counts geometry before allocation without allowing accumulated costs to exceed the allowance.

Template Parameters
CountUnsigned work-counter type.

Constructor & Destructor Documentation

◆ DecorationWorkBudget()

template<std::unsigned_integral Count>
donner::svg::detail::DecorationWorkBudget< Count >::DecorationWorkBudget ( Count allowance)
inlineexplicit

Creates a preflight with the draw's remaining allowance.

Parameters
allowanceMaximum geometry work admitted by this preflight.

Member Function Documentation

◆ add()

template<std::unsigned_integral Count>
void donner::svg::detail::DecorationWorkBudget< Count >::add ( Count points)
inline

Charges one segment, permanently exhausting the allowance if it cannot fit.

Parameters
pointsNumber of points the segment would generate.

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