11 #include <condition_variable> 24 BufferManager(
unsigned int numberOfBuffers = 5,
unsigned int maxPacketSize = 4096);
51 unsigned int m_MaxBufferSize;
53 unsigned int m_NumberOfBuffers;
56 std::vector<IPacketBufferPtr> m_AvailableList;
59 std::vector<IPacketBufferPtr> m_ReadableList;
62 std::mutex m_AvailableMutex;
65 std::mutex m_ReadableMutex;
IPacketBufferPtr Reserve(unsigned int requestedSize, unsigned int &reservedSize) override
std::unique_ptr< IPacketBuffer > IPacketBufferPtr
void Commit(IPacketBufferPtr &packetBuffer, unsigned int size, bool notifyConsumer=true) override
void SetConsumer(IConsumer *consumer) override
IPacketBufferPtr GetReadableBuffer() override
BufferManager(unsigned int numberOfBuffers=5, unsigned int maxPacketSize=4096)
void FlushReadList() override
Notify the Consumer buffer can be read.
void MarkRead(IPacketBufferPtr &packetBuffer) override
void Release(IPacketBufferPtr &packetBuffer) override