huge_pages = SHM_HUGETLBhuge_2mb = SHM_HUGE_2MBhuge_1gb = SHM_HUGE_1GBno_reserve = SHM_NORESERVE
A wrapper for shmid_ds system structure.
public shmid_dsusing size_type = std::size_tSize type. Alias to std::size_t.
using num_attaches_type = ::shmatt_tReturn type of num_attaches.
using tp_type = clock_type::time_pointReturn type of last_attach.
using clock_type = std::chrono::system_clockClock type used in this class.
num_attaches() const -> num_attaches_typeThe current number of attaches.
last_change() const -> tp_typeLast change time.
last_detach() const -> tp_typeLast detach time.
last_attach() const -> tp_typeLast attach time.
last_user() const -> pid_typeThe last process that accessed this segment.
creator() const -> pid_typeThe process that created this segment.
segment_size() const -> size_typeSize of shared memory segment in bytes.
shared_memory_segment_status(shm_type id)explicit
Get status for shared memory segment with ID id.
A container that stores its elements in shared memory.
using iterator = T *Container iterator type.
using value_type = TContainer element type.
using addr_type = void *Raw pointer type.
using size_type = std::size_tSize type. Alias to std::size_t.
close() -> voidDetach and remove (if owner) shared memory segment.
open_as_owner(mode_type mode, size_type size) -> voidCreate and attach shared memory segment.
open_as_user(shm_type id) -> voidAttach shared memory segment.
operator!=(const shared_memory_segment & rhs) const -> boolCompare shared memory segments element-wise. ID is not important.
operator==(const shared_memory_segment & rhs) const -> boolCompare shared memory segments element-wise. ID is not important.
operator!() const -> boolChecks if the segement is attached.
operator bool() constexplicitChecks if the segement is attached.
id() const -> shm_typeGet segment ID.
end() const -> const_iteratorReturns iterator to the end of the container.
begin() const -> const_iteratorReturns iterator to the beginning of the container.
end() -> iteratorReturns iterator to the end of the container.
begin() -> iteratorReturns iterator to the beginning of the container.
owner() const -> boolCheck if the segment is owned by this process.
size_in_bytes() const -> size_typeGet the size of shared memory segment in bytes.
size() const -> size_typeGet the number of elements in the container.
ptr() const -> addr_typeGet raw pointer to the contents of shared memory segment.
ptr() -> addr_typeGet raw pointer to the contents of shared memory segment.
swap(shared_memory_segment & rhs) -> void
Swap with rhs.
operator=(shared_memory_segment && rhs) -> shared_memory_segment &Move-assigment.
operator=(const shared_memory_segment &) -> shared_memory_segment &~shared_memory_segment()Terminates on system error.
shared_memory_segment(const shared_memory_segment &)shared_memory_segment()shared_memory_segment(shared_memory_segment && rhs)Move-constructor.
shared_memory_segment(shm_type shm)explicit
Attach shared memory segment with id shm.
shared_memory_segment(mode_type mode, size_type guaranteed_size)
Create and attach shared memory segment with mode mode and minimum size guaranteed_size.
template <class T> swap(shared_memory_segment< T > & lhs, shared_memory_segment< T > & rhs) -> voidOverload of std::swap for shared_memory_segment.