Class FrequentReadSynchronizedList<T>
Synchronized List for inserts/removes. Unsynchronized for reads. Optimized for frequent reads relative to writes.
Inheritance
System.Object
FrequentReadSynchronizedList<T>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: FM.LiveSwitch
Assembly: FM.LiveSwitch.dll
Syntax
public abstract class FrequentReadSynchronizedList<T>
Type Parameters
Name | Description |
---|---|
T |
Constructors
FrequentReadSynchronizedList()
Creates an instance of a FrequentReadSynchronizedList<T>.
Declaration
protected FrequentReadSynchronizedList()
FrequentReadSynchronizedList(Object)
Creates an instance of a FrequentReadSynchronizedList<T>.
Synchronization object.Declaration
protected FrequentReadSynchronizedList(object lockObject)
Parameters
Type | Name | Description |
---|---|---|
System.Object | lockObject |
Properties
Count
Gets the count of items in the list.
Declaration
public long Count { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Values
Gets the values in the collection not subject to synchronization and Concurrent Modification/Access issues. May be missing newly added or removed values.
Declaration
public T[] Values { get; }
Property Value
Type | Description |
---|---|
T[] |
Methods
Add(T)
Synchronized insert into collection at the end of the list.
Declaration
public void Add(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value |
Clear()
Clears the list.
Declaration
public void Clear()
GetArray(Int32)
Gets an array of a given type of a given length.
Declaration
protected abstract T[] GetArray(int count)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | count | The count. |
Returns
Type | Description |
---|---|
T[] |
Insert(Int32, T)
Synchronized insert into collection at a given index.
Declaration
public void Insert(int index, T value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index |
T | value | Value |
Remove(T)
Synchronized remove from collection.
Declaration
public void Remove(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | Value |
RemoveAt(Int32)
Synchronized remove from collection at a specified index.
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | Index |