Medial Code Documentation
Loading...
Searching...
No Matches
Public Member Functions
xgboost::common::PrivateMmapConstStream Class Reference

Private mmap file as a read-only stream. More...

#include <io.h>

Inheritance diagram for xgboost::common::PrivateMmapConstStream:
xgboost::common::AlignedResourceReadStream

Public Member Functions

 PrivateMmapConstStream (std::string path, std::size_t offset, std::size_t length)
 Construct a private mmap stream.
 
- Public Member Functions inherited from xgboost::common::AlignedResourceReadStream
 AlignedResourceReadStream (std::shared_ptr< ResourceHandler > resource)
 
std::shared_ptr< ResourceHandlerShare () noexcept(true)
 
auto Consume (std::size_t n_bytes) noexcept(true)
 Consume n_bytes of data, no copying is performed.
 
template<typename T >
auto Consume (T *out) noexcept(false) -> std::enable_if_t< std::is_pod_v< T >, bool >
 
virtual std::size_t Tell () noexcept(true)
 
std::size_t Read (void *ptr, std::size_t n_bytes) noexcept(true)
 Read n_bytes of data, output is copied into ptr.
 
template<typename T >
auto Read (T *out) noexcept(false) -> std::enable_if_t< std::is_pod_v< T >, bool >
 Read a primitive type.
 
template<typename T >
bool Read (std::vector< T > *out) noexcept(true)
 Read a vector.
 

Detailed Description

Private mmap file as a read-only stream.

It can calculate alignment automatically based on system page size (or allocation granularity on Windows).

The file is required to be aligned by IOAlignment().

Constructor & Destructor Documentation

◆ PrivateMmapConstStream()

xgboost::common::PrivateMmapConstStream::PrivateMmapConstStream ( std::string  path,
std::size_t  offset,
std::size_t  length 
)
inlineexplicit

Construct a private mmap stream.

Parameters
pathFile path.
offsetSee the offset parameter of mmap for details.
lengthSee the length parameter of mmap for details.

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