51 lines
1.1 KiB
C++
51 lines
1.1 KiB
C++
/***
|
|
Copyright (C) 2021 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
File: Loop.cpp
|
|
Date: 2021-9-21
|
|
Author: Reece
|
|
***/
|
|
#include <Source/RuntimeInternal.hpp>
|
|
#include "Loop.hpp"
|
|
|
|
namespace Aurora::IO::Loop
|
|
{
|
|
#if !defined(AURORA_IS_MODERNNT_DERIVED)
|
|
AUKN_SYM AuSPtr<ILoopSource> NewLSWin32Source(bool)
|
|
{
|
|
return {};
|
|
}
|
|
#endif
|
|
|
|
#if !defined(AURORA_IS_XNU_DERIVED)
|
|
AUKN_SYM AuSPtr<ILoopSource> NewLSAppleSource()
|
|
{
|
|
return {};
|
|
}
|
|
#endif
|
|
|
|
AUKN_SYM AuSPtr<ILoopSource> NewLSFile(const AuSPtr<AuIO::IAsyncTransaction> &fileTransaction)
|
|
{
|
|
if (!fileTransaction)
|
|
{
|
|
SysPushErrorArg();
|
|
return {};
|
|
}
|
|
return fileTransaction->NewLoopSource();
|
|
}
|
|
|
|
AUKN_SYM AuSPtr<ILoopSource> NewStdIn()
|
|
{
|
|
return AuConsole::StdInBufferLoopSource();
|
|
}
|
|
|
|
AUKN_SYM AuSPtr<ILoopSource> NewLSAsync(Async::WorkerPId_t workerPid)
|
|
{
|
|
if (!workerPid.pool)
|
|
{
|
|
return Async::GetAsyncApp()->WorkerToLoopSource(workerPid);
|
|
}
|
|
|
|
return workerPid.pool->WorkerToLoopSource(workerPid);
|
|
}
|
|
} |