Class NamedLinksDecorator<TLinkAddress>
- Namespace
- Foundation.Data.Doublets.Cli
- Assembly
- Foundation.Data.Doublets.Cli.dll
public 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>._constantsLinksDecoratorBase<TLinkAddress>._facadeLinksDecoratorBase<TLinkAddress>.FacadeLinksDecoratorBase<TLinkAddress>.ConstantsLinksOperatorBase<TLinkAddress>._linksLinksOperatorBase<TLinkAddress>.Links
- Extension Methods
Constructors
NamedLinksDecorator(ILinks<TLinkAddress>, string, bool)
public NamedLinksDecorator(ILinks<TLinkAddress> links, string namesDatabaseFilename, bool tracingEnabled = false)
Parameters
NamedLinksDecorator(string, bool)
public NamedLinksDecorator(string databaseFilename, bool tracingEnabled = false)
Parameters
Fields
NamedLinks
public readonly NamedLinks<TLinkAddress> NamedLinks
Field Value
- NamedLinks<TLinkAddress>
NamedLinksDatabaseFileName
public readonly string NamedLinksDatabaseFileName
Field Value
Properties
ReassignsNames
Whether assigning a name removes its previous owner.
public virtual bool ReassignsNames { get; }
Property Value
Methods
CaptureNames()
A detached logical name snapshot for undo. Stores supporting names of absent rows override this default row-based enumeration to include them.
public virtual IReadOnlyDictionary<TLinkAddress, string> CaptureNames()
Returns
- IReadOnlyDictionary<TLinkAddress, string>
Delete(IList<TLinkAddress>?, WriteHandler<TLinkAddress>?)
Deletes the restriction.
public override TLinkAddress Delete(IList<TLinkAddress>? restriction, WriteHandler<TLinkAddress>? handler)
Parameters
restrictionIList<TLinkAddress>The restriction.
handlerWriteHandler<TLinkAddress>Optional callback; null continues without invoking a callback.
Returns
- TLinkAddress
Dispose()
Releases the memory-mapped file handles of both the data and the names databases.
public void Dispose()
Dispose(bool)
Releases the databases this decorator owns. Derived decorators that
own extra resources override this and call
base.Dispose(disposing).
protected virtual void Dispose(bool disposing)
Parameters
disposingbool
GetByName(string)
Gets the link address associated with the specified name.
public virtual TLinkAddress GetByName(string name)
Parameters
namestringThe 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 virtual string? GetName(TLinkAddress link)
Parameters
linkTLinkAddressThe link address to get the name for.
Returns
- string
The name associated with the link, or null if no name is set.
MakeLinks(string)
[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
databaseFilenamestring
Returns
- ILinks<TLinkAddress>
MakeNamesDatabaseFilename(string)
public static string MakeNamesDatabaseFilename(string databaseFilename)
Parameters
databaseFilenamestring
Returns
RemoveName(TLinkAddress)
Removes the name association for the specified link address.
public virtual void RemoveName(TLinkAddress link)
Parameters
linkTLinkAddressThe link address whose name should be removed.
SetName(TLinkAddress, string)
Sets the name for the specified link address.
public virtual TLinkAddress SetName(TLinkAddress link, string name)
Parameters
linkTLinkAddressThe link address to name.
namestringThe 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
restrictionIList<TLinkAddress>The restriction.
substitutionIList<TLinkAddress>The substitution.
handlerWriteHandler<TLinkAddress>Optional callback; null continues without invoking a callback.
Returns
- TLinkAddress
The link