AuroraRuntime/Source/IO/IPC/IPC.hpp
J Reece Wilson 4d4f5e2501 [+] ILoopSource::IsSignaledExt(...)
[+] ILoopSource::WaitOnExt(...)
[+] ILoopSource::WaitOnAbsExt(...)
2024-09-07 22:45:34 +01:00

110 lines
5.9 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IPC.hpp
Date: 2022-4-13
Author: Reece
***/
#pragma once
namespace Aurora::IO::IPC
{
#if defined(AURORA_IS_POSIX_DERIVED)
#define PROXY_INTERNAL_INTERFACE_(Base)\
virtual void OnPresleep() override \
{ \
Base OnPresleep(); \
}; \
virtual bool OnTrigger(AuUInt handle) override \
{ \
return Base OnTrigger(handle); \
} \
virtual void OnFinishSleep() override \
{ \
Base OnFinishSleep(); \
} \
virtual bool Singular() override \
{ \
return Base Singular(); \
} \
virtual AuUInt GetHandle() override \
{ \
return Base GetHandle(); \
} \
virtual const AuList<AuUInt> &GetHandles() override \
{ \
return Base GetHandles(); \
} \
virtual const AuList<AuUInt> &GetWriteHandles() override \
{ \
return Base GetWriteHandles(); \
} \
virtual AuUInt GetWriteHandle() override \
{ \
return Base GetWriteHandle(); \
} \
bool HasValidHandle() \
{ \
return Base HasValidHandle(); \
}
#else
#define PROXY_INTERNAL_INTERFACE_(Base)\
inline virtual void OnPresleep() override \
{ \
Base OnPresleep(); \
}; \
inline virtual bool OnTrigger(AuUInt handle) override \
{ \
return Base OnTrigger(handle); \
} \
inline virtual void OnFinishSleep() override \
{ \
Base OnFinishSleep(); \
} \
inline virtual bool Singular() override \
{ \
return Base Singular(); \
} \
inline virtual AuUInt GetHandle() override \
{ \
return Base GetHandle(); \
} \
inline virtual const AuList<AuUInt> &GetHandles() override \
{ \
return Base GetHandles(); \
} \
inline bool HasValidHandle() \
{ \
return Base HasValidHandle(); \
}
#endif
// TODO: 2024/09 (this doesnt belong here but im lazy and no primitive actually needs these overloads)
// (fill the entire interface and drop the _IM_SO_LAZY part)
#define PROXY_LOOPSOURCE_EXT_APIS_(Base) \
inline virtual bool IsSignaledExt(AuUInt8 uFlags) override \
{ \
return Base IsSignaledExt(uFlags); \
} \
inline virtual bool WaitOnExt(AuUInt8 uFlags, AuUInt32 timeout) override \
{ \
return Base WaitOnExt(uFlags, timeout); \
} \
inline virtual bool WaitOnAbs(AuUInt64 uTimeoutAbs) override \
{ \
return Base WaitOnAbs(uTimeoutAbs); \
} \
inline virtual bool WaitOnAbsExt(AuUInt8 uFlags, AuUInt64 uTimeoutAbs) override \
{ \
return Base WaitOnAbsExt(uFlags, uTimeoutAbs); \
}
#define PROXY_INTERNAL_INTERFACE(Base) PROXY_INTERNAL_INTERFACE_(Base.)
#define PROXY_LOOPSOURCE_EXT_APIS(Base) PROXY_LOOPSOURCE_EXT_APIS_(Base.)
}