AuroraRuntime/Source/IO/Protocol/AuProtocolPiece.hpp
Jamie Reece Wilson 76d3759295 [+] IProtocolPiece::GetPreviousPiece()
[+] IProtocolPiece::ReallocateSourceBuffer()
[*] IProtocolPiece::GetInputWriter()
[*] IProtocolPiece::GetNextWriter()
2023-12-10 14:06:10 +00:00

46 lines
1.7 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: ProtocolPiece.hpp
Date: 2022-8-24
Author: Reece
***/
#pragma once
namespace Aurora::IO::Protocol
{
struct IProtocolNext;
struct ProtocolStack;
struct ProtocolPiece :
IProtocolPiece,
AuEnableSharedFromThis<ProtocolPiece>
{
ProtocolStack *pParent;
AuSPtr<IProtocolInterceptor> pInterceptor;
AuSPtr<IProtocolInterceptorEx> pInterceptorEx;
AuSPtr<IProtocolNext> pWriteInteface;
AuSPtr<ProtocolPiece> pNext;
AuSPtr<ProtocolPiece> pBefore;
AuByteBuffer outputBuffer;
AuSPtr<IStreamWriter> pOuputWriter;
bool bMultipleTick {};
AuOptional<AuUInt> uMax;
AuUInt64 uStartingSize {};
friend struct ProtocolStack; // IProtocolPiece::PrivateUserDataClear()
AuSPtr<ProtocolStack> GetParent() override;
AuSPtr<IProtocolPiece> GetNextPiece() override;
AuSPtr<IProtocolPiece> GetPreviousPiece() override;
bool ReallocateDrainBuffer(AuUInt32 uOutputLength) override;
bool ReallocateSourceBuffer(AuUInt32 uInputLength) override;
void Remove() override;
AuSPtr<IStreamWriter> GetNextWriter() override;
AuSPtr<IStreamWriter> GetInputWriter() override;
AuSPtr<IStreamReader> GetOutputReader() override;
AuSPtr<Memory::ByteBuffer> GetNextPieceBuffer() override;
AuSPtr<IProtocolInterceptorEx> GetExtendedInterceptor() override;
AuSPtr<IProtocolInterceptor> GetShortPipeInterceptor() override;
AuOptional<AuUInt> ExchangeMaximumBufferLength(AuOptional<AuUInt> optMax) override;
};
}