Donner SVG 0.8.0
0.8.0 ยท ebf353960.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
donner::geode::GeodeGeometryCacheReservation Class Reference

Movable ownership of one cached geometry reservation. More...

#include "donner/svg/renderer/geode/GeodeResourceBudget.h"

Public Member Functions

 GeodeGeometryCacheReservation (const GeodeGeometryCacheReservation &)=delete
GeodeGeometryCacheReservation & operator= (const GeodeGeometryCacheReservation &)=delete
 GeodeGeometryCacheReservation (GeodeGeometryCacheReservation &&other) noexcept
 Transfer ownership of a cache reservation without changing its charge.
GeodeGeometryCacheReservation & operator= (GeodeGeometryCacheReservation &&other) noexcept
 Release the current reservation and take ownership of another.
bool replace (std::shared_ptr< GeodeDocumentGeometryBudget > budget, std::uint64_t bytes)
 Atomically replace the owned cache reservation with a new budget and byte count.
void reset ()
 Release the owned cache charge and forget its budget.
std::uint64_t bytes () const
 Cache bytes charged by this reservation.

Detailed Description

Movable ownership of one cached geometry reservation.

Constructor & Destructor Documentation

◆ GeodeGeometryCacheReservation()

donner::geode::GeodeGeometryCacheReservation::GeodeGeometryCacheReservation ( GeodeGeometryCacheReservation && other)
inlinenoexcept

Transfer ownership of a cache reservation without changing its charge.

Parameters
otherReservation to move into this object.

Member Function Documentation

◆ operator=()

GeodeGeometryCacheReservation & donner::geode::GeodeGeometryCacheReservation::operator= ( GeodeGeometryCacheReservation && other)
inlinenoexcept

Release the current reservation and take ownership of another.

Parameters
otherReservation to move into this object.
Returns
This reservation after the transfer.

◆ replace()

bool donner::geode::GeodeGeometryCacheReservation::replace ( std::shared_ptr< GeodeDocumentGeometryBudget > budget,
std::uint64_t bytes )
inlinenodiscard

Atomically replace the owned cache reservation with a new budget and byte count.

Parameters
budgetDocument budget that will own the replacement charge.
bytesCache bytes requested from that budget.
Returns
False if the replacement cannot be reserved; the old charge remains owned.

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