OpenVDB 11.0.0
Loading...
Searching...
No Matches
PagedInputStream Class Reference

A Paging wrapper to std::istream that is responsible for reading from a given input stream and creating Page objects and PageHandles that reference those pages for delayed reading. More...

#include <openvdb/points/StreamCompression.h>

Public Types

using Ptr = std::shared_ptr<PagedInputStream>
 

Public Member Functions

 PagedInputStream ()=default
 
 PagedInputStream (std::istream &is)
 
void setSizeOnly (bool sizeOnly)
 Size-only mode tags the stream as only reading size data.
 
bool sizeOnly () const
 
std::istream & getInputStream ()
 
void setInputStream (std::istream &is)
 
PageHandle::Ptr createHandle (std::streamsize n)
 Creates a PageHandle to access the next.
 
void read (PageHandle::Ptr &pageHandle, std::streamsize n, bool delayed=true)
 Takes a pageHandle and updates the referenced page with the current stream pointer position and if delayed is false performs an immediate read of the data.
 

Detailed Description

A Paging wrapper to std::istream that is responsible for reading from a given input stream and creating Page objects and PageHandles that reference those pages for delayed reading.

Member Typedef Documentation

◆ Ptr

using Ptr = std::shared_ptr<PagedInputStream>

Constructor & Destructor Documentation

◆ PagedInputStream() [1/2]

PagedInputStream ( )
default

◆ PagedInputStream() [2/2]

PagedInputStream ( std::istream & is)
explicit

Member Function Documentation

◆ createHandle()

PageHandle::Ptr createHandle ( std::streamsize n)

Creates a PageHandle to access the next.

Parameters
nbytes of the Page.

◆ getInputStream()

std::istream & getInputStream ( )
inline

◆ read()

void read ( PageHandle::Ptr & pageHandle,
std::streamsize n,
bool delayed = true )

Takes a pageHandle and updates the referenced page with the current stream pointer position and if delayed is false performs an immediate read of the data.

◆ setInputStream()

void setInputStream ( std::istream & is)
inline

◆ setSizeOnly()

void setSizeOnly ( bool sizeOnly)
inline

Size-only mode tags the stream as only reading size data.

◆ sizeOnly()

bool sizeOnly ( ) const
inline