StrangeIoC  0.6.0
The IoC/Binding Framework for Unity3D and C#
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public Member Functions | Protected Member Functions | Protected Attributes | Properties | List of all members
strange.extensions.pool.impl.Pool Class Reference
Inheritance diagram for strange.extensions.pool.impl.Pool:
strange.extensions.pool.api.IPool strange.extensions.pool.api.IPoolable strange.framework.api.IManagedList strange.extensions.pool.impl.Pool< T >

Public Member Functions

virtual IManagedList Add (object value)
 Add a value to this List.
 
virtual IManagedList Add (object[] list)
 Add a set of values to this List.
 
virtual IManagedList Remove (object value)
 Remove a value from this List.
 
virtual IManagedList Remove (object[] list)
 Remove a set of values from this List.
 
virtual object GetInstance ()
 Gets an instance from the pool if one is available. More...
 
virtual void ReturnInstance (object value)
 Returns an instance to the pool. More...
 
virtual void Clean ()
 Remove all instance references from the Pool. More...
 
void Restore ()
 Clean up this instance for reuse. More...
 
void Retain ()
 Keep this instance from being returned to the pool More...
 
void Release ()
 Release this instance back to the pool. More...
 

Protected Member Functions

virtual void removeInstance (object value)
 Permanently removes an instance from the Pool More...
 
void failIf (bool condition, string message, PoolExceptionType type)
 

Protected Attributes

Stack instancesAvailable = new Stack ()
 Stack of instances still in the Pool.
 
HashSet< object > instancesInUse = new HashSet<object> ()
 A HashSet of the objects checked out of the Pool.
 
int _instanceCount
 

Properties

IInstanceProvider instanceProvider [get, set]
 
virtual object value [get]
 
virtual bool uniqueValues [get, set]
 
virtual Enum constraint [get, set]
 
System.Type poolType [get, set]
 The object Type of the first object added to the pool. More...
 
int instanceCount [get]
 
virtual int available [get]
 
virtual int size [get, set]
 
virtual PoolOverflowBehavior overflowBehavior [get, set]
 
virtual PoolInflationType inflationType [get, set]
 
bool retain [get, set]
 
- Properties inherited from strange.extensions.pool.api.IPool
IInstanceProvider instanceProvider [get, set]
 A class that provides instances to the pool when it needs them. More...
 
Type poolType [get, set]
 The object Type of the first object added to the pool. More...
 
int available [get]
 Returns the count of non-committed instances More...
 
int size [get, set]
 Gets or sets the size of the pool. More...
 
int instanceCount [get]
 Returns the total number of instances currently managed by this pool. More...
 
PoolOverflowBehavior overflowBehavior [get, set]
 Gets or sets the overflow behavior of this pool. More...
 
PoolInflationType inflationType [get, set]
 Gets or sets the type of inflation for infinite-sized pools. More...
 
- Properties inherited from strange.framework.api.IManagedList
object value [get]
 Retrieve the value of this List. More...
 
- Properties inherited from strange.extensions.pool.api.IPoolable
bool retain [get]
 Is this instance retained? More...
 

Detailed Description

See Also
strange.extensions.pool.api.IPool

Member Function Documentation

virtual void strange.extensions.pool.impl.Pool.Clean ( )
inlinevirtual

Remove all instance references from the Pool.

Implements strange.extensions.pool.api.IPool.

virtual object strange.extensions.pool.impl.Pool.GetInstance ( )
inlinevirtual

Gets an instance from the pool if one is available.

Returns
The instance.

Implements strange.extensions.pool.api.IPool.

Reimplemented in strange.extensions.pool.impl.Pool< T >.

void strange.extensions.pool.impl.Pool.Release ( )
inline

Release this instance back to the pool.

Release methods should clean up the instance sufficiently to remove prior state.

Implements strange.extensions.pool.api.IPoolable.

virtual void strange.extensions.pool.impl.Pool.removeInstance ( object  value)
inlineprotectedvirtual

Permanently removes an instance from the Pool

In the event that the removed Instance is in use, it is removed from instancesInUse. Otherwise, it is presumed inactive, and the next available object is popped from instancesAvailable.

Parameters
valueAn instance to remove permanently from the Pool.
void strange.extensions.pool.impl.Pool.Restore ( )
inline

Clean up this instance for reuse.

Restore methods should clean up the instance sufficiently to remove prior state.

Implements strange.extensions.pool.api.IPoolable.

void strange.extensions.pool.impl.Pool.Retain ( )
inline

Keep this instance from being returned to the pool

Implements strange.extensions.pool.api.IPoolable.

virtual void strange.extensions.pool.impl.Pool.ReturnInstance ( object  value)
inlinevirtual

Returns an instance to the pool.

If the instance being released implements IPoolable, the Release() method will be called.

Parameters
valueThe instance to be return to the pool.

Implements strange.extensions.pool.api.IPool.

Property Documentation

System.Type strange.extensions.pool.impl.Pool.poolType
getset

The object Type of the first object added to the pool.

Pool objects must be of the same concrete type. This property enforces that requirement.


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