FMLiveSwitchDataBufferPool Class Reference

A data buffer pool. More...

Instance Methods

(int) - blockSize
 Gets the block size. More...
 
(bool) - disabled
 Gets whether the pool is disabled. More...
 
(bool) - enableStatistics
 Gets whether to enable statistics. More...
 
(FMLiveSwitchPoolStatistics *) - getTraceStatisticsWithTag:
 Gets pool usage statistics for a specific tag. More...
 
(FMLiveSwitchPoolStatistics *) - getTraceStatisticsWithType:
 Gets pool usage statistics for a specific tag. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchDataBufferPool class. More...
 
(instancetype) - initWithTag:
 Initializes a new instance of the FMLiveSwitchDataBufferPool class. More...
 
(long long) - pooledBytesAvailable
 Gets the total bytes available in the pool. More...
 
(void) - releasePools
 Release the pools. More...
 
(void) - setDisabled:
 Sets whether the pool is disabled. More...
 
(void) - setEnableStatistics:
 Sets whether to enable statistics. More...
 
(FMLiveSwitchPoolStatistics *) - statistics
 Gets the pool usage statistics. More...
 
(FMLiveSwitchDataBuffer *) - takeWithSize:
 Takes a buffer from the pool. More...
 
(FMLiveSwitchDataBuffer *) - takeWithSize:littleEndian:
 Takes a buffer from the pool. More...
 
(FMLiveSwitchDataBuffer *) - takeWithSize:littleEndian:clearBytes:
 Takes a buffer from the pool. More...
 
(NSMutableArray *) - traceStatistics
 Gets all tagged pool usage statistics. More...
 

Class Methods

(FMLiveSwitchDataBufferPool *) + dataBufferPool
 Initializes a new instance of the FMLiveSwitchDataBufferPool class. More...
 
(FMLiveSwitchDataBufferPool *) + dataBufferPoolWithTag:
 Initializes a new instance of the FMLiveSwitchDataBufferPool class. More...
 
(FMLiveSwitchDataBufferPoolTracer *) + getTracerWithTag:
 Get a data buffer pool tracer for a specific tag using the default pool. More...
 
(FMLiveSwitchDataBufferPoolTracer *) + getTracerWithTag:pool:
 Get a data buffer pool tracer for a specific tag and pool. More...
 
(FMLiveSwitchDataBufferPoolTracer *) + getTracerWithType:
 Get a data buffer pool tracer for a specific tag using the default pool. More...
 
(FMLiveSwitchDataBufferPoolTracer *) + getTracerWithType:pool:
 Get a data buffer pool tracer for a specific tag and pool. More...
 
(FMLiveSwitchDataBufferPool *) + instance
 Gets the singleton instance. More...
 
(bool) + isSupported
 Gets a value indicating whether DataBuffer pooling is supported on this platform. More...
 

Detailed Description

A data buffer pool.

Method Documentation

◆ blockSize

- (int) blockSize

Gets the block size.

◆ dataBufferPool

+ (FMLiveSwitchDataBufferPool*) dataBufferPool

Initializes a new instance of the FMLiveSwitchDataBufferPool class.

◆ dataBufferPoolWithTag:

+ (FMLiveSwitchDataBufferPool*) dataBufferPoolWithTag: (NSString *)  tag

Initializes a new instance of the FMLiveSwitchDataBufferPool class.

Parameters
tagThe tag for stats output.

◆ disabled

- (bool) disabled

Gets whether the pool is disabled.

If disabled, each call to take a buffer will result in a new allocation.

◆ enableStatistics

- (bool) enableStatistics

Gets whether to enable statistics.

◆ getTracerWithTag:

+ (FMLiveSwitchDataBufferPoolTracer*) getTracerWithTag: (NSString *)  tag

Get a data buffer pool tracer for a specific tag using the default pool.

Parameters
tagThe tag to log to.
Returns
A tracer that will associate stats with the type.

◆ getTracerWithTag:pool:

Get a data buffer pool tracer for a specific tag and pool.

Parameters
tagThe tag to log to.
poolThe underlying pool.
Returns
A tracer that will associate stats with the type.

◆ getTracerWithType:

+ (FMLiveSwitchDataBufferPoolTracer*) getTracerWithType: (Class)  type

Get a data buffer pool tracer for a specific tag using the default pool.

The tag is taken from the class namespace and name.

Parameters
typeThe type to use as the tag.
Returns
A tracer that will associate stats with the tag.

◆ getTracerWithType:pool:

Get a data buffer pool tracer for a specific tag and pool.

The tag is taken from the class namespace and name.

Parameters
typeThe type to use as the tag.
poolThe underlying pool.
Returns
A tracer that will associate stats with the tag.

◆ getTraceStatisticsWithTag:

- (FMLiveSwitchPoolStatistics*) getTraceStatisticsWithTag: (NSString *)  tag

Gets pool usage statistics for a specific tag.

Parameters
tagThe tag.

◆ getTraceStatisticsWithType:

- (FMLiveSwitchPoolStatistics*) getTraceStatisticsWithType: (Class)  type

Gets pool usage statistics for a specific tag.

Parameters
typeThe type to use as the tag.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchDataBufferPool class.

◆ initWithTag:

- (instancetype) initWithTag: (NSString *)  tag

Initializes a new instance of the FMLiveSwitchDataBufferPool class.

Parameters
tagThe tag for stats output.

◆ instance

Gets the singleton instance.

◆ isSupported

+ (bool) isSupported

Gets a value indicating whether DataBuffer pooling is supported on this platform.

◆ pooledBytesAvailable

- (long long) pooledBytesAvailable

Gets the total bytes available in the pool.

Reimplemented from <FMLiveSwitchIDataBufferPool>.

◆ releasePools

- (void) releasePools

Release the pools.

Reimplemented from <FMLiveSwitchIDataBufferPool>.

◆ setDisabled:

- (void) setDisabled: (bool)  value

Sets whether the pool is disabled.

If disabled, each call to take a buffer will result in a new allocation.

◆ setEnableStatistics:

- (void) setEnableStatistics: (bool)  value

Sets whether to enable statistics.

◆ statistics

- (FMLiveSwitchPoolStatistics*) statistics

Gets the pool usage statistics.

◆ takeWithSize:

- (FMLiveSwitchDataBuffer*) takeWithSize: (int)  size

Takes a buffer from the pool.

Parameters
sizeThe number of bytes needed.

Reimplemented from <FMLiveSwitchIDataBufferPool>.

◆ takeWithSize:littleEndian:

- (FMLiveSwitchDataBuffer*) takeWithSize: (int)  size
littleEndian: (bool)  littleEndian 

Takes a buffer from the pool.

Parameters
sizeThe number of bytes needed.
littleEndianWhether the data buffer should be little-endian.

Reimplemented from <FMLiveSwitchIDataBufferPool>.

◆ takeWithSize:littleEndian:clearBytes:

- (FMLiveSwitchDataBuffer*) takeWithSize: (int)  size
littleEndian: (bool)  littleEndian
clearBytes: (bool)  clearBytes 

Takes a buffer from the pool.

Parameters
sizeThe number of bytes needed.
littleEndianWhether the data buffer should be little-endian.
clearBytesWhether to clear the data buffer.

Reimplemented from <FMLiveSwitchIDataBufferPool>.

◆ traceStatistics

- (NSMutableArray*) traceStatistics

Gets all tagged pool usage statistics.