ForgeDocs
Documentation for the forge framework
|
Provides a queue where pushing is assumed to be done concurrently, but reading is done in a single-thread where no writing is done. More...
Public Member Functions | |
ConcurrentWriterBag () | |
Construct a new concurrent writer bag. More... | |
void | Add (T item) |
Adds the item in the collection. More... | |
List< T > | ToList () |
Returns all items inside of the bag as a list. This method is not thread safe. This method does not clear the collection. More... | |
void | IterateAndClear (Action< T > iterator) |
Calls the iterator over every item in the bag and then clears the bags that were iterated. More... | |
void | Dispose () |
Provides a queue where pushing is assumed to be done concurrently, but reading is done in a single-thread where no writing is done.
T | The type of object stored. |
Forge.Collections.ConcurrentWriterBag< T >.ConcurrentWriterBag | ( | ) |
Construct a new concurrent writer bag.
void Forge.Collections.ConcurrentWriterBag< T >.Add | ( | T | item | ) |
Adds the item in the collection.
This is a thread-safe function.
item | The item to enqueue |
void Forge.Collections.ConcurrentWriterBag< T >.IterateAndClear | ( | Action< T > | iterator | ) |
Calls the iterator over every item in the bag and then clears the bags that were iterated.
This method is NOT thread-safe; do NOT call Add while iterating the items.
iterator | The function to invoke on the items. |
List<T> Forge.Collections.ConcurrentWriterBag< T >.ToList | ( | ) |
Returns all items inside of the bag as a list. This method is not thread safe. This method does not clear the collection.