SMath.Extensibility.Collections Namespace

 

Classes

GrowingOnlyLinkedListT

A thread safe collection which is based on a linked list and supports only addition and iteration.

Synchronization of iteration is based on the following facts:

  • Head of the list is never changed except the very first addition. It means that every non-empty iterator starts with the same node.
  • Any addition is atomic in terms of iteration because iteration is affected by assignment of either the head node or the last node in the linked list and assignment is atomic.

Note that addition operation itself is not atomic because it also moves the tail of the list. That is why synchronization of additions is implemented via lock { ... } blocks inside Add(T) and AddRange(IEnumerableT) methods.

LargeComponentInfoSet

Implementation of IComponentInfoSet which is based on DictionaryTKey, TValue.

  Note

Performance of Add(IComponentInfo) method implemented here is O(log(N)) which is achieved by cost of memory. This implementation should be used in scenarios where the number of items may be large and new items are added intensively.

PredefinedComponentInfoSet Implementation of IComponentInfoSet which has predefined items and cannot be changed (i.e., all operations which should modify the set do nothing).
SmallComponentInfoSet

Implementation of IComponentInfoSet which is based on unsorted ListT.

  Note

Performance of Add(IComponentInfo) method implemented here is O(N). This implementation should be used in scenarios where the number of items is small (1-5) so it is better to optimize memory usage rather than performance.

Interfaces

IComponentInfoSet A set of IComponentInfo items stored by PublicGuid.
IGrowingOnlyEnumerableT Extension of IEnumerableT which is implemented by growing only collections and provides a check for emptiness.
IPluginCollection

A collection of IPluginContainer items.

IPluginCollectionView Provides filtering of IPluginCollection with caching of results. The view tracks Version and updates automatically after any change of the Parent collection. The order of items in the view is defined by Comparer.
IPluginContainer Container for an instance of class which implements one or more interfaces derived from IPlugin.
IPluginEntityCollectionT Base interface for collections of plug-in entities.
IPluginEntityMultiSetT

A collection of plug-in entities which stores multiple entities per key.

  Note

The order of items in this collection is arbitrary and may change in future. Use explicit sorting of IEnumerableT results (for example, by LoadOrder or via Instance) if the order is important.

IPluginEntitySetT

A collection of plug-in entities which stores a single entity per key.

  Note

The order of items in this collection is arbitrary and may change in future. Use explicit sorting of IEnumerableT results (for example, by LoadOrder or via Instance) if the order is important.

IPluginModuleCollection

Collection of information about the loaded plug-ins.

  Note

The order of items in this collection is arbitrary and may change in future. Use explicit sorting of IEnumerableT results (for example, by LoadOrder or via Instance) if the order is important.

Delegates

SelectPluginContainers Filters the specified collection of IPluginContainer items and sorts the resulting items.