Space Engineers
Public Member Functions | List of all members
VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType > Class Template Reference

Public Member Functions

 MyCachingDynamicObjectsPool ()
 
 MyCachingDynamicObjectsPool (int poolSize)
 
 MyCachingDynamicObjectsPool (int poolSize, int cacheSize)
 
 MyCachingDynamicObjectsPool (int poolSize, int cacheSize, int poolGrowth)
 
ObjectType Allocate ()
 
void Deallocate (ObjectType obj)
 
void Deallocate (ObjectKey key, ObjectType obj)
 
bool TryAllocateCached (ObjectKey key, out ObjectType obj)
 

Detailed Description

This class provides similar functionality to MyDynamicObjectsPool with the addition of caching facilities.

The cache is intended to be used for objects that once allocated either perform expensive computations or allocate a lot of memory and that may be needed again after disposed in the same state.

Type Constraints
ObjectType :IDisposable 
ObjectType :new() 

Definition at line 15 of file MyCachingDynamicObjectsPool.cs.

Constructor & Destructor Documentation

Definition at line 29 of file MyCachingDynamicObjectsPool.cs.

VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType >.MyCachingDynamicObjectsPool ( int  poolSize)
inline

Definition at line 34 of file MyCachingDynamicObjectsPool.cs.

VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType >.MyCachingDynamicObjectsPool ( int  poolSize,
int  cacheSize 
)
inline

Definition at line 39 of file MyCachingDynamicObjectsPool.cs.

VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType >.MyCachingDynamicObjectsPool ( int  poolSize,
int  cacheSize,
int  poolGrowth 
)
inline

Definition at line 44 of file MyCachingDynamicObjectsPool.cs.

Member Function Documentation

ObjectType VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType >.Allocate ( )
inline

Definition at line 58 of file MyCachingDynamicObjectsPool.cs.

void VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType >.Deallocate ( ObjectType  obj)
inline

Deallocate object without key.

Object is disposed be callee.

Definition at line 87 of file MyCachingDynamicObjectsPool.cs.

void VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType >.Deallocate ( ObjectKey  key,
ObjectType  obj 
)
inline

Deallocate object with key.

Object is cached and disposed if necessary.

Definition at line 98 of file MyCachingDynamicObjectsPool.cs.

bool VRage.Generics.MyCachingDynamicObjectsPool< ObjectKey, ObjectType >.TryAllocateCached ( ObjectKey  key,
out ObjectType  obj 
)
inline

Allocate an object that may be cached.

Returns true if the object was found in the cache and false otherwise.

Definition at line 119 of file MyCachingDynamicObjectsPool.cs.


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