Node

public class Node : Codable, Equatable, CustomStringConvertible

Represents a node in the raw dependency graph

  • usr

    Each node is uniquely identified via its USR (Unified Symbol Resolution)

    Declaration

    Swift

    public var usr: String
  • The kind of the node. Refer to the type NodeKind to see different possible kinds

    Declaration

    Swift

    public var kind: NodeKind
  • The name of the node e.g. a struct or function name

    Declaration

    Swift

    public var name: String
  • The roles of the node e.g. a definition, declaration etc.

    Declaration

    Swift

    public var roles: [NodeRole]
  • Undocumented

    Declaration

    Swift

    public var groupID: Int?
  • Undocumented

    Declaration

    Swift

    public var location: NodeLocation
  • Make the node conform to the CustomStringConvertible protocol

    Declaration

    Swift

    public var description: String { get }
  • The standard constructor

    Declaration

    Swift

    public init(usr: String, kind: NodeKind, name: String, roles: [NodeRole], location: NodeLocation)
  • A constructor that creates a node based on a IndexStoreDB Symbol

    Declaration

    Swift

    public init(symbol: Symbol, roles: SymbolRole, location: SymbolLocation)
  • The constructor for refined graphs

    Declaration

    Swift

    public init(usr: String, kind: NodeKind, name: String, roles: [NodeRole], groupID: Int, location: NodeLocation)
  • Make the node conform to the Equatable protocol to be accepted as a node in a SwiftGraph graph

    Declaration

    Swift

    public static func == (lhs: Node, rhs: Node) -> Bool