#include <CeresEngine/Foundation/SharedMemory.hpp>
◆ ConstPointer
A type that represents a pointer in the memory mapped file.
◆ ConstReference
A type that represents a reference in the memory mapped file.
◆ NativeHandle
A type that represents the native shared memory handle.
◆ Pointer
A type that represents a pointer in the memory mapped file.
◆ Reference
A type that represents a reference in the memory mapped file.
◆ SizeType
A type that represents the mapping length and offsets.
◆ AccessMode
This is used to determine whether to create a read-only or a read-write memory mapping.
◆ SharedMemory() [1/5]
| CeresEngine::SharedMemory::SharedMemory |
( |
| ) |
|
◆ SharedMemory() [2/5]
Creates a new SharedMemory by mapping the file given path.
- Parameters
-
| path | The file path |
| mode | The mapping mode to be used |
◆ SharedMemory() [3/5]
Creates a new SharedMemory by mapping the file given path.
- Parameters
-
| path | The file path |
| size | The mapped file initial size |
| mode | The mapping mode to be used |
◆ SharedMemory() [4/5]
◆ SharedMemory() [5/5]
| CeresEngine::SharedMemory::SharedMemory |
( |
SharedMemory && |
other | ) |
|
|
noexcept |
Creates a new SharedMemory by moving the contents of another.
- Parameters
-
| other | The instance to move from |
◆ ~SharedMemory()
| CeresEngine::SharedMemory::~SharedMemory |
( |
| ) |
|
|
noexcept |
Unloads the mapped file (if loaded) and destroy the SharedMemory object.
◆ at() [1/2]
- Parameters
-
- Returns
- A reference to the first element
◆ at() [2/2]
- Parameters
-
- Returns
- A reference to the first element
◆ back() [1/2]
- Returns
- A reference to the last element
◆ back() [2/2]
| Reference CeresEngine::SharedMemory::back |
( |
| ) |
|
|
inlinenoexcept |
- Returns
- A reference to the last element
◆ begin() [1/2]
- Returns
- A pointer to the beginning of the file data
◆ begin() [2/2]
| Pointer CeresEngine::SharedMemory::begin |
( |
| ) |
|
|
inlinenoexcept |
- Returns
- A pointer to the beginning of the file data
◆ capacity()
| size_t CeresEngine::SharedMemory::capacity |
( |
| ) |
const |
|
noexcept |
- Returns
- The number of elements in the mapped file.
◆ cbegin()
- Returns
- A pointer to the beginning of the file data
◆ cend()
- Returns
- A pointer to the past the end of the file data
◆ data() [1/2]
- Returns
- A pointer to the beginning of the file data
◆ data() [2/2]
| Pointer CeresEngine::SharedMemory::data |
( |
| ) |
|
|
noexcept |
- Returns
- A pointer to the beginning of the file data
◆ empty()
| bool CeresEngine::SharedMemory::empty |
( |
| ) |
const |
|
noexcept |
- Returns
- Checks if the container has no elements
◆ end() [1/2]
- Returns
- A pointer to the past the end of the file data
◆ end() [2/2]
| Pointer CeresEngine::SharedMemory::end |
( |
| ) |
|
|
inlinenoexcept |
- Returns
- A pointer to the past the end of the file data
◆ front() [1/2]
- Returns
- A reference to the first element
◆ front() [2/2]
| Reference CeresEngine::SharedMemory::front |
( |
| ) |
|
|
inlinenoexcept |
- Returns
- A reference to the first element
◆ map()
Maps the file into memory.
◆ operator bool()
| CeresEngine::SharedMemory::operator bool |
( |
| ) |
const |
|
explicitnoexcept |
- Returns
true if the SharedMemory is valid and points to a mapped file.
◆ operator=() [1/2]
◆ operator=() [2/2]
Assigns the SharedMemory by moving the contents of another.
- Parameters
-
| other | The instance to move from |
- Returns
*this
◆ operator[]() [1/2]
- Parameters
-
| offset | The amount of bytes to offset from the beginning. |
- Returns
- A pointer to the data of the mapped file offsetted by
offset.
◆ operator[]() [2/2]
- Parameters
-
| offset | The amount of bytes to offset from the beginning. |
- Returns
- A pointer to the data of the mapped file offsetted by
offset.
◆ reset()
| void CeresEngine::SharedMemory::reset |
( |
| ) |
|
Closes any handle and unmaps all memory.
◆ resize()
Resizes the array to fit at least newSize elements.
- Parameters
-
| newSize | The number of elements in the array. |
◆ size()
| size_t CeresEngine::SharedMemory::size |
( |
| ) |
const |
|
noexcept |
- Returns
- The number of elements in the mapped file.
◆ sync()
| void CeresEngine::SharedMemory::sync |
( |
| ) |
|
Synchronizes any dirty data not synchronized with the file.
◆ unmap()
| void CeresEngine::SharedMemory::unmap |
( |
| ) |
|
|
private |
Unmaps the file into memory.
◆ valid()
| bool CeresEngine::SharedMemory::valid |
( |
| ) |
const |
|
noexcept |
- Returns
true if the SharedMemory is valid and points to a mapped file.
◆ mAddress
The base address to the mapped memory.
◆ mHandle
The native handle used to manage the shared memory.
◆ mLength
| SizeType CeresEngine::SharedMemory::mLength = 0 |
|
private |
◆ mMode
The mode the file was mapped with.
◆ mPath
| FilePath CeresEngine::SharedMemory::mPath |
|
private |
The path of the memory mapped file.
The documentation for this class was generated from the following file:
- /Users/Rogiel/Developer/CeresEngine/Engine/Sources/CeresEngine/Foundation/SharedMemory.hpp