AuroraRuntime/Source/IO/IOWaitableIOLoopSource.cpp
Reece Wilson 70418df761 [+] Added extended IO apis
> StartSimpleLSWatchEx
> StartSimpleIOWatchEx
> StartIOWatchEx
[*] Update README
2022-06-28 16:04:07 +01:00

88 lines
2.1 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IOWaitableIOLoopSource.cpp
Date: 2022-6-6
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include <Aurora/IO/IOExperimental.hpp>
#include "IOWaitableIOLoopSource.hpp"
namespace Aurora::IO
{
IOWatachableIOLoopSource::IOWatachableIOLoopSource(const AuSPtr<Loop::ILoopSource> &source) : source(source)
{
}
IOWatachableIOLoopSource::IOWatachableIOLoopSource(const AuSPtr<Loop::ILoopSource>& source, AuUInt32 ioTimeoutMS) : source(source), ioTimeoutMS(ioTimeoutMS)
{
}
bool IOWatachableIOLoopSource::IsRunOnOtherTick()
{
return {};
}
bool IOWatachableIOLoopSource::IsRunOnTick()
{
return {};
}
bool IOWatachableIOLoopSource::CanRequestTick()
{
return {};
}
void IOWatachableIOLoopSource::OnReportPumper(const AuSPtr<IIOProcessorManualInvoker> &iface)
{
}
bool IOWatachableIOLoopSource::IsRunOnSelfIO()
{
return true;
}
AuSPtr<Loop::ILoopSource> IOWatachableIOLoopSource::GetSelfIOSource()
{
return GetLoopSource();
}
bool IOWatachableIOLoopSource::ApplyRateLimit()
{
return {};
}
AuSPtr<Loop::ILoopSource> IOWatachableIOLoopSource::GetLoopSource()
{
return this->source;
}
AuSPtr<Loop::ILoopSource> IOWatachableIOLoopSource::SetLoopSource(const AuSPtr<Loop::ILoopSource> &ls)
{
return AuExchange(this->source, ls);
}
bool IOWatachableIOLoopSource::IsRunOnSelfIOCheckedOnTimerTick()
{
return true;
}
AuUInt32 IOWatachableIOLoopSource::IOTimeoutInMS()
{
return this->ioTimeoutMS;
}
AUKN_SYM AuSPtr<IIOWatachableIOLoopSource> NewWaitableLoopSource(const AuSPtr<Loop::ILoopSource>& ptr)
{
return AuMakeShared<IOWatachableIOLoopSource>(ptr);
}
AUKN_SYM AuSPtr<IIOWatachableIOLoopSource> NewWaitableLoopSourceEx(const AuSPtr<Loop::ILoopSource>& ptr, AuUInt32 msTimeout)
{
return AuMakeShared<IOWatachableIOLoopSource>(ptr, msTimeout);
}
}