6 #ifndef SHAREDMEMORY_HPP_INCLUDE
7 #define SHAREDMEMORY_HPP_INCLUDE
35 virtual std::string
key(
void)
const = 0;
39 virtual size_t size(
void)
const = 0;
52 static std::unique_ptr<SharedMemory> make_unique_owner(
const std::string &shm_key,
size_t size);
56 static std::unique_ptr<SharedMemory> make_unique_owner_secure(
const std::string &shm_key,
size_t size);
62 static std::unique_ptr<SharedMemory> make_unique_user(
const std::string &shm_key,
unsigned int timeout);
65 virtual void chown(
const unsigned int uid,
const unsigned int gid)
const = 0;
66 static void cleanup_shmem(
void);
This class encapsulates an inter-process shared memory region.
Definition: SharedMemory.hpp:22
virtual void * pointer(void) const =0
Retrieve a pointer to the shared memory region.
virtual std::string key(void) const =0
Retrieve the key to the shared memory region.
virtual size_t size(void) const =0
Retrieve the size of the shared memory region.
SharedMemory & operator=(const SharedMemory &other)=default
SharedMemory(const SharedMemory &other)=default
virtual void chown(const unsigned int uid, const unsigned int gid) const =0
Modifies the shared memory to be owned by the specified gid.
virtual ~SharedMemory()=default
virtual void unlink(void)=0
Unlink the shared memory region.
virtual std::unique_ptr< SharedMemoryScopedLock > get_scoped_lock(void)=0
Attempt to lock the mutex for the shared memory region and return a scoped mutex object that will unl...
#define GEOPM_PUBLIC
Definition: geopm_public.h:10