iOS Charting Documentation - SciChart iOS Charts SDK v3.x

SCIObjectPool

@interface SCIObjectPool<T> : NSObject <ISCICleanable>

Defines a simple object pool implementation which allows to reuse object instances.

  • Initializes a new SCIObjectPool instance.

    Declaration

    Objective-C

    - (instancetype)initWithFactory:(SCIFactory)factory;

    Swift

    init!(factory: SCIFactory!)

    Parameters

    factory

    The default factory which allows to create new instances for pooling.

  • Gets the size of pool.

    Declaration

    Objective-C

    @property (nonatomic, readonly) unsigned int count;

    Swift

    var count: UInt32 { get }
  • Get the value indicating whether the pool is empty.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL isEmpty;

    Swift

    var isEmpty: Bool { get }
  • Gets the item from the pool, if pool is empty default object factory is used.

    Declaration

    Objective-C

    - (T)get;

    Swift

    func get() -> T!

    Return Value

    Object from pool.

  • Gets the item from the pool, if pool is empty default object factory is used.

    Declaration

    Objective-C

    - (T)getWithFactory:(SCIFactory)factory;

    Swift

    func getWithFactory(_ factory: SCIFactory!) -> T!

    Parameters

    factory

    The factory to use if pool doesn’t have enough items.

    Return Value

    Object from pool.

  • Put item into pool for further reusing.

    Declaration

    Objective-C

    - (void)put:(T)item;

    Swift

    func put(_ item: T!)

    Parameters

    item

    The item to put into this pool.