11#include <promeki/config.h>
12#if PROMEKI_ENABLE_CORE
19PROMEKI_NAMESPACE_BEGIN
83 static constexpr uint32_t DefaultPermissions = 0600;
95 static bool isSupported();
115 static Error unlink(
const String &name);
123 SharedMemory(
const SharedMemory &) =
delete;
124 SharedMemory &operator=(
const SharedMemory &) =
delete;
127 SharedMemory(SharedMemory &&other)
noexcept;
130 SharedMemory &operator=(SharedMemory &&other)
noexcept;
149 Error create(
const String &name,
size_t size, uint32_t mode = DefaultPermissions,
150 const String &groupName = String());
163 Error open(
const String &name, Access access = ReadOnly);
173 bool isValid()
const {
return _data !=
nullptr; }
176 bool isOwner()
const {
return _owner; }
179 void *data() {
return _data; }
182 const void *data()
const {
return _data; }
185 size_t size()
const {
return _size; }
188 const String &name()
const {
return _name; }
191 Access access()
const {
return _access; }
195 void *_data =
nullptr;
197 intptr_t _handle = -1;
199 Access _access = ReadOnly;