AuroraRuntime/Source/IO/IPC/IPC.hpp

110 lines
5.9 KiB
C++
Raw Normal View History

/***
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
{
2022-04-16 18:26:01 +00:00
#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(); \
2022-04-16 18:26:01 +00:00
} \
bool HasValidHandle() \
{ \
return Base HasValidHandle(); \
}
2022-04-16 18:26:01 +00:00
#else
#define PROXY_INTERNAL_INTERFACE_(Base)\
inline virtual void OnPresleep() override \
2022-04-16 18:26:01 +00:00
{ \
Base OnPresleep(); \
}; \
inline virtual bool OnTrigger(AuUInt handle) override \
2022-04-16 18:26:01 +00:00
{ \
return Base OnTrigger(handle); \
} \
inline virtual void OnFinishSleep() override \
2022-04-16 18:26:01 +00:00
{ \
Base OnFinishSleep(); \
} \
inline virtual bool Singular() override \
2022-04-16 18:26:01 +00:00
{ \
return Base Singular(); \
} \
inline virtual AuUInt GetHandle() override \
2022-04-16 18:26:01 +00:00
{ \
return Base GetHandle(); \
} \
inline virtual const AuList<AuUInt> &GetHandles() override \
2022-04-16 18:26:01 +00:00
{ \
return Base GetHandles(); \
} \
inline bool HasValidHandle() \
2022-04-16 18:26:01 +00:00
{ \
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.)
}