A memory pool for the specified type.
More...
#include <pg_buf.h>
List of all members.
|
Public Member Functions |
|
| pgDefineException (ExceptionInvalidArgument) |
|
| pgDefineException (ExceptionNotInitialized) |
|
| pgDefineException (ExceptionOutOfBuffer) |
|
| pgBuf () |
| | Constructs and initialize a pgBuf whose size is zero.
|
|
| ~pgBuf () |
| | Destructs this pgBuf.
|
| void | init (u16 size) |
| | Initializes this pgBuf with the specified size.
|
| u16 | getSize () const |
| | Returns the size of this pgBuf.
|
| u16 | getUsedSize () const |
| | Returns the used size of this pgBuf.
|
| u16 | getFreeSize () const |
| | Returns the available size of this pgBuf.
|
| T * | getFirstN () const |
| | Returns the first value in this pgBuf.
|
| T * | getLastN () const |
| | Returns the last value in this pgBuf.
|
| T * | getPrevN (const T *elem) const |
| | Returns the previous value of the specified value.
|
| T * | getNextN (const T *elem) const |
| | Returns the next value of the specified value.
|
| T * | newElement () |
| | Allocates a value from this pgBuf.
|
| void | deleteElement (T *elem) |
| | Deletes the specified value in this pgBuf.
|
|
void | clear () |
| | Deletes all values in this pgBuf.
|
Detailed Description
template<class T>
class pgBuf< T >
A memory pool for the specified type.
- Template Parameters:
-
| T | The type which is managed by the memory pool. |
Member Function Documentation
template<class T >
| void pgBuf< T >::deleteElement |
( |
T * |
elem |
) |
[inline] |
Deletes the specified value in this pgBuf.
- Parameters:
-
| [in] | elem | A value in this pgBuf. |
template<class T >
| T* pgBuf< T >::getFirstN |
( |
|
) |
const [inline] |
Returns the first value in this pgBuf.
If this pgBuf has no value, returns NULL.
- Returns:
- The first value in this pgBuf.
template<class T >
| u16 pgBuf< T >::getFreeSize |
( |
|
) |
const [inline] |
Returns the available size of this pgBuf.
- Returns:
- The available size of this pgBuf.
template<class T >
| T* pgBuf< T >::getLastN |
( |
|
) |
const [inline] |
Returns the last value in this pgBuf.
If this pgBuf has no value, returns NULL.
- Returns:
- The last value in this pgBuf.
template<class T >
| T* pgBuf< T >::getNextN |
( |
const T * |
elem |
) |
const [inline] |
Returns the next value of the specified value.
If the specified value has no next value, returns NULL.
- Parameters:
-
| [in] | elem | A value in this pgBuf. |
- Returns:
- The next value of the specified value.
template<class T >
| T* pgBuf< T >::getPrevN |
( |
const T * |
elem |
) |
const [inline] |
Returns the previous value of the specified value.
If the specified value has no previous value, returns NULL.
- Parameters:
-
| [in] | elem | A value in this pgBuf. |
- Returns:
- The previous value of the specified value.
template<class T >
| u16 pgBuf< T >::getSize |
( |
|
) |
const [inline] |
Returns the size of this pgBuf.
- Returns:
- The size of this pgBuf.
template<class T >
| u16 pgBuf< T >::getUsedSize |
( |
|
) |
const [inline] |
Returns the used size of this pgBuf.
- Returns:
- The used size of this pgBuf.
template<class T >
| void pgBuf< T >::init |
( |
u16 |
size |
) |
[inline] |
Initializes this pgBuf with the specified size.
- Parameters:
-
| [in] | size | The size of this pgBuf. |
template<class T >
| T* pgBuf< T >::newElement |
( |
|
) |
[inline] |
Allocates a value from this pgBuf.
- Returns:
- An allocated value.
The documentation for this class was generated from the following file: