PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.PoolItem< T > Class Template Reference

More...

Inheritance diagram for PeanutButter.Utils.PoolItem< T >:
PeanutButter.Utils.IPoolItem< T >

Public Member Functions

 PoolItem (T instance, Action< T > onRelease, IPool< T > owner)
 Constructs a PooledItem around the provided instance of T.
 
bool TryLock (int maxWaitMilliseconds)
 Locks the pooled item for usage; disposing this pooled item container releases the lock.
 
void Dispose ()
 Releases the instance back to the pool.
 

Properties

Instance [get]
 The instance of the pooled item.
 
bool IsAvailable [get]
 Flag: is this instance available for usage.
 
- Properties inherited from PeanutButter.Utils.IPoolItem< T >

Detailed Description

Constructor & Destructor Documentation

◆ PoolItem()

PeanutButter.Utils.PoolItem< T >.PoolItem ( instance,
Action< T >  onRelease,
IPool< T >  owner 
)

Constructs a PooledItem around the provided instance of T.

Parameters
instance
onRelease
owner

Member Function Documentation

◆ TryLock()

bool PeanutButter.Utils.PoolItem< T >.TryLock ( int  maxWaitMilliseconds)

Locks the pooled item for usage; disposing this pooled item container releases the lock.

Implements PeanutButter.Utils.IPoolItem< T >.

Property Documentation

◆ Instance

T PeanutButter.Utils.PoolItem< T >.Instance
get

The instance of the pooled item.

Implements PeanutButter.Utils.IPoolItem< T >.

◆ IsAvailable

bool PeanutButter.Utils.PoolItem< T >.IsAvailable
get

Flag: is this instance available for usage.

Implements PeanutButter.Utils.IPoolItem< T >.


The documentation for this class was generated from the following file: