TRF Language Model
wb::Queue< T > Class Template Reference

A queue based the dynamic memory mangement. More...

#include <wb-vector.h>

Inheritance diagram for wb::Queue< T >:
wb::Vector< T >

Public Member Functions

 Queue (int size=DEFAULE_VECTOR_SIZE)
 constructor More...
 
void Clean ()
 clean the queue. Donot release the memory More...
 
void In (T p_t)
 Add a value into queue. More...
 
bool Out (T *p_pT)
 Move a value outof queue. More...
 
bool IsEmpty ()
 Return if the queue is empty. More...
 
int GetNum ()
 Return the value number. More...
 
- Public Member Functions inherited from wb::Vector< T >
 Vector (int size=DEFAULE_VECTOR_SIZE)
 constructor, do not init the memeory to zero. More...
 
 ~Vector ()
 desturctor More...
 
int Size () const
 get the memory size More...
 
T * GetBuffer (int i=0) const
 get the buffer pointer More...
 
T & Get (int i)
 get the value at position i More...
 
int Size2Bits (int size)
 Transform the size to bit. More...
 
void Fill (T m)
 set all the values to m More...
 
void Zero ()
 Fill all the memory to ZERO. call 'memset'. More...
 
void Copy (const Vector< T > &vector)
 Copy a vector to another, using '=' to set values. More...
 
void MemCopy (Vector< T > &vector)
 Copy a vector to another, using 'memcpy' to set values. More...
 
void BufferOutside (T *&p_pt)
 Set the buffer pointer to p_pt, and re-init the vector. More...
 

Public Attributes

int m_nTop
 the top of the queue More...
 
int m_nBottom
 

Additional Inherited Members

- Protected Attributes inherited from wb::Vector< T >
T * m_pBuffer
 buffer pointer More...
 
int m_nBits
 bit number of memory size More...
 

Detailed Description

template<typename T>
class wb::Queue< T >

A queue based the dynamic memory mangement.

Date
2016-04-28
Author
WangBin

This is not a circular quque. As ar result, the memory size will increase following the values added to the queue.

Definition at line 431 of file wb-vector.h.

Constructor & Destructor Documentation

§ Queue()

template<typename T>
wb::Queue< T >::Queue ( int  size = DEFAULE_VECTOR_SIZE)
inline

constructor

Definition at line 437 of file wb-vector.h.

Member Function Documentation

§ Clean()

template<typename T>
void wb::Queue< T >::Clean ( )
inline

clean the queue. Donot release the memory

Definition at line 443 of file wb-vector.h.

§ GetNum()

template<typename T>
int wb::Queue< T >::GetNum ( )
inline

Return the value number.

Definition at line 466 of file wb-vector.h.

§ In()

template<typename T>
void wb::Queue< T >::In ( p_t)
inline

Add a value into queue.

Definition at line 445 of file wb-vector.h.

§ IsEmpty()

template<typename T>
bool wb::Queue< T >::IsEmpty ( )
inline

Return if the queue is empty.

Definition at line 461 of file wb-vector.h.

§ Out()

template<typename T>
bool wb::Queue< T >::Out ( T *  p_pT)
inline

Move a value outof queue.

Definition at line 451 of file wb-vector.h.

Member Data Documentation

§ m_nBottom

template<typename T>
int wb::Queue< T >::m_nBottom

the bottom of the queue

Definition at line 435 of file wb-vector.h.

§ m_nTop

template<typename T>
int wb::Queue< T >::m_nTop

the top of the queue

Definition at line 434 of file wb-vector.h.


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