|
TRF Language Model
|
this is the basic class of Array/Stack/Queue. Realize the dynamic memory management More...
#include <wb-vector.h>
Public Member Functions | |
| 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... | |
Protected Attributes | |
| T * | m_pBuffer |
| buffer pointer More... | |
| int | m_nBits |
| bit number of memory size More... | |
this is the basic class of Array/Stack/Queue. Realize the dynamic memory management
Definition at line 73 of file wb-vector.h.
|
inline |
constructor, do not init the memeory to zero.
Definition at line 80 of file wb-vector.h.
|
inline |
desturctor
Definition at line 87 of file wb-vector.h.
|
inline |
Set the buffer pointer to p_pt, and re-init the vector.
Definition at line 186 of file wb-vector.h.
|
inline |
Copy a vector to another, using '=' to set values.
Definition at line 155 of file wb-vector.h.
|
inline |
set all the values to m
using '=' to set values. This may avoid the error caused by 'memcopy'
Definition at line 139 of file wb-vector.h.
|
inline |
get the value at position i
Definition at line 99 of file wb-vector.h.
|
inline |
get the buffer pointer
Definition at line 97 of file wb-vector.h.
|
inline |
Copy a vector to another, using 'memcpy' to set values.
Definition at line 171 of file wb-vector.h.
|
inline |
get the memory size
Definition at line 95 of file wb-vector.h.
|
inline |
Transform the size to bit.
Definition at line 128 of file wb-vector.h.
|
inline |
Fill all the memory to ZERO. call 'memset'.
Definition at line 145 of file wb-vector.h.
|
protected |
bit number of memory size
Definition at line 77 of file wb-vector.h.
|
protected |
buffer pointer
Definition at line 76 of file wb-vector.h.