Jamie Reece Wilson
4ce49941ff
[+] SysCheckNotNull [+] SysCheckRetExpNotNull [+] SysCheckRetExpNotNullMemory
90 lines
2.2 KiB
C++
90 lines
2.2 KiB
C++
/***
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: AuIOWaitableIOLoopSource.cpp
|
|
Date: 2022-6-6
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include <Aurora/IO/IOExperimental.hpp>
|
|
#include "AuIOWaitableIOLoopSource.hpp"
|
|
|
|
namespace Aurora::IO
|
|
{
|
|
IOWatachableIOLoopSource::IOWatachableIOLoopSource(const AuSPtr<Loop::ILoopSource> &pSource) :
|
|
pSource(pSource)
|
|
{
|
|
|
|
}
|
|
|
|
IOWatachableIOLoopSource::IOWatachableIOLoopSource(const AuSPtr<Loop::ILoopSource>&pSource, AuUInt32 dwIoTimeoutMS) :
|
|
pSource(pSource), dwIoTimeoutMS(dwIoTimeoutMS)
|
|
{
|
|
|
|
}
|
|
|
|
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->pSource;
|
|
}
|
|
|
|
AuSPtr<Loop::ILoopSource> IOWatachableIOLoopSource::SetLoopSource(const AuSPtr<Loop::ILoopSource> &pSource)
|
|
{
|
|
return AuExchange(this->pSource, pSource);
|
|
}
|
|
|
|
bool IOWatachableIOLoopSource::IsRunOnSelfIOCheckedOnTimerTick()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
AuUInt32 IOWatachableIOLoopSource::IOTimeoutInMS()
|
|
{
|
|
return this->dwIoTimeoutMS;
|
|
}
|
|
|
|
AUKN_SYM AuSPtr<IIOWatachableIOLoopSource> NewWaitableLoopSource(const AuSPtr<Loop::ILoopSource>&pSource)
|
|
{
|
|
SysCheckRetExpNotNullMemory(AuMakeShared<IOWatachableIOLoopSource>(pSource), {});
|
|
}
|
|
|
|
AUKN_SYM AuSPtr<IIOWatachableIOLoopSource> NewWaitableLoopSourceEx(const AuSPtr<Loop::ILoopSource>&pSource, AuUInt32 dwIoTimeoutMS)
|
|
{
|
|
SysCheckRetExpNotNullMemory(AuMakeShared<IOWatachableIOLoopSource>(pSource, dwIoTimeoutMS), {});
|
|
}
|
|
} |