AuroraRuntime/Source/IO/Loop/LSEvent.Linux.hpp

36 lines
979 B
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: LSEvent.Linux.hpp
Date: 2022-4-4
Author: Reece
***/
#pragma once
#include "LSHandle.hpp"
namespace Aurora::IO::Loop
{
struct LSEvent : ILSEvent, virtual LSHandle
{
LSEvent();
LSEvent(bool triggered, bool atomicRelease, bool permitMultipleTriggers);
LSEvent(int handle, bool triggered, bool atomicRelease);
~LSEvent();
bool Set() override;
bool Reset() override;
bool TryInit(bool bTriggered, bool bAtomicRelease, bool bPermitMultipleTriggers);
virtual bool OnTrigger(AuUInt handle) override;
virtual bool IsSignaled() override;
virtual bool WaitOn(AuUInt32 timeout) override;
virtual ELoopSource GetType() override;
private:
void Init(bool init);
bool IsSignaledNonblocking();
bool atomicRelease_;
};
}