AuroraRuntime/Source/IO/IPC/AuIPCMemory.Unix.hpp
J Reece Wilson 766be57a46 [+] Linux build [again]
[+] ProcessSectionViewReserved.Unix.cpp
[*] Fix missing ::Flush() member on ViewWriter
2022-12-16 00:41:01 +00:00

38 lines
973 B
C++

/***
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 <Source/IO/IPC/IPC.hpp>
#include <Source/IO/IPC/AuIPCHandle.hpp>
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<IPCSharedMemory> ImportSharedMemoryEx(const IPCToken &token);
}