A data buffer pool. More...
Public Member Functions | |
DataBufferPool () | |
Initializes a new instance of the fm.liveswitch.DataBufferPool class. More... | |
DataBufferPool (String tag) | |
Initializes a new instance of the fm.liveswitch.DataBufferPool class. More... | |
int | getBlockSize () |
Gets the block size. More... | |
boolean | getDisabled () |
Gets whether the pool is disabled. More... | |
boolean | getEnableStatistics () |
Gets whether to enable statistics. More... | |
long | getPooledBytesAvailable () |
Gets the total bytes available in the pool. More... | |
fm.liveswitch.PoolStatistics | getStatistics () |
Gets the pool usage statistics. More... | |
fm.liveswitch.PoolStatistics[] | getTraceStatistics () |
Gets all tagged pool usage statistics. More... | |
fm.liveswitch.PoolStatistics | getTraceStatistics (String tag) |
Gets pool usage statistics for a specific tag. More... | |
fm.liveswitch.PoolStatistics | getTraceStatistics (@SuppressWarnings("rawtypes") Class type) |
Gets pool usage statistics for a specific tag. More... | |
void | releasePools () |
Release the pools. More... | |
void | setDisabled (boolean value) |
Sets whether the pool is disabled. More... | |
void | setEnableStatistics (boolean value) |
Sets whether to enable statistics. More... | |
fm.liveswitch.DataBuffer | take (int size) |
Takes a buffer from the pool. More... | |
fm.liveswitch.DataBuffer | take (int size, boolean littleEndian) |
Takes a buffer from the pool. More... | |
fm.liveswitch.DataBuffer | take (int size, boolean littleEndian, boolean clearBytes) |
Takes a buffer from the pool. More... | |
Static Public Member Functions | |
static fm.liveswitch.DataBufferPool | getInstance () |
Gets the singleton instance. More... | |
static boolean | getIsSupported () |
Gets a value indicating whether DataBuffer pooling is supported on this platform. More... | |
static fm.liveswitch.DataBufferPoolTracer | getTracer (String tag) |
Get a data buffer pool tracer for a specific tag using the default pool. More... | |
static fm.liveswitch.DataBufferPoolTracer | getTracer (String tag, fm.liveswitch.DataBufferPool pool) |
Get a data buffer pool tracer for a specific tag and pool. More... | |
static fm.liveswitch.DataBufferPoolTracer | getTracer (@SuppressWarnings("rawtypes") Class type) |
Get a data buffer pool tracer for a specific tag using the default pool. More... | |
static fm.liveswitch.DataBufferPoolTracer | getTracer (@SuppressWarnings("rawtypes") Class type, fm.liveswitch.DataBufferPool pool) |
Get a data buffer pool tracer for a specific tag and pool. More... | |
A data buffer pool.
fm.liveswitch.DataBufferPool.DataBufferPool | ( | ) |
Initializes a new instance of the fm.liveswitch.DataBufferPool class.
fm.liveswitch.DataBufferPool.DataBufferPool | ( | String | tag | ) |
Initializes a new instance of the fm.liveswitch.DataBufferPool class.
tag | The tag for stats output. |
int fm.liveswitch.DataBufferPool.getBlockSize | ( | ) |
Gets the block size.
boolean fm.liveswitch.DataBufferPool.getDisabled | ( | ) |
Gets whether the pool is disabled.
If disabled, each call to take a buffer will result in a new allocation.
boolean fm.liveswitch.DataBufferPool.getEnableStatistics | ( | ) |
Gets whether to enable statistics.
|
static |
Gets the singleton instance.
|
static |
Gets a value indicating whether DataBuffer pooling is supported on this platform.
long fm.liveswitch.DataBufferPool.getPooledBytesAvailable | ( | ) |
Gets the total bytes available in the pool.
Implements fm.liveswitch.IDataBufferPool.
fm.liveswitch.PoolStatistics fm.liveswitch.DataBufferPool.getStatistics | ( | ) |
Gets the pool usage statistics.
|
static |
Get a data buffer pool tracer for a specific tag using the default pool.
The tag is taken from the class namespace and name.
type | The type to use as the tag. |
|
static |
Get a data buffer pool tracer for a specific tag and pool.
The tag is taken from the class namespace and name.
type | The type to use as the tag. |
pool | The underlying pool. |
|
static |
Get a data buffer pool tracer for a specific tag using the default pool.
tag | The tag to log to. |
|
static |
Get a data buffer pool tracer for a specific tag and pool.
tag | The tag to log to. |
pool | The underlying pool. |
fm.liveswitch.PoolStatistics [] fm.liveswitch.DataBufferPool.getTraceStatistics | ( | ) |
Gets all tagged pool usage statistics.
fm.liveswitch.PoolStatistics fm.liveswitch.DataBufferPool.getTraceStatistics | ( | @SuppressWarnings("rawtypes") Class | type | ) |
Gets pool usage statistics for a specific tag.
type | The type to use as the tag. |
fm.liveswitch.PoolStatistics fm.liveswitch.DataBufferPool.getTraceStatistics | ( | String | tag | ) |
Gets pool usage statistics for a specific tag.
tag | The tag. |
void fm.liveswitch.DataBufferPool.releasePools | ( | ) |
Release the pools.
Implements fm.liveswitch.IDataBufferPool.
void fm.liveswitch.DataBufferPool.setDisabled | ( | boolean | value | ) |
Sets whether the pool is disabled.
If disabled, each call to take a buffer will result in a new allocation.
void fm.liveswitch.DataBufferPool.setEnableStatistics | ( | boolean | value | ) |
Sets whether to enable statistics.
fm.liveswitch.DataBuffer fm.liveswitch.DataBufferPool.take | ( | int | size | ) |
Takes a buffer from the pool.
size | The number of bytes needed. |
Implements fm.liveswitch.IDataBufferPool.
fm.liveswitch.DataBuffer fm.liveswitch.DataBufferPool.take | ( | int | size, |
boolean | littleEndian | ||
) |
Takes a buffer from the pool.
size | The number of bytes needed. |
littleEndian | Whether the data buffer should be little-endian. |
Implements fm.liveswitch.IDataBufferPool.
fm.liveswitch.DataBuffer fm.liveswitch.DataBufferPool.take | ( | int | size, |
boolean | littleEndian, | ||
boolean | clearBytes | ||
) |
Takes a buffer from the pool.
size | The number of bytes needed. |
littleEndian | Whether the data buffer should be little-endian. |
clearBytes | Whether to clear the data buffer. |
Implements fm.liveswitch.IDataBufferPool.