TRF Language Model
|
Circular queue. More...
#include <wb-vector.h>
Public Member Functions | |
CirQueue (int size=10) | |
constructor More... | |
void | Init (int size) |
Init the queue. More... | |
void | Clean () |
Clean the queue, don't release the memory. More... | |
void | In (T t) |
Add a value into queue. More... | |
bool | Out (T *t=NULL) |
Remove a value outof queue. More... | |
bool | IsEmpty () |
if the queue is empty More... | |
bool | IsFull () |
if the queue is full More... | |
int | GetNum () |
Get number of values. More... | |
int | GetSize () |
Get the buffer size of queue. More... | |
T | GetSum () |
Summary all the values if queue. More... | |
Public Attributes | |
int | nHead |
the head of queue More... | |
int | nTail |
the tail of queue More... | |
Circular queue.
For circular queue, we need indicate the size of a queue beforhead.
Definition at line 479 of file wb-vector.h.
|
inline |
constructor
Definition at line 489 of file wb-vector.h.
|
inline |
Clean the queue, don't release the memory.
Definition at line 504 of file wb-vector.h.
|
inline |
Get number of values.
Definition at line 550 of file wb-vector.h.
|
inline |
Get the buffer size of queue.
Definition at line 552 of file wb-vector.h.
|
inline |
Summary all the values if queue.
Definition at line 554 of file wb-vector.h.
|
inline |
Add a value into queue.
Definition at line 511 of file wb-vector.h.
|
inline |
Init the queue.
Definition at line 497 of file wb-vector.h.
|
inline |
if the queue is empty
Definition at line 546 of file wb-vector.h.
|
inline |
if the queue is full
Definition at line 548 of file wb-vector.h.
|
inline |
Remove a value outof queue.
Definition at line 525 of file wb-vector.h.
int wb::CirQueue< T >::nHead |
the head of queue
Definition at line 485 of file wb-vector.h.
int wb::CirQueue< T >::nTail |
the tail of queue
Definition at line 486 of file wb-vector.h.