HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
tt::file_mapping Class Reference

#include <ttauri/file_mapping.hpp>

Public Member Functions

 file_mapping (std::shared_ptr< tt::file > const &file, size_t size)
 
 file_mapping (URL const &path, access_mode accessMode, size_t size)
 
 file_mapping (file_mapping const &other)=delete
 
 file_mapping (file_mapping &&other)=delete
 
file_mappingoperator= (file_mapping const &other)=delete
 
file_mappingoperator= (file_mapping &&other)=delete
 
access_mode accessMode () const noexcept
 
URL const & location () const noexcept
 

Data Fields

std::shared_ptr< filefile
 
size_t size
 
file_handle mapHandle
 

Detailed Description

A file mapping. A file mapping maps a region of bytes to a handle. This is mostly for Window which has an extra layer of indirection before mapping the file to actual memory.

See also
file_view on how to map the file into actual memory.

Constructor & Destructor Documentation

◆ file_mapping() [1/2]

tt::file_mapping::file_mapping ( std::shared_ptr< tt::file > const & file,
size_t size )

Map a file. Map a file up to size bytes.

Parameters
filea pointer to an open file.
sizeNumber of bytes from the start to map.

◆ file_mapping() [2/2]

tt::file_mapping::file_mapping ( URL const & path,
access_mode accessMode,
size_t size )

Map a file. Map a file up to size bytes. This function will automatically open a file and potentially share it with other file_mapping objects.

Parameters
patha URL to a file.
accessModemode of how to access the file.
sizeNumber of bytes from the start to map.

Member Function Documentation

◆ accessMode()

access_mode tt::file_mapping::accessMode ( ) const
inlinenoexcept

Get access mode of the file object.

◆ location()

URL const & tt::file_mapping::location ( ) const
inlinenoexcept

Get URL of the file object.

Field Documentation

◆ file

std::shared_ptr<file> tt::file_mapping::file

A pointer to an open file.

◆ mapHandle

file_handle tt::file_mapping::mapHandle

Operating system handle to a file mapping.

◆ size

size_t tt::file_mapping::size

Size of the mapping.


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