Table of Contents

Class RemapLinksDecorator<TLinkAddress>

Namespace
Foundation.Data.Doublets.Cli
Assembly
Foundation.Data.Doublets.Cli.dll

A links network under other addresses (issue #149): every address that goes down is mapped to the network's own, and every address that comes up is mapped back, so the code above never thinks about remapping. The JavaScript counterpart is RemapLinks of @link-foundation/link-cli-client, whose addresses above may be strings such as UUIDs; the Rust one is link_cli::RemapLinks.

public class RemapLinksDecorator<TLinkAddress> : LinksDecoratorBase<TLinkAddress>, INamedTypesLinks<TLinkAddress>, ILinks<TLinkAddress>, ILinks<TLinkAddress, LinksConstants<TLinkAddress>>, INamedTypes<TLinkAddress>, IComposedLinks<TLinkAddress> where TLinkAddress : struct, IUnsignedNumber<TLinkAddress>

Type Parameters

TLinkAddress
Inheritance
LinksOperatorBase<TLinkAddress>
LinksDecoratorBase<TLinkAddress>
RemapLinksDecorator<TLinkAddress>
Implements
INamedTypesLinks<TLinkAddress>
ILinks<TLinkAddress>
ILinks<TLinkAddress, LinksConstants<TLinkAddress>>
INamedTypes<TLinkAddress>
IComposedLinks<TLinkAddress>
Inherited Members
LinksDecoratorBase<TLinkAddress>._constants
LinksDecoratorBase<TLinkAddress>._facade
LinksDecoratorBase<TLinkAddress>.Facade
LinksDecoratorBase<TLinkAddress>.Constants
LinksOperatorBase<TLinkAddress>._links
LinksOperatorBase<TLinkAddress>.Links
Extension Methods

Remarks

The map is an IAddressMap<TLinkAddress>: an OffsetAddressMap<TLinkAddress> moves a network out of the way of another, so a UnionLinksDecorator<TLinkAddress> of them shadows nothing, and an AddressTable<TLinkAddress> gives the addresses of another system addresses of our own. Strings from outside, such as UUIDs, are bound to links by LinksExternalIds.

A read that names an address that is not of the network below finds nothing; a write that names one fails with ArgumentException. The constants of the store (the null link, Any) are no addresses and read the same on both sides.

Constructors

public RemapLinksDecorator(INamedTypesLinks<TLinkAddress> links, IAddressMap<TLinkAddress> map)

Parameters

links INamedTypesLinks<TLinkAddress>

The network below.

map IAddressMap<TLinkAddress>

How its addresses read above.

Properties

Map

How the addresses of the network below read above.

public IAddressMap<TLinkAddress> Map { get; }

Property Value

IAddressMap<TLinkAddress>

Methods

Claims(TLinkAddress)

Whether address is mapped to an address below.

public virtual bool Claims(TLinkAddress address)

Parameters

address TLinkAddress

Returns

bool

Count(IList<TLinkAddress>?)

Counts the restriction.

public override TLinkAddress Count(IList<TLinkAddress>? restriction)

Parameters

restriction IList<TLinkAddress>

The restriction.

Returns

TLinkAddress

The link

Create(IList<TLinkAddress>?, WriteHandler<TLinkAddress>?)

Creates the restriction.

public override TLinkAddress Create(IList<TLinkAddress>? substitution, WriteHandler<TLinkAddress>? handler)

Parameters

substitution IList<TLinkAddress>

The restriction.

handler WriteHandler<TLinkAddress>

Optional callback; null continues without invoking a callback.

Returns

TLinkAddress

The link

Delete(IList<TLinkAddress>?, WriteHandler<TLinkAddress>?)

Deletes the restriction.

public override TLinkAddress Delete(IList<TLinkAddress>? restriction, WriteHandler<TLinkAddress>? handler)

Parameters

restriction IList<TLinkAddress>

The restriction.

handler WriteHandler<TLinkAddress>

Optional callback; null continues without invoking a callback.

Returns

TLinkAddress

Each(IList<TLinkAddress>?, ReadHandler<TLinkAddress>?)

Eaches the handler.

public override TLinkAddress Each(IList<TLinkAddress>? restriction, ReadHandler<TLinkAddress>? handler)

Parameters

restriction IList<TLinkAddress>

The restriction.

handler ReadHandler<TLinkAddress>

The handler.

Returns

TLinkAddress

The link

EnsureCreated(params TLinkAddress[])

Creates the links at addresses below, at the addresses they map to.

public virtual void EnsureCreated(params TLinkAddress[] addresses)

Parameters

addresses TLinkAddress[]

GetByName(string)

public virtual TLinkAddress GetByName(string name)

Parameters

name string

Returns

TLinkAddress

GetName(TLinkAddress)

public virtual string? GetName(TLinkAddress link)

Parameters

link TLinkAddress

Returns

string

Outer(IList<TLinkAddress>?)

A link of the network below as it reads above.

protected IList<TLinkAddress>? Outer(IList<TLinkAddress>? link)

Parameters

link IList<TLinkAddress>

Returns

IList<TLinkAddress>

RemoveName(TLinkAddress)

public virtual void RemoveName(TLinkAddress link)

Parameters

link TLinkAddress

SetName(TLinkAddress, string)

public virtual TLinkAddress SetName(TLinkAddress link, string name)

Parameters

link TLinkAddress
name string

Returns

TLinkAddress

ToInner(TLinkAddress)

The address below of outer; throws when it is no address of the network below.

public TLinkAddress ToInner(TLinkAddress outer)

Parameters

outer TLinkAddress

Returns

TLinkAddress

ToOuter(TLinkAddress)

The address above of inner; a constant reads the same.

public TLinkAddress ToOuter(TLinkAddress inner)

Parameters

inner TLinkAddress

Returns

TLinkAddress

TryToInner(TLinkAddress, out TLinkAddress)

The address below of outer; false when it is no address of the network below. A constant reads the same.

public bool TryToInner(TLinkAddress outer, out TLinkAddress inner)

Parameters

outer TLinkAddress
inner TLinkAddress

Returns

bool

Update(IList<TLinkAddress>?, IList<TLinkAddress>?, WriteHandler<TLinkAddress>?)

Updates the restriction.

public override TLinkAddress Update(IList<TLinkAddress>? restriction, IList<TLinkAddress>? substitution, WriteHandler<TLinkAddress>? handler)

Parameters

restriction IList<TLinkAddress>

The restriction.

substitution IList<TLinkAddress>

The substitution.

handler WriteHandler<TLinkAddress>

Optional callback; null continues without invoking a callback.

Returns

TLinkAddress

The link