Class SynchronizedLinks<TLinkAddress>
- Namespace
- Platform.Data.Doublets
- Assembly
- Platform.Data.Doublets.dll
Synchronizes access to an underlying link store.
public class SynchronizedLinks<TLinkAddress> : ISynchronizedLinks<TLinkAddress>, ISynchronizedLinks<TLinkAddress, ILinks<TLinkAddress>, LinksConstants<TLinkAddress>>, ISynchronized<ILinks<TLinkAddress>>, ILinks<TLinkAddress>, ILinks<TLinkAddress, LinksConstants<TLinkAddress>> where TLinkAddress : IUnsignedNumber<TLinkAddress>
Type Parameters
TLinkAddress
- Inheritance
-
SynchronizedLinks<TLinkAddress>
- Implements
-
ISynchronizedLinks<TLinkAddress>ISynchronized<ILinks<TLinkAddress>>ILinks<TLinkAddress>ILinks<TLinkAddress, LinksConstants<TLinkAddress>>
- Inherited Members
- Extension Methods
Remarks
TODO: Autogeneration of synchronized wrapper (decorator). TODO: Try to unfold code of each method using IL generation for performance improvements. TODO: Or even to unfold multiple layers of implementations.
Constructors
SynchronizedLinks(ILinks<TLinkAddress>)
Initializes a new SynchronizedLinks<TLinkAddress> instance.
public SynchronizedLinks(ILinks<TLinkAddress> links)
Parameters
linksILinks<TLinkAddress>A links.
SynchronizedLinks(ISynchronization, ILinks<TLinkAddress>)
Initializes a new SynchronizedLinks<TLinkAddress> instance.
public SynchronizedLinks(ISynchronization synchronization, ILinks<TLinkAddress> links)
Parameters
synchronizationISynchronizationA synchronization.
linksILinks<TLinkAddress>A links.
Properties
Constants
Gets the constants value.
public LinksConstants<TLinkAddress> Constants { get; }
Property Value
- LinksConstants<TLinkAddress>
Sync
Gets the sync value.
public ILinks<TLinkAddress> Sync { get; }
Property Value
- ILinks<TLinkAddress>
SyncRoot
Gets the sync root value.
public ISynchronization SyncRoot { get; }
Property Value
- ISynchronization
Unsync
Gets the unsync value.
public ILinks<TLinkAddress> Unsync { get; }
Property Value
- ILinks<TLinkAddress>
Methods
Count(IList<TLinkAddress>?)
Counts the restriction.
public TLinkAddress Count(IList<TLinkAddress>? restriction)
Parameters
restrictionIList<TLinkAddress>The restriction.
Returns
- TLinkAddress
The link address
Create(IList<TLinkAddress>?, WriteHandler<TLinkAddress>?)
Creates the substitution.
public TLinkAddress Create(IList<TLinkAddress>? substitution, WriteHandler<TLinkAddress>? handler)
Parameters
substitutionIList<TLinkAddress>The substitution.
handlerWriteHandler<TLinkAddress>Optional callback; null continues without invoking a callback.
Returns
- TLinkAddress
The link address
Delete(IList<TLinkAddress>?, WriteHandler<TLinkAddress>?)
Deletes the substitution.
public TLinkAddress Delete(IList<TLinkAddress>? restriction, WriteHandler<TLinkAddress>? handler)
Parameters
restrictionIList<TLinkAddress>The substitution.
handlerWriteHandler<TLinkAddress>Optional callback; null continues without invoking a callback.
Returns
- TLinkAddress
Each(IList<TLinkAddress>?, ReadHandler<TLinkAddress>?)
Eaches the handler.
public TLinkAddress Each(IList<TLinkAddress>? restriction, ReadHandler<TLinkAddress>? handler)
Parameters
restrictionIList<TLinkAddress>The substitution.
handlerReadHandler<TLinkAddress>The handler.
Returns
- TLinkAddress
The link address
Update(IList<TLinkAddress>?, IList<TLinkAddress>?, WriteHandler<TLinkAddress>?)
Updates the substitution.
public TLinkAddress Update(IList<TLinkAddress>? restriction, IList<TLinkAddress>? substitution, WriteHandler<TLinkAddress>? handler)
Parameters
restrictionIList<TLinkAddress>The substitution.
substitutionIList<TLinkAddress>The substitution.
handlerWriteHandler<TLinkAddress>Optional callback; null continues without invoking a callback.
Returns
- TLinkAddress
The link address