V-Gears 0
Free Final Fantasy VII engine.
VGears::RingBuffer< buffer_size > Class Template Reference

A ring buffer used by LZS streams. More...

#include <VGearsLZSDataStream.h>

Public Member Functions

 RingBuffer ()
 Constructor. More...
 
void Write (const void *in_buffer)
 Writes to the buffer from other buffer. More...
 
size_t Read (void *out_buffer, size_t count)
 Reads data from the buffer and extracts it into other buffer. More...
 
uint8 Get (const size_t offset)
 Gets data from the buffer at an offset. More...
 
size_t Available () const
 Checks the available data size in the buffer. More...
 
void clear ()
 

Protected Attributes

uint8 buffer_ [buffer_size]
 The buffer. More...
 
size_t position_
 Current buffer position. More...
 
size_t available_
 Available data to read. More...
 

Detailed Description

template<size_t buffer_size>
class VGears::RingBuffer< buffer_size >

A ring buffer used by LZS streams.

Constructor & Destructor Documentation

◆ RingBuffer()

template<size_t buffer_size>
VGears::RingBuffer< buffer_size >::RingBuffer ( )
inline

Constructor.

Member Function Documentation

◆ Available()

template<size_t buffer_size>
size_t VGears::RingBuffer< buffer_size >::Available ( ) const
inline

Checks the available data size in the buffer.

Returns
How much data is left to read in the buffer.

◆ clear()

template<size_t buffer_size>
void VGears::RingBuffer< buffer_size >::clear ( )
inline

◆ Get()

template<size_t buffer_size>
uint8 VGears::RingBuffer< buffer_size >::Get ( const size_t  offset)
inline

Gets data from the buffer at an offset.

Parameters
[in]offsetOffset to the data to read.
Returns
The data at the offset.
Todo:
Explain the size of the returned data and offset.

◆ Read()

template<size_t buffer_size>
size_t VGears::RingBuffer< buffer_size >::Read ( void *  out_buffer,
size_t  count 
)
inline

Reads data from the buffer and extracts it into other buffer.

Parameters
[out]out_bufferBuffer to copy the data from this buffer.
[in]countNumber of bytes to read.

◆ Write()

template<size_t buffer_size>
void VGears::RingBuffer< buffer_size >::Write ( const void *  in_buffer)
inline

Writes to the buffer from other buffer.

Parameters
[in]in_bufferThe buffer to write from.

Member Data Documentation

◆ available_

template<size_t buffer_size>
size_t VGears::RingBuffer< buffer_size >::available_
protected

Available data to read.

◆ buffer_

template<size_t buffer_size>
uint8 VGears::RingBuffer< buffer_size >::buffer_[buffer_size]
protected

The buffer.

◆ position_

template<size_t buffer_size>
size_t VGears::RingBuffer< buffer_size >::position_
protected

Current buffer position.


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