Example #1
0
 /// <summary>
 /// Creates a new instance of ObjectPool with n-number of pre-created
 /// objects in the pool.
 /// </summary>
 /// <param name="pof">
 /// Factory class to be used by ObjectPool to
 /// create new poolable object instance when required.
 /// </param>
 /// <param name="bCreateObjects">
 /// Flag identifying whether this ObjectPool instance
 /// is allowed to create new objects when the pool is empty
 /// and the user requested a new object from the pool.
 /// </param>
 /// <param name="objectCount">Numberof objects to pre-create</param>
 public ObjectPool(PoolableObjectFactory pof, bool bCreateObjects, int objectCount)
 {
     _pof            = pof;
     _bCreateObjects = bCreateObjects;
     Init(objectCount);
 }
Example #2
0
 /// <summary>
 /// Creates a new instance of ObjectPool
 /// </summary>
 /// <param name="pof">
 /// Factory class to be used by ObjectPool to
 /// create new poolable object instance when required.
 /// </param>
 /// <param name="bCreateObjects">
 /// Flag identifying whether this ObjectPool instance
 /// is allowed to create new objects when the pool is empty
 /// and the user requested a new object from the pool.
 /// </param>
 public ObjectPool(PoolableObjectFactory pof, bool bCreateObjects)
 {
     _pof            = pof;
     _bCreateObjects = bCreateObjects;
     Init(0);
 }