Interface IConcurrentHashSet<TItem>
A hashed set which can be write/read concurrently.
Inherited Members
System.Collections.Generic.IEnumerable<TItem>.GetEnumerator()
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
public interface IConcurrentHashSet<TItem> : IEnumerable<TItem>, IEnumerable
Type Parameters
Name | Description |
---|---|
TItem |
Properties
| Improve this Doc View SourceCount
Gets the number of items in the set.
Declaration
int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The count. |
OnListChanged
An event which is triggered whenever the set is changed (an item is added or removed).
Declaration
IBlockingEvent<AGSHashSetChangedEventArgs<TItem>> OnListChanged { get; }
Property Value
Type | Description |
---|---|
IBlockingEvent<AGSHashSetChangedEventArgs<TItem>> | The event. |
Methods
| Improve this Doc View SourceAdd(TItem)
Add the specified item.
Declaration
bool Add(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | Item. |
Returns
Type | Description |
---|---|
System.Boolean | True if item was added, false if it was already in the set. |
AddRange(List<TItem>)
Adds the specified items.
Declaration
int AddRange(List<TItem> items)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<TItem> | items | Items. |
Returns
Type | Description |
---|---|
System.Int32 | The number of items that was actually added (were not already in the set). |
Clear()
Clears the set.
Declaration
void Clear()
Contains(TItem)
Is the specified item in the set?
Declaration
bool Contains(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | Item. |
Returns
Type | Description |
---|---|
System.Boolean | True if the item is in the set, false if it isn't. |
Remove(TItem)
Remove the specified item.
Declaration
bool Remove(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | Item. |
Returns
Type | Description |
---|---|
System.Boolean | True if item was removed, false if it was not in the set. |
RemoveAll(Predicate<TItem>)
Removes all items that match the predicate from the set.
Declaration
void RemoveAll(Predicate<TItem> shouldRemove)
Parameters
Type | Name | Description |
---|---|---|
System.Predicate<TItem> | shouldRemove | The predicate to decide which item should be removed. |