Esempio n. 1
0
        // rbtree.c (423, 1)
        // l_rbtreeGetPrev(n) as L_Rbtree_Node
        // l_rbtreeGetPrev(L_RBTREE_NODE *) as L_RBTREE_NODE *
        ///  <summary>
        /// (1) This finds the previous node, in an in-order traversal, from
        /// the current node.<para/>
        ///
        /// (2) It is useful as an iterator for a map.<para/>
        ///
        /// (3) Call l_rbtreeGetLast() to get the last node.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_rbtreeGetPrev/*"/>
        ///  <param name="n">[in] - current node</param>
        ///   <returns>next node, or NULL if it's the first node</returns>
        public static L_Rbtree_Node l_rbtreeGetPrev(
            L_Rbtree_Node n)
        {
            if (n == null)
            {
                throw new ArgumentNullException("n cannot be Nothing");
            }

            IntPtr _Result = Natives.l_rbtreeGetPrev(n.Pointer);

            if (_Result == IntPtr.Zero)
            {
                return(null);
            }

            return(new L_Rbtree_Node(_Result));
        }
Esempio n. 2
0
        // map.c (239, 1)
        // l_asetGetNext(n) as L_Rbtree_Node
        // l_asetGetNext(L_ASET_NODE *) as L_ASET_NODE *
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_asetGetNext/*"/>
        ///   <returns></returns>
        public static L_Rbtree_Node l_asetGetNext(
            L_Rbtree_Node n)
        {
            if (n == null)
            {
                throw new ArgumentNullException("n cannot be Nothing");
            }

            IntPtr nPtr = IntPtr.Zero; if (n != null)
            {
                nPtr = n.Pointer;
            }
            IntPtr _Result = Natives.l_asetGetNext(n.Pointer);

            if (_Result == IntPtr.Zero)
            {
                return(null);
            }

            return(new L_Rbtree_Node(_Result));
        }