/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: ProtocolPiece.cpp Date: 2022-8-24 Author: Reece ***/ #include "Protocol.hpp" #include "ProtocolPiece.hpp" #include "ProtocolStack.hpp" #include "IProtocolNext.hpp" namespace Aurora::IO::Protocol { AuSPtr ProtocolPiece::ToNextWriter() { if (this->pParent->pTopPiece.get() == this) { if (this->pParent->pDrainBuffer) { return AuMakeShared(this->pParent->pDrainBuffer); } } return this->pNext ? this->pNext->pWriteInteface->GetStreamWriter() : this->pOuputWriter; } }