40 lines
1.1 KiB
C++
40 lines
1.1 KiB
C++
|
/***
|
||
|
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
||
|
|
||
|
File: ProtocolStack.hpp
|
||
|
Date: 2022-8-24
|
||
|
Author: Reece
|
||
|
***/
|
||
|
#pragma once
|
||
|
|
||
|
namespace Aurora::IO::Protocol
|
||
|
{
|
||
|
struct ProtocolPiece;
|
||
|
|
||
|
struct ProtocolStack : IProtocolStack
|
||
|
{
|
||
|
~ProtocolStack();
|
||
|
|
||
|
void DoTick() override;
|
||
|
bool DoTick(const AuSPtr<AuByteBuffer> &read, const AuSPtr<ProtocolPiece> &pPiece);
|
||
|
|
||
|
bool AddInterceptor(const AuSPtr<IProtocolInterceptor> &pInterceptor, AuUInt uOutputBufferSize) override;
|
||
|
bool AddInterceptorEx(const AuSPtr<IProtocolInterceptorEx> &pInterceptor, AuUInt uOutputBufferSize) override;
|
||
|
|
||
|
void Destroy() override;
|
||
|
|
||
|
AuSPtr<IStreamWriter> AsStreamWriter() override;
|
||
|
AuSPtr<Memory::ByteBuffer> AsWritableByteBuffer() override;
|
||
|
|
||
|
AuSPtr<IStreamReader> AsStreamReader() override;
|
||
|
AuSPtr<Memory::ByteBuffer> AsReadableByteBuffer() override;
|
||
|
|
||
|
AuSPtr<AuByteBuffer> pSourceBufer;
|
||
|
bool bOwnsSource {};
|
||
|
|
||
|
AuSPtr<AuByteBuffer> pDrainBuffer;
|
||
|
|
||
|
AuSPtr<ProtocolPiece> pBottomPiece;
|
||
|
AuSPtr<ProtocolPiece> pTopPiece;
|
||
|
};
|
||
|
}
|