Class AddressTable<TLinkAddress>
- Namespace
- Foundation.Data.Doublets.Cli
- Assembly
- Foundation.Data.Doublets.Cli.dll
A table of the addresses above and below: an address below that has
none above yet gets the next free one from first on, so the
addresses of another system (a server, a service) read as addresses of
our own range. Pairs and Add(TLinkAddress, TLinkAddress) keep the table
across runs, in links or anywhere else.
public sealed class AddressTable<TLinkAddress> : IAddressMap<TLinkAddress> where TLinkAddress : struct, IUnsignedNumber<TLinkAddress>
Type Parameters
TLinkAddress
- Inheritance
-
AddressTable<TLinkAddress>
- Implements
-
IAddressMap<TLinkAddress>
- Inherited Members
Constructors
AddressTable(TLinkAddress)
public AddressTable(TLinkAddress first)
Parameters
firstTLinkAddressThe first address above the table gives.
Properties
Pairs
Every address above with its address below.
public IReadOnlyDictionary<TLinkAddress, TLinkAddress> Pairs { get; }
Property Value
- IReadOnlyDictionary<TLinkAddress, TLinkAddress>
Methods
Add(TLinkAddress, TLinkAddress)
Maps outer to inner; neither may be mapped to another address already.
public void Add(TLinkAddress outer, TLinkAddress inner)
Parameters
outerTLinkAddressinnerTLinkAddress
ToOuter(TLinkAddress)
The address above of inner, given one when it has none yet.
public TLinkAddress ToOuter(TLinkAddress inner)
Parameters
innerTLinkAddress
Returns
- TLinkAddress
TryToInner(TLinkAddress, out TLinkAddress)
The address below of outer; false when outer is no address of the network below.
public bool TryToInner(TLinkAddress outer, out TLinkAddress inner)
Parameters
outerTLinkAddressinnerTLinkAddress