2022-06-22 13:42:17 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
2022-12-17 20:14:19 +00:00
|
|
|
File: AuIOSimpleEventListener.cpp
|
2022-06-22 13:42:17 +00:00
|
|
|
Date: 2022-6-22
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#include <Source/RuntimeInternal.hpp>
|
|
|
|
#include <Aurora/IO/IOExperimental.hpp>
|
2022-12-17 20:14:19 +00:00
|
|
|
#include "AuIOSimpleEventListener.hpp"
|
2022-06-22 13:42:17 +00:00
|
|
|
|
|
|
|
namespace Aurora::IO
|
|
|
|
{
|
2022-08-29 15:46:46 +00:00
|
|
|
IOSimpleEventListener::IOSimpleEventListener(const AuSPtr<IIOSimpleEventListener> &pParent) : pParent(pParent)
|
2022-06-22 13:42:17 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void IOSimpleEventListener::Tick_RunOnTick()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void IOSimpleEventListener::Tick_OtherIOEvent()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void IOSimpleEventListener::Tick_SelfIOEvent()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void IOSimpleEventListener::Tick_Any()
|
|
|
|
{
|
2022-08-29 15:46:46 +00:00
|
|
|
this->pParent->OnIOTick();
|
2022-06-22 13:42:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IOSimpleEventListener::Tick_FrameEpilogue()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
void IOSimpleEventListener::OnFailureCompletion()
|
|
|
|
{
|
2022-08-29 15:46:46 +00:00
|
|
|
this->pParent->OnIOFailure();
|
2022-06-22 13:42:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IOSimpleEventListener::OnNominalCompletion()
|
|
|
|
{
|
2022-08-29 15:46:46 +00:00
|
|
|
this->pParent->OnIOComplete();
|
2022-06-22 13:42:17 +00:00
|
|
|
}
|
|
|
|
|
2022-08-29 15:46:46 +00:00
|
|
|
AuSPtr<IIOEventListener> DesimplifyIOEventListenerAdapter(const AuSPtr<IIOSimpleEventListener> &pInterface)
|
2022-06-22 13:42:17 +00:00
|
|
|
{
|
2022-08-29 15:46:46 +00:00
|
|
|
if (!pInterface)
|
2022-06-22 13:42:17 +00:00
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
|
|
|
|
2022-08-29 15:46:46 +00:00
|
|
|
return AuMakeShared<IOSimpleEventListener>(pInterface);
|
2022-06-22 13:42:17 +00:00
|
|
|
}
|
|
|
|
}
|