/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: IPCMemory.Unix.hpp Date: 2022-4-14 Author: Reece ***/ #pragma once #include #include namespace Aurora::IO::IPC { struct IPCSharedMemoryImpl : IPCSharedMemory { IPCSharedMemoryImpl(int fd, void *ptr, const IPC::IPCHandle &handle, bool owns); ~IPCSharedMemoryImpl(); virtual Memory::MemoryViewWrite GetMemory() override; virtual AuUInt GetLength() override; virtual AuString ExportToString() override; IPC::IPCHandle handle_; private: bool owns_; int fd_{}; void *base_{}; AuUInt len_ {}; }; AuString GetServerPath(const IPC::IPCToken &handle); AuSPtr ImportSharedMemoryEx(const IPCToken &token); }