Cross-platform zero-copy shared memory region wrapper. Manages OS-level shared memory allocation, memory mapping, and cleanup.
More...
#include <SharedMemory.hpp>
|
| static void | unlink (const std::string &name) noexcept |
| | Remove shared memory identifier from OS namespace (POSIX shm_unlink).
|
| |
Cross-platform zero-copy shared memory region wrapper. Manages OS-level shared memory allocation, memory mapping, and cleanup.
◆ AccessMode
| Enumerator |
|---|
| CreateOrOpen | |
| OpenReadOnly | |
| OpenReadWrite | |
◆ SharedMemory() [1/3]
| corium::ipc::SharedMemory::SharedMemory |
( |
| ) |
|
|
defaultnoexcept |
◆ ~SharedMemory()
| corium::ipc::SharedMemory::~SharedMemory |
( |
| ) |
|
|
inline |
◆ SharedMemory() [2/3]
| corium::ipc::SharedMemory::SharedMemory |
( |
const SharedMemory & |
| ) |
|
|
delete |
◆ SharedMemory() [3/3]
| corium::ipc::SharedMemory::SharedMemory |
( |
SharedMemory && |
other | ) |
|
|
inlinenoexcept |
◆ close()
| void corium::ipc::SharedMemory::close |
( |
| ) |
|
|
inlinenoexcept |
Close and unmap the shared memory segment.
◆ data() [1/2]
| const void * corium::ipc::SharedMemory::data |
( |
| ) |
const |
|
inlinenoexcept |
◆ data() [2/2]
| void * corium::ipc::SharedMemory::data |
( |
| ) |
|
|
inlinenoexcept |
Raw pointer to mapped shared memory buffer.
◆ isCreator()
| bool corium::ipc::SharedMemory::isCreator |
( |
| ) |
const |
|
inlinenoexcept |
Check if this process created the memory segment (useful for initialization).
◆ isValid()
| bool corium::ipc::SharedMemory::isValid |
( |
| ) |
const |
|
inlinenoexcept |
Check if mapped region is valid.
◆ name()
| const std::string & corium::ipc::SharedMemory::name |
( |
| ) |
const |
|
inlinenoexcept |
Name identifier of shared memory.
◆ open()
Create or attach to a shared memory region.
- Parameters
-
| name | Unique system identifier (e.g., "/corium_telemetry_shm"). |
| size | Required memory segment capacity in bytes. |
| mode | Allocation/Access mode. |
- Returns
- true on success, false otherwise.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ size()
| std::size_t corium::ipc::SharedMemory::size |
( |
| ) |
const |
|
inlinenoexcept |
Size of mapped shared memory buffer.
◆ unlink()
| static void corium::ipc::SharedMemory::unlink |
( |
const std::string & |
name | ) |
|
|
inlinestaticnoexcept |
Remove shared memory identifier from OS namespace (POSIX shm_unlink).
The documentation for this class was generated from the following file: