6 #ifndef SHAREDMEMORYIMP_HPP_INCLUDE
7 #define SHAREDMEMORYIMP_HPP_INCLUDE
23 void *
pointer(
void)
const override;
26 std::string
key(
void)
const override;
27 size_t size(
void)
const override;
28 void unlink(
void)
override;
48 void chown(
const unsigned int uid,
const unsigned int gid)
const override;
54 std::string m_shm_key;
56 std::string m_shm_path;
67 bool m_do_unlink_check;
This class encapsulates an inter-process shared memory region.
Definition: SharedMemory.hpp:22
Definition: SharedMemoryImp.hpp:14
SharedMemoryImp(SharedMemoryImp &other)=delete
void * pointer(void) const override
Retrieve a pointer to the shared memory region.
Definition: SharedMemory.cpp:191
size_t size(void) const override
Retrieve the size of the shared memory region.
Definition: SharedMemory.cpp:201
SharedMemoryImp()
Definition: SharedMemory.cpp:101
static std::string construct_shm_path(const std::string &key)
Construct the file path to use for the provided key.
Definition: SharedMemory.cpp:328
std::unique_ptr< SharedMemoryScopedLock > get_scoped_lock(void) override
Attempt to lock the mutex for the shared memory region and return a scoped mutex object that will unl...
Definition: SharedMemory.cpp:206
void unlink(void) override
Unlink the shared memory region.
Definition: SharedMemory.cpp:176
void chown(const unsigned int uid, const unsigned int gid) const override
Modifies the shared memory to be owned by the specified gid.
Definition: SharedMemory.cpp:296
SharedMemoryImp & operator=(const SharedMemoryImp &other)=delete
void create_memory_region(const std::string &shm_key, size_t size, bool is_secure)
Takes a key and a size and creates an inter-process shared memory region.
Definition: SharedMemory.cpp:110
virtual ~SharedMemoryImp()
Destructor destroys and unlinks the shared memory region.
Definition: SharedMemory.cpp:165
std::string key(void) const override
Retrieve the key to the shared memory region.
Definition: SharedMemory.cpp:196
void attach_memory_region(const std::string &shm_key, unsigned int timeout)
Takes a key and attempts to attach to a inter-process shared memory region. This version of the const...
Definition: SharedMemory.cpp:211