-
Notifications
You must be signed in to change notification settings - Fork 1
ObjectPool
Hyomoto edited this page Jun 24, 2021
·
2 revisions
Jump To | Go Back |
Arguments | Methods | Variables |
---|
Holds a pool of objects that can be reused.
Name | Type | Purpose |
---|---|---|
new | method |
A method that returns a new object for this pool. |
Jump To | top |
put | get | size | is_empty | free | destroy |
---|
Returns: mixed
Name | Type | Purpose |
---|---|---|
value | mixed |
An object |
Puts an object into the pool and returns it.
Returns: mixed
Name | Type | Purpose |
---|---|---|
None |
Returns an object from the pool if it exists. Otherwise a new object is returned.
Returns: int
Name | Type | Purpose |
---|---|---|
None |
Returns the number of objects in the pool
Returns: bool
Name | Type | Purpose |
---|---|---|
None |
Returns true if the pool is empty.
Returns: self
Name | Type | Purpose |
---|---|---|
func | method |
A function |
Frees the objects in the pool. If func
is provided, each item will be passed into the function.
Returns: self
Name | Type | Purpose |
---|---|---|
func | method |
A function |
Destroys the internal stack. If func
is provided, each item will be passed into the function.
Jump To | top |
---|
Name | Type | Initial | Purpose |
---|---|---|---|
__New | undef |
_new == undefined ? function() { return {} } : _new | No description. |
__Pool | undef |
ds_stack_create() | No description. |
Devon Mullane 2020