C/C++ API Reference
Loading...
Searching...
No Matches
pw::multibuf::v1_adapter::SingleChunkRegionTracker Class Reference

Overview

Helper type that creates a single OwnedChunk from a region of memory and mimics v1::SingleChunkRegionTracker.

This type can be used as a drop-in replacement for v1::SingleChunkRegionTracker while migrating to using pw_multibuf/v2.

Public Member Functions

 SingleChunkRegionTracker (ByteSpan region)
 
std::optional< OwnedChunkGetChunk (size_t size)
 

Member Function Documentation

◆ GetChunk()

std::optional< OwnedChunk > pw::multibuf::v1_adapter::SingleChunkRegionTracker::GetChunk ( size_t  size)
inline

Gets a Chunk of a given size, which must be less than or equal to the provided region.

Returns: An OwnedChunk if the Chunk is free, otherwise std::nullopt, in which case GetChunk() can be called again.


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