|
join 1.0
lightweight network framework library
|
posix shared memory provider. More...
#include <memory.hpp>
Public Types | |
| template<size_t Count, size_t... Sizes> | |
| using | Allocator = BasicArena<ShmMem, Count, Sizes...> |
| using | Spsc = SyncBinding<ShmMem, ::join::Spsc> |
| using | Mpsc = SyncBinding<ShmMem, ::join::Mpsc> |
| using | Mpmc = SyncBinding<ShmMem, ::join::Mpmc> |
Public Member Functions | |
| ShmMem (uint64_t size, const std::string &name) | |
| creates or opens a named shared memory segment. | |
| ShmMem (const ShmMem &other)=delete | |
| copy constructor. | |
| ShmMem & | operator= (const ShmMem &other)=delete |
| copy assignment operator. | |
| ShmMem (ShmMem &&other) noexcept | |
| move constructor. | |
| ShmMem & | operator= (ShmMem &&other) noexcept |
| move assignment operator. | |
| ~ShmMem () noexcept | |
| unmaps the memory and closes the file descriptor. | |
| const void * | get (uint64_t offset=0) const |
| get a const pointer to the shared memory at a given offset. | |
| void * | get (uint64_t offset=0) |
| get a pointer to the shared memory at a given offset. | |
| int | mbind (int numa) const noexcept |
| bind memory to a NUMA node. | |
| int | mlock () const noexcept |
| lock memory in RAM. | |
Static Public Member Functions | |
| static int | unlink (const std::string &name) noexcept |
| destroy synchronization primitives and unlink the shared memory segment. | |
posix shared memory provider.
| using join::ShmMem::Allocator = BasicArena<ShmMem, Count, Sizes...> |
| using join::ShmMem::Mpmc = SyncBinding<ShmMem, ::join::Mpmc> |
| using join::ShmMem::Mpsc = SyncBinding<ShmMem, ::join::Mpsc> |
| using join::ShmMem::Spsc = SyncBinding<ShmMem, ::join::Spsc> |
|
inlineexplicit |
creates or opens a named shared memory segment.
| size | shared memory size in bytes. |
| name | shared memory unique name. |
| std::system_error | if mmap fails. |
|
delete |
copy constructor.
| other | other object to copy. |
|
inlinenoexcept |
move constructor.
| other | other object to move. |
|
inlinenoexcept |
unmaps the memory and closes the file descriptor.
|
inline |
get a pointer to the shared memory at a given offset.
| offset | byte offset from the start of the shared memory. |
| std::runtime_error | if memory is not mapped. |
| std::out_of_range | if offset is out of bounds. |
|
inline |
get a const pointer to the shared memory at a given offset.
| offset | byte offset from the start of the shared memory. |
| std::runtime_error | if memory is not mapped. |
| std::out_of_range | if offset is out of bounds. |
|
inlinenoexcept |
bind memory to a NUMA node.
| numa | NUMA node ID. |
|
inlinenoexcept |
lock memory in RAM.
copy assignment operator.
| other | other object to copy. |
move assignment operator.
| other | other object to move. |
|
inlinestaticnoexcept |
destroy synchronization primitives and unlink the shared memory segment.
| name | shared memory segment name. |