Skip to main content

CkInterfaceGraph

Namespace: Meshmakers.Octo.ConstructionKit.Contracts.DependencyGraph

A CK interface in the dependency graph (CK v2, AB#5667; extends/associations/methods/deprecated F1.1-S5).

public sealed class CkInterfaceGraph

Inheritance Object → CkInterfaceGraph

Properties​

CkInterfaceId​

The interface id, e.g. System.Identity-2.90.0/Named-1.

public CkId<CkInterfaceId> CkInterfaceId { get; }

Property Value​

CkId<CkInterfaceId>

Description​

An optional description of the interface.

public string Description { get; }

Property Value​

String

DefinedAttributes​

The members as declared in the model.

public IReadOnlyCollection<CkInterfaceAttributeDto> DefinedAttributes { get; }

Property Value​

IReadOnlyCollection<CkInterfaceAttributeDto>

Attributes​

The members merged with their attribute definitions (value type etc.). IsOptional is the member optionality; Access is always CkAttributeAccessDto.ReadWrite.

public IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph> Attributes { get; }

Property Value​

IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>

AllAttributes​

CK v2 (F1.1-S5): own members plus the members of every extended interface (filled by the inheritance resolver; own members win on a duplicate attribute id). Implementations are checked against this set.

public IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph> AllAttributes { get; }

Property Value​

IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>

DeclaredExtends​

CK v2 (F1.1-S5): the interfaces as declared in extends.

public IReadOnlyList<CkId<CkInterfaceId>> DeclaredExtends { get; }

Property Value​

IReadOnlyList<CkId<CkInterfaceId>>

AllExtendedInterfaces​

CK v2 (F1.1-S5): every interface this one extends, directly or transitively (filled by the inheritance resolver; unknown entries and cycles are skipped here and reported by the compiler rules).

public IReadOnlyCollection<CkId<CkInterfaceId>> AllExtendedInterfaces { get; }

Property Value​

IReadOnlyCollection<CkId<CkInterfaceId>>

DefinedAssociations​

CK v2 (F1.1-S5): the association members as declared.

public IReadOnlyList<CkInterfaceAssociationGraph> DefinedAssociations { get; }

Property Value​

IReadOnlyList<CkInterfaceAssociationGraph>

AllAssociations​

CK v2 (F1.1-S5): own association members plus those of every extended interface.

public IReadOnlyList<CkInterfaceAssociationGraph> AllAssociations { get; }

Property Value​

IReadOnlyList<CkInterfaceAssociationGraph>

DefinedMethods​

CK v2 (F1.1-S5): the methods as declared (definitions only).

public IReadOnlyList<CkMethodDto> DefinedMethods { get; }

Property Value​

IReadOnlyList<CkMethodDto>

AllMethods​

CK v2 (F1.1-S5): own methods plus those of every extended interface, keyed by method id (own wins).

public IReadOnlyDictionary<string, CkInterfaceMethodGraph> AllMethods { get; }

Property Value​

IReadOnlyDictionary<String, CkInterfaceMethodGraph>

Deprecated​

CK v2 (F1.1-S5): the interface is deprecated; dependents get a compile warning.

public bool Deprecated { get; }

Property Value​

Boolean

ImplementingTypes​

The concrete and abstract types that implement this interface directly or via inheritance (filled by the inheritance resolver).

public IReadOnlyCollection<CkId<CkTypeId>> ImplementingTypes { get; }

Property Value​

IReadOnlyCollection<CkId<CkTypeId>>

Visibility​

CK v2 (F1.1-S4): the effective visibility (declared value, otherwise CkVisibilityDto.Public). Settable so a cache written before CK v2 (no key) reads Public.

public CkVisibilityDto Visibility { get; set; }

Property Value​

CkVisibilityDto

Constructors​

CkInterfaceGraph(CkId<CkInterfaceId>, CkInterfaceDto)​

Creates a new instance from the interface definition. CkInterfaceGraph.Attributes is filled by the reference resolver (members merged with their attribute definitions), CkInterfaceGraph.ImplementingTypes by the inheritance resolver.

public CkInterfaceGraph(CkId<CkInterfaceId> ckInterfaceId, CkInterfaceDto dto)

Parameters​

ckInterfaceId CkId<CkInterfaceId>
The interface id

dto CkInterfaceDto
The interface definition

CkInterfaceGraph(CkId<CkInterfaceId>, String, IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>, IReadOnlyCollection<CkId<CkTypeId>>, IReadOnlyList<CkId<CkInterfaceId>>, IReadOnlyCollection<CkId<CkInterfaceId>>, IReadOnlyList<CkInterfaceAssociationGraph>, IReadOnlyList<CkInterfaceAssociationGraph>, IReadOnlyList<CkMethodDto>, IReadOnlyDictionary<String, CkInterfaceMethodGraph>, IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>, Boolean)​

Creates a new instance from the JSON cache.

public CkInterfaceGraph(CkId<CkInterfaceId> ckInterfaceId, string description, IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph> attributes, IReadOnlyCollection<CkId<CkTypeId>> implementingTypes, IReadOnlyList<CkId<CkInterfaceId>> declaredExtends, IReadOnlyCollection<CkId<CkInterfaceId>> allExtendedInterfaces, IReadOnlyList<CkInterfaceAssociationGraph> definedAssociations, IReadOnlyList<CkInterfaceAssociationGraph> allAssociations, IReadOnlyList<CkMethodDto> definedMethods, IReadOnlyDictionary<string, CkInterfaceMethodGraph> allMethods, IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph> allAttributes, bool deprecated)

Parameters​

ckInterfaceId CkId<CkInterfaceId>
The interface id

description String
The description

attributes IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>
The resolved members

implementingTypes IReadOnlyCollection<CkId<CkTypeId>>
The implementing types

declaredExtends IReadOnlyList<CkId<CkInterfaceId>>
F1.1-S5: the declared extends

allExtendedInterfaces IReadOnlyCollection<CkId<CkInterfaceId>>
F1.1-S5: the transitive extends

definedAssociations IReadOnlyList<CkInterfaceAssociationGraph>
F1.1-S5: the declared association members

allAssociations IReadOnlyList<CkInterfaceAssociationGraph>
F1.1-S5: own and inherited association members

definedMethods IReadOnlyList<CkMethodDto>
F1.1-S5: the declared methods

allMethods IReadOnlyDictionary<String, CkInterfaceMethodGraph>
F1.1-S5: own and inherited methods

allAttributes IReadOnlyDictionary<CkId<CkAttributeId>, CkTypeAttributeGraph>
F1.1-S5: own and inherited attribute members (null = own only)

deprecated Boolean
F1.1-S5: deprecated flag

Methods​

SetInheritedMembers(IReadOnlyCollection<CkId<CkInterfaceId>>, IEnumerable<CkInterfaceGraph>)​

Sets the inherited members (inheritance resolver).

internal void SetInheritedMembers(IReadOnlyCollection<CkId<CkInterfaceId>> allExtendedInterfaces, IEnumerable<CkInterfaceGraph> extendedGraphs)

Parameters​

allExtendedInterfaces IReadOnlyCollection<CkId<CkInterfaceId>>

extendedGraphs IEnumerable<CkInterfaceGraph>

TryAddAttribute(CkTypeAttributeGraph)​

Adds a resolved member; returns false when a member with the same attribute id exists already.

internal bool TryAddAttribute(CkTypeAttributeGraph attribute)

Parameters​

attribute CkTypeAttributeGraph

Returns​

Boolean

AddImplementingType(CkId<CkTypeId>)​

Adds an implementing type (idempotent).

internal void AddImplementingType(CkId<CkTypeId> ckTypeId)

Parameters​

ckTypeId CkId<CkTypeId>

ToString()​

public string ToString()

Returns​

String