Class wrapper around the Windows 32-bit file mapping functions which allow memory allocation using the page file for controlled swapping. This is especially useful for managing huge memory blocks.
More...
#include <FileMapper.h>
|
static IFileMapper * | instantiate (bool native) |
| Gets an instance of this interface using a native or non-native (Qt) implementation.
|
|
Class wrapper around the Windows 32-bit file mapping functions which allow memory allocation using the page file for controlled swapping. This is especially useful for managing huge memory blocks.
◆ FileMapper() [1/2]
sf::win::FileMapper::FileMapper |
( |
| ) |
|
◆ ~FileMapper()
sf::win::FileMapper::~FileMapper |
( |
| ) |
|
|
override |
◆ FileMapper() [2/2]
sf::win::FileMapper::FileMapper |
( |
const FileMapper & |
| ) |
|
|
delete |
Deleted copy constructor to prevent copying.
◆ closeFile()
bool sf::win::FileMapper::closeFile |
( |
| ) |
|
Closes the opened file handle by 'createMapFile'.
- Returns
- True on success.
◆ closeMap()
bool sf::win::FileMapper::closeMap |
( |
| ) |
|
Closes the map handle created by calling CreateMap or OpenMap.
- Returns
◆ createMap()
bool sf::win::FileMapper::createMap |
( |
const char * |
map_name, |
|
|
size_t |
map_size, |
|
|
bool |
unique, |
|
|
bool |
readonly |
|
) |
| |
Called by a data server to create a named file map. When 'unique' is true there is no other map named as 'map_name' before calling this function.
- Parameters
-
map_name | |
map_size | |
unique | |
readonly | |
- Returns
◆ createMapFile()
bool sf::win::FileMapper::createMapFile |
( |
const char * |
filename | ) |
|
Makes this instance use the passed file
- Parameters
-
- Returns
- True on success.
◆ createView()
void sf::win::FileMapper::createView |
( |
size_t |
sz | ) |
|
|
overridevirtual |
◆ flushView()
bool sf::win::FileMapper::flushView |
( |
| ) |
|
Writes to the disk a byte range within a mapped view of the file.
- Returns
- True on success.
◆ getFileName()
std::string sf::win::FileMapper::getFileName |
( |
| ) |
const |
Returns the file name when 'CreateMapFile' was called.
- Returns
◆ getMapName()
std::string sf::win::FileMapper::getMapName |
( |
| ) |
const |
Returns the map name when 'CreateMap' was called.
- Returns
◆ getMapSize()
size_t sf::win::FileMapper::getMapSize |
( |
| ) |
const |
Returns the size of the map.
- Returns
◆ getPtr() [1/2]
const void * sf::win::FileMapper::getPtr |
( |
| ) |
const |
Returns a pointer to the data if MapView is called.
- Returns
- Const Pointer
◆ getPtr() [2/2]
void * sf::win::FileMapper::getPtr |
( |
| ) |
|
|
overridevirtual |
Returns a pointer to the data if MapView is called.
- Returns
- Pointer
Implements sf::IFileMapper.
◆ initialize()
void sf::win::FileMapper::initialize |
( |
| ) |
|
|
overridevirtual |
Makes this instance create a map that is backed by the systems page file.
- Returns
Implements sf::IFileMapper.
◆ isFileOpen()
bool sf::win::FileMapper::isFileOpen |
( |
| ) |
const |
Returns true if a map file is open. (pagefile or not.)
- Returns
- True when open.
◆ isMapOpen()
bool sf::win::FileMapper::isMapOpen |
( |
| ) |
const |
Returns true if the file map is open.
- Returns
- When open True.
◆ mapView()
bool sf::win::FileMapper::mapView |
( |
| ) |
|
|
overridevirtual |
Called by a server and client to gain access of the map.
- Returns
- True on success.
Implements sf::IFileMapper.
◆ openMap()
bool sf::win::FileMapper::openMap |
( |
const char * |
map_name, |
|
|
unsigned long |
map_size, |
|
|
bool |
readonly = true |
|
) |
| |
Called by a data client to open an existing a named file map. When 'readonly' is true this instance opens the map in readonly mode. Writing to the map has no effect.
- Parameters
-
map_name | |
map_size | |
readonly | |
- Returns
◆ operator=()
Deleted assignment operator to prevent copying.
- Returns
◆ unmapView()
bool sf::win::FileMapper::unmapView |
( |
| ) |
|
|
overridevirtual |
Called by a server and client to unaccess the map.
- Returns
- True on success.
Implements sf::IFileMapper.
The documentation for this class was generated from the following file: