45 lines
889 B
C++
45 lines
889 B
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: LSAsync.cpp
|
|
Date: 2021-10-3
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "LSAsync.hpp"
|
|
#include "LSEvent.hpp"
|
|
|
|
namespace Aurora::Loop
|
|
{
|
|
class AsyncWaiter : public LSEvent
|
|
{
|
|
public:
|
|
AsyncWaiter() : LSEvent(false, false, true)
|
|
{}
|
|
|
|
bool IsSignaled() override;
|
|
ELoopSource GetType() override;
|
|
};
|
|
|
|
bool AsyncWaiter::IsSignaled()
|
|
{
|
|
return LSEvent::IsSignaled();
|
|
}
|
|
|
|
ELoopSource AsyncWaiter::GetType()
|
|
{
|
|
return ELoopSource::eSourceAsync;
|
|
}
|
|
|
|
AuSPtr<ILSEvent> NewLSAsync()
|
|
{
|
|
AuSPtr<ILSEvent> ret;
|
|
|
|
if (!(ret = AuStaticCast<LSEvent>(AuMakeShared<AsyncWaiter>())))
|
|
{
|
|
return {};
|
|
}
|
|
|
|
return AuStaticCast<ILSEvent>(ret);
|
|
}
|
|
} |