Stores two synchronized collections: a mutable dictionary and an immutable array. Slower inserts/removes than a normal dictionary, but provides safe iteration while maintaining fast hash lookups
More...
|
| MapAndArray () |
| Constructor More...
|
|
| MapAndArray (int capacity) |
| Constructor More...
|
|
bool | AddOrReplace (TKey key, TValue value) |
| Adds a key/value pair to the collection, or updates an existing key with a new value More...
|
|
int | Add (TKey key, TValue value) |
| Adds a key/value pair to the collection. This will throw an exception if the key is already present in the collection More...
|
|
bool | Remove (TKey key) |
| Removes a key/value pair from the collection More...
|
|
bool | ContainsKey (TKey key) |
| Determines whether the collections contains a specified key More...
|
|
bool | TryGetValue (TKey key, out TValue value) |
| Gets the value associated with the specified key More...
|
|
void | Clear () |
| Clears all key/value pairs from the collection More...
|
|
TValue[] | GetArray () |
| Gets a reference to the immutable array of values stored in this collection. This array is thread safe for iteration More...
|
|
|
int | Count [get] |
| Number of values currently stored in the collection More...
|
|
object | SyncRoot [get] |
| NOTE: This collection is thread safe. You do not need to acquire a lock to add, remove, or enumerate entries. This synchronization object should only be locked for larger transactions More...
|
|
Stores two synchronized collections: a mutable dictionary and an immutable array. Slower inserts/removes than a normal dictionary, but provides safe iteration while maintaining fast hash lookups
- Template Parameters
-
TKey | Key type to use for hash lookups |
TValue | Value type to store |
Definition at line 40 of file MapAndArray.cs.
OpenSim.Framework.MapAndArray< TKey, TValue >.MapAndArray |
( |
| ) |
|
|
inline |
OpenSim.Framework.MapAndArray< TKey, TValue >.MapAndArray |
( |
int |
capacity | ) |
|
|
inline |
Constructor
- Parameters
-
capacity | Initial capacity of the dictionary |
Definition at line 67 of file MapAndArray.cs.
int OpenSim.Framework.MapAndArray< TKey, TValue >.Add |
( |
TKey |
key, |
|
|
TValue |
value |
|
) |
| |
|
inline |
Adds a key/value pair to the collection. This will throw an exception if the key is already present in the collection
- Parameters
-
key | Key to add or update |
value | Value to add |
- Returns
- Index of the inserted item
Definition at line 101 of file MapAndArray.cs.
bool OpenSim.Framework.MapAndArray< TKey, TValue >.AddOrReplace |
( |
TKey |
key, |
|
|
TValue |
value |
|
) |
| |
|
inline |
Adds a key/value pair to the collection, or updates an existing key with a new value
- Parameters
-
key | Key to add or update |
value | Value to add |
- Returns
- True if a new key was added, false if an existing key was updated
Definition at line 81 of file MapAndArray.cs.
void OpenSim.Framework.MapAndArray< TKey, TValue >.Clear |
( |
| ) |
|
|
inline |
Clears all key/value pairs from the collection
Definition at line 156 of file MapAndArray.cs.
bool OpenSim.Framework.MapAndArray< TKey, TValue >.ContainsKey |
( |
TKey |
key | ) |
|
|
inline |
Determines whether the collections contains a specified key
- Parameters
-
- Returns
- True if the key was found, otherwise false
Definition at line 132 of file MapAndArray.cs.
TValue [] OpenSim.Framework.MapAndArray< TKey, TValue >.GetArray |
( |
| ) |
|
|
inline |
Gets a reference to the immutable array of values stored in this collection. This array is thread safe for iteration
- Returns
- A thread safe reference ton an array of all of the stored values
Definition at line 171 of file MapAndArray.cs.
bool OpenSim.Framework.MapAndArray< TKey, TValue >.Remove |
( |
TKey |
key | ) |
|
|
inline |
Removes a key/value pair from the collection
- Parameters
-
- Returns
- True if the key was found and removed, otherwise false
Definition at line 116 of file MapAndArray.cs.
bool OpenSim.Framework.MapAndArray< TKey, TValue >.TryGetValue |
( |
TKey |
key, |
|
|
out TValue |
value |
|
) |
| |
|
inline |
Gets the value associated with the specified key
- Parameters
-
key | Key of the value to get |
value | Will contain the value associated with the given key if the key is found. If the key is not found it will contain the default value for the type of the value parameter |
- Returns
- True if the key was found and a value was retrieved, otherwise false
Definition at line 147 of file MapAndArray.cs.
int OpenSim.Framework.MapAndArray< TKey, TValue >.Count |
|
get |
Number of values currently stored in the collection
Definition at line 47 of file MapAndArray.cs.
object OpenSim.Framework.MapAndArray< TKey, TValue >.SyncRoot |
|
get |
NOTE: This collection is thread safe. You do not need to acquire a lock to add, remove, or enumerate entries. This synchronization object should only be locked for larger transactions
Definition at line 52 of file MapAndArray.cs.
The documentation for this class was generated from the following file: