Table of Contents

Class UndoableLinksDecorator<TLinkAddress>

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

A store that keeps every write in a LinksUndoLog<TLinkAddress> while Recording, so a request that fails can be undone whole (issue #149). The links server puts it under every session.

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

Type Parameters

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

Constructors

public UndoableLinksDecorator(INamedTypesLinks<TLinkAddress> links)

Parameters

links INamedTypesLinks<TLinkAddress>

Properties

Log

The writes kept since Begin().

public LinksUndoLog<TLinkAddress> Log { get; }

Property Value

LinksUndoLog<TLinkAddress>

QueryLimits

Optional admission limits for the ordinary query processor.

public QueryLimits? QueryLimits { get; }

Property Value

QueryLimits

Recording

Whether writes are kept.

public bool Recording { get; }

Property Value

bool

Methods

Begin()

Starts keeping writes, forgetting the ones kept before.

public void Begin()

Commit()

Stops keeping writes; they stay.

public void Commit()

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

GetByName(string)

public TLinkAddress GetByName(string name)

Parameters

name string

Returns

TLinkAddress

GetName(TLinkAddress)

public string? GetName(TLinkAddress link)

Parameters

link TLinkAddress

Returns

string

RemoveName(TLinkAddress)

public void RemoveName(TLinkAddress link)

Parameters

link TLinkAddress

Preview a query over owned rows and reserve its allocation order. Returns final identities, or null when the store uses legacy prediction.

public IReadOnlySet<TLinkAddress>? ReserveQueryAllocations(Action<INamedTypesLinks<TLinkAddress>> preview)

Parameters

preview Action<INamedTypesLinks<TLinkAddress>>

Returns

IReadOnlySet<TLinkAddress>

Rollback()

Undoes every write kept since Begin().

public IReadOnlyList<TLinkAddress> Rollback()

Returns

IReadOnlyList<TLinkAddress>

The addresses of the links the writes created, now deleted again.

SetName(TLinkAddress, string)

public TLinkAddress SetName(TLinkAddress link, string name)

Parameters

link TLinkAddress
name string

Returns

TLinkAddress

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