Exemplo n.º 1
0
 /// <nodoc />
 public static Xldb.Proto.NodeId ToNodeId(this NodeId nodeId)
 {
     return(!nodeId.IsValid ? null : new Xldb.Proto.NodeId()
     {
         Value = nodeId.Value
     });
 }
Exemplo n.º 2
0
        /// <summary>
        /// Gets the outgoing edges for the node
        /// </summary>
        public Enumerator GetIncomingEdges(NodeId node)
        {
            var edges = GetInEdgeListHeader(node.Value);

            return(new Enumerator(this, edges.FirstIndex, edges.Count, m_enumeratorVerificationObject, isIncoming: true));
        }
Exemplo n.º 3
0
 public bool IsValidNodeId(NodeId node)
 {
     return(node.Value > NodeId.Invalid.Value && node.Value <= m_lastNodeId);
 }
Exemplo n.º 4
0
 /// <inheritdoc/>
 IEnumerable <Edge> IReadonlyDirectedGraph.GetIncomingEdges(NodeId node)
 {
     Contract.Requires(ContainsNode(node), "Cannot get successors of a non-existent node id");
     return(GetIncomingEdges(node));
 }
Exemplo n.º 5
0
        /// <nodoc/>
        public Enumerator GetOutgoingEdges(NodeId node)
        {
            var edges = GetOutEdgeListHeader(node.Value);

            return(GetOutgoingEdges(edges));
        }
Exemplo n.º 6
0
 public bool IsSinkNode(NodeId node)
 {
     Contract.Requires(ContainsNode(node), "Argument node must be a valid node id");
     return(GetOutEdgeListHeader(node.Value).Count == 0);
 }
Exemplo n.º 7
0
 public bool ContainsNode(NodeId node)
 {
     return(node.Value > NodeId.Invalid.Value && node.Value <= m_lastNodeId);
 }
Exemplo n.º 8
0
 /// <inheritdoc/>
 public int GetNodeHeight(NodeId node)
 {
     Contract.Requires(ContainsNode(node), "Cannot get height of a non-existent node id");
     return(GetNodeHeight(node.Value));
 }