Space Engineers
|
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) |
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.
ObjectType | : | IDisposable | |
ObjectType | : | new() |
Definition at line 15 of file MyCachingDynamicObjectsPool.cs.
|
inline |
Definition at line 29 of file MyCachingDynamicObjectsPool.cs.
|
inline |
Definition at line 34 of file MyCachingDynamicObjectsPool.cs.
|
inline |
Definition at line 39 of file MyCachingDynamicObjectsPool.cs.
|
inline |
Definition at line 44 of file MyCachingDynamicObjectsPool.cs.
|
inline |
Definition at line 58 of file MyCachingDynamicObjectsPool.cs.
|
inline |
Deallocate object without key.
Object is disposed be callee.
Definition at line 87 of file MyCachingDynamicObjectsPool.cs.
|
inline |
Deallocate object with key.
Object is cached and disposed if necessary.
Definition at line 98 of file MyCachingDynamicObjectsPool.cs.
|
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.