Added peek method for Ring Buffer.
This commit is contained in:
parent
8badd2bbfa
commit
58e1ea2a65
|
|
@ -22,6 +22,7 @@ public:
|
||||||
void clear();
|
void clear();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
DataType peek() const;
|
||||||
DataType read();
|
DataType read();
|
||||||
void read(DataType* outData, int inSize);
|
void read(DataType* outData, int inSize);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,12 @@ void RingBuffer<DataType, Size>::clear()
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
template<typename DataType, int Size>
|
||||||
|
DataType RingBuffer<DataType, Size>::peek() const
|
||||||
|
{
|
||||||
|
return *mReadHead;
|
||||||
|
}
|
||||||
|
|
||||||
template<typename DataType, int Size>
|
template<typename DataType, int Size>
|
||||||
DataType RingBuffer<DataType, Size>::read()
|
DataType RingBuffer<DataType, Size>::read()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue