|
Medial Code Documentation
|
Private mmap file as a read-only stream. More...
#include <io.h>
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< ResourceHandler > | Share () 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. | |
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().
|
inlineexplicit |
Construct a private mmap stream.
| path | File path. |
| offset | See the offset parameter of mmap for details. |
| length | See the length parameter of mmap for details. |