29 lines
723 B
C++
29 lines
723 B
C++
|
/***
|
||
|
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<IStreamWriter> ProtocolPiece::ToNextWriter()
|
||
|
{
|
||
|
if (this->pParent->pTopPiece.get() == this)
|
||
|
{
|
||
|
if (this->pParent->pDrainBuffer)
|
||
|
{
|
||
|
return AuMakeShared<Buffered::BlobWriter>(this->pParent->pDrainBuffer);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return this->pNext ?
|
||
|
this->pNext->pWriteInteface->GetStreamWriter() :
|
||
|
this->pOuputWriter;
|
||
|
}
|
||
|
}
|