The tcDspBufPool class is a singleton that manages a set of standard buffer pools ranging in size from 16 bytes to 64K bytes.
More...
#include <core/DspBufPool.h>
List of all members.
Public Member Functions |
thBufHandle | Alloc (int anMinSize) |
| Allocates a new buffer of at least the specified number of bytes.
|
void * | GetAddr (thBufHandle ahHandle) |
| Returns the actual address of the buffer associated with a provided buffer handle.
|
void | Free (thBufHandle ahHandle) |
| Returns a previously allocated buffer to the free pool.
|
int | GetStats (const unsigned int *&aaSize, const unsigned int *&aaFree, const unsigned int *&aaAlloc) |
| Provides access to buffer statistics.
|
Protected Member Functions |
| tcDspBufPool (void) |
| This constructor is used to create an automatically sized, semi-static buffer pool.
|
| ~tcDspBufPool (void) |
| tcDspBufPool Destructor (not reached).
|
void | Lock (unsigned int &arCsr) |
void | Unlock (unsigned int anCsr) |
Detailed Description
The tcDspBufPool class is a singleton that manages a set of standard buffer pools ranging in size from 16 bytes to 64K bytes.
- See also:
- tcDspBufPool Page
Member Typedef Documentation
structure defining buffer and size
Member Enumeration Documentation
available buffer sizes
- Enumerator:
ee16Bytes |
|
ee64Bytes |
|
ee256Bytes |
|
ee1KBytes |
|
ee4KBytes |
|
ee16KBytes |
|
ee64KBytes |
|
eeNumSizes |
|
Constructor & Destructor Documentation
tcDspBufPool::tcDspBufPool |
( |
void |
| ) |
|
|
protected |
This constructor is used to create an automatically sized, semi-static buffer pool.
The constructor is private and is only called by the singleton accessor, GetInstance.
- See also:
- DspBufPool.h
tcDspBufPool::~tcDspBufPool |
( |
void |
| ) |
|
|
protected |
Member Function Documentation
Singleton accessor.
If the object exists, returns pointer to the singleton, otherwise constructs it and returns it.
- Returns:
- Pointer to singleton tcDspBufPool object
- See also:
- DspBufPool.h
Allocates a new buffer of at least the specified number of bytes.
Returns a handle to the allocated buffer, not the buffer itself.
- Parameters:
-
[in] | anMinSize | The minimum size of the allocated buffer. |
- Returns:
- Buffer handle if successful, NULL otherwise.
- See also:
- DspBufPool.h
Returns the actual address of the buffer associated with a provided buffer handle.
- Parameters:
-
[in] | ahHandle | Previously allocated buffer handle. |
- Returns:
- Address of the buffer.
- See also:
- DspBufPool.h
Returns a previously allocated buffer to the free pool.
- Parameters:
-
[in] | ahHandle | Previously allocated buffer handle. |
- Returns:
- None.
- See also:
- DspBufPool.h
int tcDspBufPool::GetStats |
( |
const unsigned int *& |
aaSize, |
|
|
const unsigned int *& |
aaFree, |
|
|
const unsigned int *& |
aaAlloc |
|
) |
| |
Provides access to buffer statistics.
- Parameters:
-
[in] | aaSize | Reference to an array of buffer sizes. |
[in] | aaFree | Reference to an array of free buffers of each size. |
[in] | aaAlloc | Reference to an array of allocated buffers of each size. |
- Returns:
- Number of different buffer sizes in each array.
- See also:
- DspBufPool.h
void MityDSP::tcDspBufPool::Lock |
( |
unsigned int & |
arCsr | ) |
|
|
inlineprotected |
void MityDSP::tcDspBufPool::Unlock |
( |
unsigned int |
anCsr | ) |
|
|
inlineprotected |
Member Data Documentation
LCK_Handle MityDSP::tcDspBufPool::mhMutex |
|
protected |
unsigned int MityDSP::tcDspBufPool::maBufSizes[eeNumSizes] |
|
protected |
total buffers of each size alloc'd
unsigned int MityDSP::tcDspBufPool::maNumAlloc[eeNumSizes] |
|
protected |
total buffers of each size alloc'd
unsigned int MityDSP::tcDspBufPool::maNumFree[eeNumSizes] |
|
protected |
number of each buffer size in free pool