Cbeam
|
Provides a unified, platform-independent interface for managing shared memory segments. More...
#include <interprocess_shared_memory.hpp>
Classes | |
class | lock_guard |
Public Member Functions | |
interprocess_shared_memory (const std::string &unique_identifier, std::size_t size) | |
Constructor that initializes the shared memory segment. | |
virtual | ~interprocess_shared_memory () noexcept |
void * | data () const |
Retrieves the starting address of the shared memory region. | |
size_t | capacity () const noexcept |
Returns the size of the shared memory region. | |
lock_guard | get_lock_guard () const |
Acquires a lock_guard for mutex synchronization. | |
interprocess_shared_memory (const interprocess_shared_memory &)=delete | |
interprocess_shared_memory & | operator= (const interprocess_shared_memory &)=delete |
interprocess_shared_memory (interprocess_shared_memory &&)=delete | |
interprocess_shared_memory & | operator= (interprocess_shared_memory &&)=delete |
Provides a unified, platform-independent interface for managing shared memory segments.
This class works similar to boost::interprocess::shared_memory_object with the difference that the shared memory is destroyed when the last processes that uses it exits. The design aligns with common use cases where persistent shared memory in kernel space is not a requirement. Furthermore, under Windows it uses native API, like boost::interprocess::windows_shared_memory does (avoiding file system permission problems under C:\ProgramData\boost_interprocess). Under Windows, the shared memory is only accessible from processes in the same user session.
|
inline |
Constructor that initializes the shared memory segment.
unique_identifier | A unique identifier for the shared memory segment. |
size | The initial size of the shared memory segment. |
|
inlinevirtualnoexcept |
|
delete |
|
delete |
|
inlinenoexcept |
Returns the size of the shared memory region.
|
inline |
Retrieves the starting address of the shared memory region.
W
|
inline |
Acquires a lock_guard for mutex synchronization.
|
delete |
|
delete |