53 return reinterpret_cast<T *
>(base);
58 explicit operator bool()
const {
return base !=
nullptr; }
Holds a reference to a mapped shared memory region and all the information used to create/open it....
Definition shm.h:31
static bool create(SharedMemoryInfo &info, size_t size, const char *name=nullptr, int numa_node=-1)
Creates a shared memory region accessible via handle.
SharedMemoryInfo & operator=(const SharedMemoryInfo &)=delete
OsHandle get_handle() const
Definition shm.h:55
SharedMemoryInfo(const SharedMemoryInfo &)=delete
std::string get_name() const
Definition shm.h:57
void unlink(void)
Removes the name from the shared memory region such that it can't be opened by it's name any more and...
T * get_ptr() const
Definition shm.h:51
SharedMemoryInfo & operator=(SharedMemoryInfo &&other)
size_t get_size() const
Definition shm.h:56
static bool open(SharedMemoryInfo &info, OsHandle handle, size_t size)
Opens a previously created shared memory region given it's associated handle and size.
~SharedMemoryInfo(void)
On destruction, the SharedMemoryInfo will unmap the memory associated with this shared region,...
static bool open(SharedMemoryInfo &info, const std::string &name, size_t size)
Opens a previously created shared memory region given it's name and size.
SharedMemoryInfo(SharedMemoryInfo &&other)
Definition activemsg.h:38
int OsHandle
Definition utils.h:399