DIGraph

public struct DIGraph

Dependency graph. Contains vertices array: components or argument or type. and transition adjacency list.

  • Undocumented

    Declaration

    Swift

    public typealias AdjacencyList = [[(edge: DIEdge, toIndices: [Int])]]
  • vertices array. It’s All dependencies. Contains All components, all arguments and all unknown type dependencies.

    Declaration

    Swift

    public let vertices: [DIVertex]
  • Directed, Transition adjacency list. Contains information about transition from vertex to vertices. Containts edges. For get transition information your can write: for (edge, toIndices) in adjacencyList[fromIndexVertices] This write means that component by fromIndexVertices can dependency on toIndices. array of to indices need only for many, or if not valid graph.

    Declaration

    Swift

    public let adjacencyList: AdjacencyList
  • Function found all cycles in graph and safe this cycles in array.

    Declaration

    Swift

    public func findCycles() -> [DICycle]

    Return Value

    array of cycles

  • Validate the graph by checking various conditions.

    Declaration

    Swift

    public func checkIsValid(checkGraphCycles: Bool = true) -> Bool

    Parameters

    checkGraphCycles

    check cycles in the graph of heavy operation. So it can be disabled.

    Return Value

    true if validation success.