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 | Properties | List of all members
strange.extensions.pool.api.IPoolable Interface Reference

Interface for items that belong to a Pool. More...

Inheritance diagram for strange.extensions.pool.api.IPoolable:
strange.extensions.command.impl.Command strange.extensions.dispatcher.eventdispatcher.impl.TmEvent strange.extensions.pool.impl.Pool strange.extensions.command.impl.EventCommand strange.extensions.sequencer.impl.SequenceCommand strange.extensions.pool.impl.Pool< T > strange.extensions.sequencer.impl.EventSequenceCommand

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...
 

Detailed Description

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.

Member Function Documentation

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 ( )

Property Documentation

bool strange.extensions.pool.api.IPoolable.retain
get

Is this instance retained?

true if retained; otherwise, false.


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