Table of Contents

Class BufferPool

名前空間
easyar
アセンブリ
EasyAR.Sense.dll

BufferPool はメモリプールを実装します。カスタムカメラ接続など、同じサイズのメモリを繰り返し割り当てる必要がある機能に使用でき、メモリ割り当てにかかる時間を削減します。

public class BufferPool : RefBase, IDisposable
継承
BufferPool
実装
継承されたメンバー

コンストラクター

BufferPool(int, int)

block_size は各 `Buffer`_ のバイトサイズです。 capacity は `Buffer`_ の最大数です。

public BufferPool(int block_size, int capacity)

パラメーター

block_size
capacity

メソッド

Clone()

public BufferPool Clone()

block_size()

各 `Buffer`_ のバイトサイズ。

public virtual int block_size()

capacity()

`Buffer`_ の最大数。

public virtual int capacity()

size()

現在外部から取得されている `Buffer`_ の数。

public virtual int size()

tryAcquire()

メモリブロックの取得を試みます。現在外部から取得されている `Buffer`_ の数が最大 `Buffer`_ 数に達していない場合、新しい `Buffer`_ を取り出すか割り当てます。そうでない場合は空を返します。

public virtual Optional<Buffer> tryAcquire()