FMLiveSwitchPool Class Reference

A pool of objects. More...

Instance Methods

(bool) - destroyWithDestroyCallback:
 Removes all items from the pool and calls a callback for each one. More...
 
(T) - destroyWithDestroyCallbackBlock
 Removes all items from the pool and calls a callback for each one. More...
 
(bool) - destroyWithDestroyCallbackBlock:
 Removes all items from the pool and calls a callback for each one. More...
 
(T) - get
 Gets an object. More...
 
(instancetype) - initWithCreateObject:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647. More...
 
(instancetype) - initWithCreateObject:minSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647. More...
 
(instancetype) - initWithCreateObject:minSize:maxSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class. More...
 
(instancetype) - initWithCreateObjectBlock:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647. More...
 
(instancetype) - initWithCreateObjectBlock:minSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647. More...
 
(instancetype) - initWithCreateObjectBlock:minSize:maxSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class. More...
 
(int) - maxSize
 Gets the maximum size. More...
 
(int) - minSize
 Gets the minimum size. More...
 
(bool) - putWithItem:
 Put an object back. More...
 
(int) - size
 Gets the current size of the pool. More...
 

Class Methods

(FMLiveSwitchPool *) + poolWithCreateObject:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647. More...
 
(FMLiveSwitchPool *) + poolWithCreateObject:minSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647. More...
 
(FMLiveSwitchPool *) + poolWithCreateObject:minSize:maxSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class. More...
 
(FMLiveSwitchPool *) + poolWithCreateObjectBlock:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647. More...
 
(FMLiveSwitchPool *) + poolWithCreateObjectBlock:minSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647. More...
 
(FMLiveSwitchPool *) + poolWithCreateObjectBlock:minSize:maxSize:
 Initializes a new instance of the FMLiveSwitchPool`1 class. More...
 

Protected Attributes

 __pad0__: NSObject- (int) available
 

Detailed Description

A pool of objects.

Method Documentation

◆ destroyWithDestroyCallback:

- (bool) destroyWithDestroyCallback: (FMLiveSwitchAction1< T > *)  destroyCallback

Removes all items from the pool and calls a callback for each one.

Parameters
destroyCallback

◆ destroyWithDestroyCallbackBlock

- T destroyWithDestroyCallbackBlock

Removes all items from the pool and calls a callback for each one.

@inlineparam destroyCallbackBlock

◆ destroyWithDestroyCallbackBlock:

- (bool) destroyWithDestroyCallbackBlock: (void(^)(T))  destroyCallbackBlock

Removes all items from the pool and calls a callback for each one.

Parameters
destroyCallbackBlock

◆ get

- T get

Gets an object.

◆ initWithCreateObject:

- (instancetype) initWithCreateObject: (FMLiveSwitchFunction0< T > *)  createObject

Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647.

Parameters
createObjectA function that creates an object.

◆ initWithCreateObject:minSize:

- (instancetype) initWithCreateObject: (FMLiveSwitchFunction0< T > *)  createObject
minSize: (int)  minSize 

Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647.

Parameters
createObjectA function that creates an object.
minSizeThe minimum size.

◆ initWithCreateObject:minSize:maxSize:

- (instancetype) initWithCreateObject: (FMLiveSwitchFunction0< T > *)  createObject
minSize: (int)  minSize
maxSize: (int)  maxSize 

Initializes a new instance of the FMLiveSwitchPool`1 class.

with a specified minimum size and a specified maximum size.

Parameters
createObjectA function that creates an object.
minSizeThe minimum size.
maxSizeThe maximum size.

◆ initWithCreateObjectBlock:

- (instancetype) initWithCreateObjectBlock: (T(^)(void))  createObjectBlock

Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647.

Parameters
createObjectBlockA function that creates an object.

◆ initWithCreateObjectBlock:minSize:

- (instancetype) initWithCreateObjectBlock: (T(^)(void))  createObjectBlock
minSize: (int)  minSize 

Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647.

Parameters
createObjectBlockA function that creates an object.
minSizeThe minimum size.

◆ initWithCreateObjectBlock:minSize:maxSize:

- (instancetype) initWithCreateObjectBlock: (T(^)(void))  createObjectBlock
minSize: (int)  minSize
maxSize: (int)  maxSize 

Initializes a new instance of the FMLiveSwitchPool`1 class.

with a specified minimum size and a specified maximum size.

Parameters
createObjectBlockA function that creates an object.
minSizeThe minimum size.
maxSizeThe maximum size.

◆ maxSize

- (int) maxSize

Gets the maximum size.

Value must be >= 0. A value of 0 indicates no maximum.

◆ minSize

- (int) minSize

Gets the minimum size.

Value must be >= 0.

◆ poolWithCreateObject:

+ (FMLiveSwitchPool*) poolWithCreateObject: (FMLiveSwitchFunction0< T > *)  createObject

Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647.

Parameters
createObjectA function that creates an object.

◆ poolWithCreateObject:minSize:

+ (FMLiveSwitchPool*) poolWithCreateObject: (FMLiveSwitchFunction0< T > *)  createObject
minSize: (int)  minSize 

Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647.

Parameters
createObjectA function that creates an object.
minSizeThe minimum size.

◆ poolWithCreateObject:minSize:maxSize:

+ (FMLiveSwitchPool*) poolWithCreateObject: (FMLiveSwitchFunction0< T > *)  createObject
minSize: (int)  minSize
maxSize: (int)  maxSize 

Initializes a new instance of the FMLiveSwitchPool`1 class.

with a specified minimum size and a specified maximum size.

Parameters
createObjectA function that creates an object.
minSizeThe minimum size.
maxSizeThe maximum size.

◆ poolWithCreateObjectBlock:

+ (FMLiveSwitchPool*) poolWithCreateObjectBlock: (T(^)(void))  createObjectBlock

Initializes a new instance of the FMLiveSwitchPool`1 class with a minimum size of 0 and a maximum size of 2,147,483,647.

Parameters
createObjectBlockA function that creates an object.

◆ poolWithCreateObjectBlock:minSize:

+ (FMLiveSwitchPool*) poolWithCreateObjectBlock: (T(^)(void))  createObjectBlock
minSize: (int)  minSize 

Initializes a new instance of the FMLiveSwitchPool`1 class with a specified minimum size and a maximum size of 2,147,483,647.

Parameters
createObjectBlockA function that creates an object.
minSizeThe minimum size.

◆ poolWithCreateObjectBlock:minSize:maxSize:

+ (FMLiveSwitchPool*) poolWithCreateObjectBlock: (T(^)(void))  createObjectBlock
minSize: (int)  minSize
maxSize: (int)  maxSize 

Initializes a new instance of the FMLiveSwitchPool`1 class.

with a specified minimum size and a specified maximum size.

Parameters
createObjectBlockA function that creates an object.
minSizeThe minimum size.
maxSizeThe maximum size.

◆ putWithItem:

- (bool) putWithItem: (T)  item

Put an object back.

Parameters
item

◆ size

- (int) size

Gets the current size of the pool.

Member Data Documentation

◆ __pad0__

- __pad0__
protected