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