Table of Contents

Class NamedLinksDecorator<TLinkAddress>

Namespace
Foundation.Data.Doublets.Cli
Assembly
Foundation.Data.Doublets.Cli.dll
public sealed class NamedLinksDecorator<TLinkAddress> : LinksDecoratorBase<TLinkAddress>, INamedTypesLinks<TLinkAddress>, ILinks<TLinkAddress>, ILinks<TLinkAddress, LinksConstants<TLinkAddress>>, INamedTypes<TLinkAddress>, IDisposable where TLinkAddress : struct, IUnsignedNumber<TLinkAddress>, IComparisonOperators<TLinkAddress, TLinkAddress, bool>, IShiftOperators<TLinkAddress, int, TLinkAddress>, IBitwiseOperators<TLinkAddress, TLinkAddress, TLinkAddress>, IMinMaxValue<TLinkAddress>

Type Parameters

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

Constructors

[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "The names database memory and links are owned by this instance and released by Dispose.")]
public NamedLinksDecorator(ILinks<TLinkAddress> links, string namesDatabaseFilename, bool tracingEnabled = false)

Parameters

links ILinks<TLinkAddress>
namesDatabaseFilename string
tracingEnabled bool

NamedLinksDecorator(string, bool)

public NamedLinksDecorator(string databaseFilename, bool tracingEnabled = false)

Parameters

databaseFilename string
tracingEnabled bool

Fields

public readonly NamedLinks<TLinkAddress> NamedLinks

Field Value

NamedLinks<TLinkAddress>

NamedLinksDatabaseFileName

public readonly string NamedLinksDatabaseFileName

Field Value

string

Methods

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>

Returns

TLinkAddress

Dispose()

Releases the memory-mapped file handles of both the data and the names databases.

public void Dispose()

GetByName(string)

Gets the link address associated with the specified name.

public TLinkAddress GetByName(string name)

Parameters

name string

The name to look up.

Returns

TLinkAddress

The link address associated with the name, or Null if not found.

GetName(TLinkAddress)

Gets the name associated with the specified link address.

public string? GetName(TLinkAddress link)

Parameters

link TLinkAddress

The link address to get the name for.

Returns

string

The name associated with the link, or null if no name is set.

[SuppressMessage("Reliability", "CA2000:Dispose objects before losing scope", Justification = "Ownership of the links facade is transferred to the caller, which releases it through Dispose.")]
public static ILinks<TLinkAddress> MakeLinks(string databaseFilename)

Parameters

databaseFilename string

Returns

ILinks<TLinkAddress>

MakeNamesDatabaseFilename(string)

public static string MakeNamesDatabaseFilename(string databaseFilename)

Parameters

databaseFilename string

Returns

string

RemoveName(TLinkAddress)

Removes the name association for the specified link address.

public void RemoveName(TLinkAddress link)

Parameters

link TLinkAddress

The link address whose name should be removed.

SetName(TLinkAddress, string)

Sets the name for the specified link address.

public TLinkAddress SetName(TLinkAddress link, string name)

Parameters

link TLinkAddress

The link address to name.

name string

The name to assign to the link.

Returns

TLinkAddress

The link address representing the name assignment.

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>

Returns

TLinkAddress

The link