ISelfCreatingNewObjectHandler<T> Interface

public interface ISelfCreatingNewObjectHandler<T>

Represents an interface for an object capable of handling the withdrawal and depositing of objects. This is usually implemented by pools, however that is not a requirement. The handler should be capable of creating new objects whenever WithdrawObject is called (an no pooled object exist), and properly handling objects that are no longer needed when DepositObject is called.

Methods

DepositObject(T)

void DepositObject(T obj)

Deposits an object to the handler, which the handler will usually pool.

Parameters

Name Type Description
obj T

The object to give to the handler.


WithdrawObject()

T WithdrawObject()

Withdraws an object from the handler, either by creating it automatically or getting an existing one from the pool.

Returns

T
An object from the handler.