Gitpod

    NuGet Version and Downloads count Actions Status Codacy Badge CodeFactor

    Data.Doublets (русская версия)

    LinksPlatform's Platform.Data.Doublets Class Library.

    Namespace: Platform.Data.Doublets

    Forked from: Konard/LinksPlatform/Platform/Platform.Data.Doublets

    NuGet package: Platform.Data.Doublets

    Example | Run .NET fiddle

    using System;
    using Platform.Data;
    using Platform.Data.Doublets;
    using Platform.Data.Doublets.Memory.United.Generic;
    
    // A doublet links store is mapped to "db.links" file:
    using var links = new UnitedMemoryLinks<uint>("db.links");
    
    // A creation of the doublet link: 
    var link = links.Create();
    
    // The link is updated to reference itself twice (as a source and a target):
    link = links.Update(link, newSource: link, newTarget: link);
    
    // Read operations:
    Console.WriteLine($"The number of links in the data store is {links.Count()}.");
    Console.WriteLine("Data store contents:");
    var any = links.Constants.Any; // Means any link address or no restriction on link address
    // Arguments of the query are interpreted as restrictions
    var query = new Link<uint>(index: any, source: any, target: any);
    links.Each((link) => {
        Console.WriteLine(links.Format(link));
        return links.Constants.Continue;
    }, query);
    
    // The link's content reset:
    link = links.Update(link, newSource: default, newTarget: default);
    
    // The link deletion:
    links.Delete(link);
    

    SQLite vs Doublets

    Image with result of performance comparison between SQLite and Doublets.

    Documentation

    • Interface ILinks<TLink, TConstants>.
    • Interface ILinks<TLink>.
    • Class UnitedMemoryLinks<TLink>.

    PDF file with code for e-readers.

    Dependency graph [C#]

    C# dependency graph SVG image

    Dependency graph [C++]

    C++ dependency graph SVG image

    Depend on

    • Platform.Random
    • Platform.Timestamps
    • Platform.Incrementers
    • Platform.Collections.Methods
    • Platform.Singletons
    • Platform.Memory
    • Platform.Data

    Support

    Ask questions at stackoverflow.com/tags/links-platform (or with tag links-platform) to get our free support.

    You can also get real-time support on our official Discord server.

    • Improve this Doc
    Back to top Generated by DocFX