delpi  0.0.1
DElta-complete LP solver
Loading...
Searching...
No Matches
delpi::MappedFileSource Class Reference

A memory-mapped file source for efficiently reading files line by line. More...

#include <MappedFileSource.h>

Inheritance diagram for delpi::MappedFileSource:
delpi::BufferLineSource

Public Member Functions

 MappedFileSource (const char *const filename)
 Construct a MappedFileSource for the given file.
Public Member Functions inherited from delpi::BufferLineSource
bool nextLine (std::string_view &out)
 Retrieve the next line from the buffer.

Private Attributes

const boost::interprocess::file_mapping file_mapping_
 The file mapping object that manages the mapping of the file into memory.
boost::interprocess::mapped_region region_
 The mapped region object that provides access to the mapped file content.

Additional Inherited Members

Protected Member Functions inherited from delpi::BufferLineSource
void initialize (const char *data, std::size_t length)
 Force a reinitialization of the object, setting cur_ and end_ to the new values.

Detailed Description

A memory-mapped file source for efficiently reading files line by line.

MappedFileSource uses memory-mapped file techniques to handle files, allowing for high-performance sequential file reading.

Note
The file is mapped in read-only mode, ant it is freed once the MappedFileSource is destroyed.

Definition at line 23 of file MappedFileSource.h.

Constructor & Destructor Documentation

◆ MappedFileSource()

delpi::MappedFileSource::MappedFileSource ( const char *const filename)
explicit

Construct a MappedFileSource for the given file.

Parameters
filenameThe path to the file to be memory-mapped and read.
Exceptions
boost::interprocess::interprocess_exceptionif the file cannot be mapped.

Definition at line 11 of file MappedFileSource.cpp.


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