Class OrderedRegistry<T>
Represents a thread-safe registry of T which is ordered by item's Order property.
This class is efficient for concurrent read access and is not designed for cases when frequent modifications happen.
It is ideal for lookup of named instances that have much longer time span than components that look them up.
Note: since registry does reading in a lock-free manner, it is possible to have an inconsistent read snapshot
of ordered items which may capture items that have already/not yet been added to the registry
Inheritance
System.Object
OrderedRegistry<T>
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.dll
Syntax
[Serializable]
public class OrderedRegistry<T> : Registry<T>, IOrderedRegistry<T>, IRegistry<T>, IEnumerable<T>, IEnumerable where T : INamed, IOrdered
Type Parameters
Constructors
OrderedRegistry()
Declaration
OrderedRegistry(Boolean)
Declaration
public OrderedRegistry(bool caseSensitive)
Parameters
Type |
Name |
Description |
System.Boolean |
caseSensitive |
|
Properties
Item[Int32]
Tries to return an item by its position index in ordered set of items that this registry keeps.
Null is returned when index is out of bounds.
Note: since registry does reading in a lock-free manner, it is possible to have an inconsistent read snapshot
of ordered items which may capture items that have already/not yet been added to the registry
Declaration
public T this[int index] { get; }
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Property Value
OrderedValues
Returns items that registry contains ordered by their Order property.
The returned sequence is pre-sorted during alteration of registry, so this property access is efficient.
Note: since registry does reading in a lock-free manner, it is possible to have an inconsistent read snapshot
of ordered items which may capture items that have already/not yet been added to the registry
Declaration
public IEnumerable<T> OrderedValues { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<T> |
|
Methods
Clear()
Deletes all items from ordered registry
Declaration
public override void Clear()
Overrides
Azos.Collections.Registry<T>.Clear()
JustRegistered(T)
Declaration
protected override void JustRegistered(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Overrides
Azos.Collections.Registry<T>.JustRegistered(T)
JustReplaced(T, T)
Declaration
protected override void JustReplaced(T existingItem, T newItem)
Parameters
Type |
Name |
Description |
T |
existingItem |
|
T |
newItem |
|
Overrides
Azos.Collections.Registry<T>.JustReplaced(T, T)
JustUnregistered(T)
Declaration
protected override void JustUnregistered(T item)
Parameters
Type |
Name |
Description |
T |
item |
|
Overrides
Azos.Collections.Registry<T>.JustUnregistered(T)
Implements
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods