[+] IAsyncTransaction::HasCompleted

This commit is contained in:
Reece Wilson 2023-08-09 00:14:36 +01:00
parent df6f29bf38
commit 424cccd00a
9 changed files with 41 additions and 3 deletions

View File

@ -37,6 +37,12 @@ namespace Aurora::IO
* @return
*/
virtual bool Failed() = 0;
/**
* @brief non-blocking is-signaled (...and dispatched via ::Complete() or other IO yield)
* @return
*/
virtual bool HasCompleted() = 0;
/**
* @brief

View File

@ -439,6 +439,11 @@ namespace Aurora::IO::FS
return false;
}
bool LinuxAsyncFileTransaction::HasCompleted()
{
return this->bTxFinished_;
}
bool LinuxAsyncFileTransaction::Failed()
{
return this->hasError_;

View File

@ -61,10 +61,13 @@ namespace Aurora::IO::FS
bool StartRead(AuUInt64 offset, const AuSPtr<AuMemoryViewWrite> &memoryView) override;
bool StartWrite(AuUInt64 offset, const AuSPtr<AuMemoryViewRead> &memoryView) override;
bool Complete() override;
bool Failed() override;
AuUInt GetOSErrorCode() override;
bool Complete() override;
bool HasCompleted() override;
AuUInt32 GetLastPacketLength() override;
void SetCallback(const AuSPtr<IAsyncFinishedSubscriber> &sub) override;

View File

@ -539,6 +539,12 @@ namespace Aurora::IO::FS
return CompleteEx(false);
}
bool NtAsyncFileTransaction::HasCompleted()
{
return bool(this->dwLastBytes) ||
this->bHasFailed;
}
AuUInt32 NtAsyncFileTransaction::GetLastPacketLength()
{
return this->dwLastBytes;

View File

@ -43,6 +43,8 @@ namespace Aurora::IO::FS
bool isIrredeemable_ {};
bool HasCompleted() override;
bool Complete() override;
bool CompleteEx(AuUInt completeRoutine, bool bForce = false);

View File

@ -226,6 +226,12 @@ namespace Aurora::IO::Net
return this->bHasFailed;
}
bool LinuxAsyncNetworkTransaction::HasCompleted()
{
return this->bHasFailed ||
this->dwLastBytes;
}
AuUInt LinuxAsyncNetworkTransaction::GetOSErrorCode()
{
return this->dwOsErrorCode;

View File

@ -33,6 +33,8 @@ namespace Aurora::IO::Net
bool Failed() override;
AuUInt GetOSErrorCode() override;
bool HasCompleted() override;
AuUInt32 GetLastPacketLength() override;
void SetCallback(const AuSPtr<IAsyncFinishedSubscriber> &sub) override;

View File

@ -362,6 +362,12 @@ namespace Aurora::IO::Net
this->dwOsErrorCode != ERROR_HANDLE_EOF;
}
bool NtAsyncNetworkTransaction::HasCompleted()
{
return this->bHasFailed ||
this->dwLastBytes;
}
AuUInt NtAsyncNetworkTransaction::GetOSErrorCode()
{
return this->dwOsErrorCode;

View File

@ -24,14 +24,16 @@ namespace Aurora::IO::Net
bool StartRead(AuUInt64 offset, const AuSPtr<AuMemoryViewWrite> &memoryView) override;
bool StartWrite(AuUInt64 offset, const AuSPtr<AuMemoryViewRead> &memoryView) override;
bool Complete() override;
bool CompleteEx(AuUInt completeRoutine, bool bForce = false);
bool Complete() override;
bool Failed() override;
bool HasErrorCode();
AuUInt GetOSErrorCode() override;
bool HasCompleted() override;
AuUInt32 GetLastPacketLength() override;
void SetCallback(const AuSPtr<IAsyncFinishedSubscriber> &sub) override;