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

A dynamic stack. More...

#include <wb-vector.h>

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

Public Member Functions

 Stack (int size=DEFAULE_VECTOR_SIZE)
 constructor More...
 
void Clean ()
 clean the stack. Donot release the memory More...
 
void Push (T p_t)
 Push a value into the stack. More...
 
bool Pop (T *p_pT)
 Pop a value outof the stack. More...
 
Top ()
 Get the Top value of stack. More...
 
int GetNum () const
 Get the number of the stack. 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
 

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::Stack< T >

A dynamic stack.

Date
2016-04-28
Author
Wangbin

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

Constructor & Destructor Documentation

§ Stack()

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

constructor

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

Member Function Documentation

§ Clean()

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

clean the stack. Donot release the memory

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

§ GetNum()

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

Get the number of the stack.

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

§ Pop()

template<typename T >
bool wb::Stack< T >::Pop ( T *  p_pT)
inline

Pop a value outof the stack.

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

§ Push()

template<typename T >
void wb::Stack< T >::Push ( p_t)
inline

Push a value into the stack.

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

§ Top()

template<typename T >
T wb::Stack< T >::Top ( )
inline

Get the Top value of stack.

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

Member Data Documentation

§ m_nTop

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

top of the stack

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


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