AuroraRuntime/Include/Aurora/IO/IPipeBackend.hpp

32 lines
1.0 KiB
C++
Raw Normal View History

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: IPipeBackend.hpp
Date: 2022-6-20
Author: Reece
***/
#pragma once
namespace Aurora::IO
{
AUKN_INTERFACE(IPipeBackend,
/**
* @brief pipe starting hook
*/
AUI_METHOD(void, OnStart, ()),
/**
* @brief This function is called once the stream reader returns zero
* You should use this opportunity to schedule the next waitable item state (eg, initiate async read, set event high, etc)
* You can return false to soft-fail the pipe to indicate EoS
* You should otherwise return true in order to continue yield until the next waitable item state change
* Note, an EoS event may also occur during the next alert state change should the stream reader return an error
*/
AUI_METHOD(void, OnEndPump, ()),
/**
* @brief pipe end hook
*/
AUI_METHOD(void, OnEnd, ())
);
}