Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
OutputBufferManager Class Reference

#include <stream.h>

Public Member Functions

 OutputBufferManager ()
 
void Reset ()
 
void SetBuffer (u8 *buffer, size_t size)
 
void AllocateBuffer (size_t size)
 allocate a new output buffer. More...
 
u8Buffer () const
 
size_t Size () const
 

Private Member Functions

bool IsAllowableBuffer (u8 *buffer, size_t size)
 

Private Attributes

u8m_buffer
 
size_t m_size
 
std::shared_ptr< u8m_mem
 
size_t m_capacity
 

Constructor & Destructor Documentation

◆ OutputBufferManager()

OutputBufferManager::OutputBufferManager ( )

Member Function Documentation

◆ AllocateBuffer()

void OutputBufferManager::AllocateBuffer ( size_t  size)

allocate a new output buffer.

Parameters
size[bytes] to allocate.

notes:

  • if a buffer had previously been allocated and is large enough, it is reused (this reduces the number of allocations).
  • this class manages the lifetime of the buffer.

◆ Buffer()

u8 * OutputBufferManager::Buffer ( ) const
inline

◆ IsAllowableBuffer()

bool OutputBufferManager::IsAllowableBuffer ( u8 buffer,
size_t  size 
)
private

◆ Reset()

void OutputBufferManager::Reset ( )

◆ SetBuffer()

void OutputBufferManager::SetBuffer ( u8 buffer,
size_t  size 
)

◆ Size()

size_t OutputBufferManager::Size ( ) const
inline

Member Data Documentation

◆ m_buffer

u8* OutputBufferManager::m_buffer
private

◆ m_capacity

size_t OutputBufferManager::m_capacity
private

◆ m_mem

std::shared_ptr<u8> OutputBufferManager::m_mem
private

◆ m_size

size_t OutputBufferManager::m_size
private

The documentation for this class was generated from the following files: