A very fast pseudo-collection (it does not implement IEnumerable<T>) that supports fast adding at the beginning.
More...
|
void | ForEach ([NotNull, InstantHandle] Action< T > action) |
| Performs the specified action on each element of the pool More...
|
|
void | Add ([NotNull] T item) |
| Adds an item to the beginning pool More...
|
|
bool | Remove ([NotNull] T item) |
| Removes the first occurrence of a specific object from the pool More...
|
|
void | Clear () |
| Removes all items from the pool More...
|
|
bool | Contains ([NotNull] T item) |
| Determines whether the pool contains a specific value. More...
|
|
void | RemoveAll ([NotNull, InstantHandle] Action< T > action) |
| Removes all the items in the buffer one-by-one, executing action after each removal. More...
|
|
void | RemoveWhere ([NotNull, InstantHandle] Predicate< T > predicate) |
| Removes all the items in the buffer that satisfy the condition defined by predicate . More...
|
|
void | RemoveFirst ([NotNull, InstantHandle] Predicate< T > predicate) |
| Removes the first item in the buffer that satisfies the condition defined by predicate . More...
|
|
|
int | Count [get] |
| Gets the number of elements contained in the pool More...
|
|
T | NextElement [get, set] |
| A reference to the next element in the Pool<T> chain. More...
|
|
A very fast pseudo-collection (it does not implement IEnumerable<T>) that supports fast adding at the beginning.
An item can always only be in one pool at any given time.
- Template Parameters
-
T | The type of items to store in the pool. |
◆ Add()
Adds an item to the beginning pool
- Parameters
-
item | The object to add to the pool |
- Exceptions
-
ArgumentException | item is already in a pool. |
◆ Clear()
Removes all items from the pool
◆ Contains()
Determines whether the pool contains a specific value.
- Parameters
-
item | The object to locate in the pool |
- Returns
true
if item is found in the pool; otherwise, false.
◆ ForEach()
Performs the specified action on each element of the pool
- Parameters
-
action | A delegate to perform on each element of the pool |
◆ Remove()
Removes the first occurrence of a specific object from the pool
- Parameters
-
item | The object to remove from the pool |
- Returns
true
if item was successfully removed from the buffer list; otherwise, false. This method also returns false
if item is not found in the original pool
Not all too fast, try to avoid using this
◆ RemoveAll()
Removes all the items in the buffer one-by-one, executing action after each removal.
- Parameters
-
action | A delegate that is executed right after an item is removed. |
Ideal for moving all elements to a new data structure.
◆ RemoveFirst()
Removes the first item in the buffer that satisfies the condition defined by predicate .
- Parameters
-
predicate | A delegate that defines the condition to check for. |
Ideal for selectively picking the first suitable element from the pool.
◆ RemoveWhere()
Removes all the items in the buffer that satisfy the condition defined by predicate .
- Parameters
-
predicate | A delegate that defines the condition to check for. |
Ideal for selectively picking all suitable elements from the pool.
◆ Count
Gets the number of elements contained in the pool
- Returns
- The number of elements contained in the pool
The documentation for this class was generated from the following file:
- OmegaEngine/Collections/Pool.cs