1 // 2 // Copyright © 2019 Arm Ltd. All rights reserved. 3 // SPDX-License-Identifier: MIT 4 // 5 6 #pragma once 7 8 #include "IConsumer.hpp" 9 #include "IPacketBuffer.hpp" 10 11 #include <memory> 12 13 #define MAX_METADATA_PACKET_LENGTH 4096 14 15 namespace arm 16 { 17 18 namespace pipe 19 { 20 21 class IBufferManager 22 { 23 public: ~IBufferManager()24 virtual ~IBufferManager() {} 25 26 virtual IPacketBufferPtr Reserve(unsigned int requestedSize, unsigned int& reservedSize) = 0; 27 28 virtual void Commit(IPacketBufferPtr& packetBuffer, unsigned int size, bool notifyConsumer = true) = 0; 29 30 virtual void Release(IPacketBufferPtr& packetBuffer) = 0; 31 32 virtual IPacketBufferPtr GetReadableBuffer() = 0; 33 34 virtual void MarkRead(IPacketBufferPtr& packetBuffer) = 0; 35 36 virtual void SetConsumer(IConsumer* consumer) = 0; 37 38 virtual void FlushReadList() = 0; 39 }; 40 41 } // namespace pipe 42 43 } // namespace arm 44