libjmmcg
release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
|
A class to wrap POSIX (inter-process) shared-memory. More...
#include <shared_mem.hpp>
Public Types | |
enum | oflags_t : int { oflags_read_only =O_RDONLY , oflags_read_write =O_RDWR , oflags_create_if_not_exists =O_CREAT , oflags_exclusive_or_error =O_EXCL , oflags_truncate_if_exists =O_TRUNC } |
enum | flags_t : int { flags_use_hugetlb =MAP_HUGETLB } |
enum | mode_type : mode_t { mode_rwxrwxrwx =ACCESSPERMS , mode_srwxrwxrwx =ALLPERMS , mode_rwrwrw =DEFFILEMODE } |
enum | protection_type : int { protection_read_only =PROT_READ , protection_read_write =PROT_READ|PROT_WRITE , protection_read_write_execte =PROT_READ|PROT_WRITE|PROT_EXEC } |
enum | sync_flags_t : int { schedule_updates_return_immed =MS_ASYNC , req_update_wait =MS_SYNC } |
using | exception_type = crt_exception< ppd::platform_api, ppd::heavyweight_threading > |
using | handle_t = int |
using | oflags_type = std::underlying_type< oflags_t >::type |
Public Member Functions | |
shared_mem (std::string const &name, std::size_t length, oflags_type oflags=oflags_create_if_not_exists|oflags_read_write, mode_type mode=mode_rwrwrw, protection_type prot=protection_read_write) noexcept(false) | |
~shared_mem () noexcept(true) | |
template<class T > | |
T * | get () noexcept(false) |
template<class T > | |
T const * | get () const noexcept(false) |
void | sync (void *addr, std::size_t length, sync_flags_t sync_flags=schedule_updates_return_immed) noexcept(false) |
template<class T > | |
void | sync (T *addr, sync_flags_t sync_flags=schedule_updates_return_immed) noexcept(false) |
A class to wrap POSIX (inter-process) shared-memory.
Definition at line 30 of file shared_mem.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::shared_mem::exception_type = crt_exception<ppd::platform_api, ppd::heavyweight_threading> |
Definition at line 32 of file shared_mem.hpp.
Definition at line 33 of file shared_mem.hpp.
using jmmcg::LIBJMMCG_VER_NAMESPACE::shared_mem::oflags_type = std::underlying_type<oflags_t>::type |
Definition at line 42 of file shared_mem.hpp.
Enumerator | |
---|---|
flags_use_hugetlb | Requires kernel support and configuration. |
Definition at line 43 of file shared_mem.hpp.
enum jmmcg::LIBJMMCG_VER_NAMESPACE::shared_mem::mode_type : mode_t |
Enumerator | |
---|---|
mode_rwxrwxrwx | |
mode_srwxrwxrwx | |
mode_rwrwrw |
Definition at line 50 of file shared_mem.hpp.
Enumerator | |
---|---|
oflags_read_only | |
oflags_read_write | |
oflags_create_if_not_exists | |
oflags_exclusive_or_error | |
oflags_truncate_if_exists |
Definition at line 35 of file shared_mem.hpp.
Enumerator | |
---|---|
protection_read_only | |
protection_read_write | |
protection_read_write_execte |
Definition at line 55 of file shared_mem.hpp.
Enumerator | |
---|---|
schedule_updates_return_immed | |
req_update_wait |
Definition at line 60 of file shared_mem.hpp.
|
noexcept |
|
noexcept |
Definition at line 64 of file shared_mem.cpp.
|
inlinenoexcept |
Definition at line 105 of file shared_mem.hpp.
|
inlinenoexcept |
Definition at line 93 of file shared_mem.hpp.
|
inlinenoexcept |
Definition at line 117 of file shared_mem.hpp.
|
noexcept |
Definition at line 78 of file shared_mem.cpp.