StrangeIoC
0.6.0
The IoC/Binding Framework for Unity3D and C#
|
Interface for items that belong to a Pool. More...
Public Member Functions | |
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... | |
Properties | |
bool | retain [get] |
Is this instance retained? More... | |
Interface for items that belong to a Pool.
Instances that belong to a Pool usually need to be cleaned up for later reuse. This is both an aspect of careful instance wrangling and of memory management, since you want to release any memory references possibly attached to the poolable items. If your instances implement IPoolable, place all cleanup code inside Restore(), and the cleanup will occur automatically when the instance is returned to the Pool.
If you cannot or do not wish to implement IPoolable, that's entirely allowable, but know that it will be your responsibility to clean up an instance BEFORE returning it to the Pool.
void strange.extensions.pool.api.IPoolable.Release | ( | ) |
Release this instance back to the pool.
Release methods should clean up the instance sufficiently to remove prior state.
Implemented in strange.extensions.pool.impl.Pool, strange.extensions.command.impl.Command, strange.extensions.dispatcher.eventdispatcher.impl.TmEvent, strange.extensions.sequencer.impl.SequenceCommand, and strange.extensions.command.impl.EventCommand.
void strange.extensions.pool.api.IPoolable.Restore | ( | ) |
Clean up this instance for reuse.
Restore methods should clean up the instance sufficiently to remove prior state.
Implemented in strange.extensions.pool.impl.Pool, strange.extensions.command.impl.Command, and strange.extensions.dispatcher.eventdispatcher.impl.TmEvent.
void strange.extensions.pool.api.IPoolable.Retain | ( | ) |
Keep this instance from being returned to the pool
Implemented in strange.extensions.pool.impl.Pool, strange.extensions.command.impl.Command, strange.extensions.dispatcher.eventdispatcher.impl.TmEvent, and strange.extensions.command.impl.EventCommand.
|
get |
Is this instance retained?
true
if retained; otherwise, false
.