Beispiel #1
0
        // map.c (121, 1)
        // l_amapFind(m, key) as Rb_Type
        // l_amapFind(L_AMAP *, RB_TYPE) as RB_TYPE *
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_amapFind/*"/>
        ///   <returns></returns>
        public static Rb_Type l_amapFind(
            L_Rbtree m,
            Rb_Type key)
        {
            if (m == null)
            {
                throw new ArgumentNullException("m cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            IntPtr mPtr = IntPtr.Zero; if (m != null)
            {
                mPtr = m.Pointer;
            }
            IntPtr keyPtr = IntPtr.Zero; if (key != null)
            {
                keyPtr = key.Pointer;
            }
            IntPtr _Result = Natives.l_amapFind(m.Pointer, key.Pointer);

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

            return(new Rb_Type(_Result));
        }
Beispiel #2
0
        // map.c (220, 1)
        // l_asetDelete(s, key) as Object
        // l_asetDelete(L_ASET *, RB_TYPE) as void
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_asetDelete/*"/>
        public static void l_asetDelete(
            L_Rbtree s,
            Rb_Type key)
        {
            if (s == null)
            {
                throw new ArgumentNullException("s cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            IntPtr sPtr = IntPtr.Zero; if (s != null)
            {
                sPtr = s.Pointer;
            }
            IntPtr keyPtr = IntPtr.Zero; if (key != null)

            {
                keyPtr = key.Pointer;
            }

            Natives.l_asetDelete(s.Pointer, key.Pointer);
        }
Beispiel #3
0
        // map.c (203, 1)
        // l_asetFind(s, key) as Rb_Type
        // l_asetFind(L_ASET *, RB_TYPE) as RB_TYPE *
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_asetFind/*"/>
        ///   <returns></returns>
        public static Rb_Type l_asetFind(
            L_Rbtree s,
            Rb_Type key)
        {
            if (s == null)
            {
                throw new ArgumentNullException("s cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            IntPtr sPtr = IntPtr.Zero; if (s != null)
            {
                sPtr = s.Pointer;
            }
            IntPtr keyPtr = IntPtr.Zero; if (key != null)
            {
                keyPtr = key.Pointer;
            }
            IntPtr _Result = Natives.l_asetFind(s.Pointer, key.Pointer);

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

            return(new Rb_Type(_Result));
        }
Beispiel #4
0
        // map.c (136, 1)
        // l_amapDelete(m, key) as Object
        // l_amapDelete(L_AMAP *, RB_TYPE) as void
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_amapDelete/*"/>
        public static void l_amapDelete(
            L_Rbtree m,
            Rb_Type key)
        {
            if (m == null)
            {
                throw new ArgumentNullException("m cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            IntPtr mPtr = IntPtr.Zero; if (m != null)
            {
                mPtr = m.Pointer;
            }
            IntPtr keyPtr = IntPtr.Zero; if (key != null)

            {
                keyPtr = key.Pointer;
            }

            Natives.l_amapDelete(m.Pointer, key.Pointer);
        }
Beispiel #5
0
        // rbtree.c (235, 1)
        // l_rbtreeDelete(t, key) as Object
        // l_rbtreeDelete(L_RBTREE *, RB_TYPE) as void
        ///  <summary>
        /// l_rbtreeDelete()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_rbtreeDelete/*"/>
        ///  <param name="t">[in] - rbtree, including root node</param>
        ///  <param name="key">[in] - (delete the node with this key</param>
        public static void l_rbtreeDelete(
            L_Rbtree t,
            Rb_Type key)
        {
            if (t == null)
            {
                throw new ArgumentNullException("t cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            Natives.l_rbtreeDelete(t.Pointer, key.Pointer);
        }
Beispiel #6
0
        // rbtree.c (181, 1)
        // l_rbtreeInsert(t, key, value) as Object
        // l_rbtreeInsert(L_RBTREE *, RB_TYPE, RB_TYPE) as void
        ///  <summary>
        /// (1) If a node with the key already exists, this just updates the value.
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_rbtreeInsert/*"/>
        ///  <param name="t">[in] - rbtree, including root node</param>
        ///  <param name="key">[in] - insert a node with this key, if the key does not already exist in the tree</param>
        ///  <param name="value">[in] - typically an int, used for an index</param>
        public static void l_rbtreeInsert(
            L_Rbtree t,
            Rb_Type key,
            Rb_Type value)
        {
            if (t == null)
            {
                throw new ArgumentNullException("t cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            if (value == null)
            {
                throw new ArgumentNullException("value cannot be Nothing");
            }

            Natives.l_rbtreeInsert(t.Pointer, key.Pointer, value.Pointer);
        }
Beispiel #7
0
        // rbtree.c (154, 1)
        // l_rbtreeLookup(t, key) as Rb_Type
        // l_rbtreeLookup(L_RBTREE *, RB_TYPE) as RB_TYPE *
        ///  <summary>
        /// l_rbtreeLookup()
        ///  </summary>
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_rbtreeLookup/*"/>
        ///  <param name="t">[in] - rbtree, including root node</param>
        ///  <param name="key">[in] - find a node with this key</param>
        ///   <returns>[and]value     a pointer to a union, if the node exists else NULL</returns>
        public static Rb_Type l_rbtreeLookup(
            L_Rbtree t,
            Rb_Type key)
        {
            if (t == null)
            {
                throw new ArgumentNullException("t cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            IntPtr _Result = Natives.l_rbtreeLookup(t.Pointer, key.Pointer);

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

            return(new Rb_Type(_Result));
        }
Beispiel #8
0
        // map.c (128, 1)
        // l_amapInsert(m, key, value) as Object
        // l_amapInsert(L_AMAP *, RB_TYPE, RB_TYPE) as void
        ///  <remarks>
        ///  </remarks>
        ///  <include file="..\CHM_Help\IncludeComments.xml" path="Comments/l_amapInsert/*"/>
        public static void l_amapInsert(
            L_Rbtree m,
            Rb_Type key,
            Rb_Type value)
        {
            if (m == null)
            {
                throw new ArgumentNullException("m cannot be Nothing");
            }

            if (key == null)
            {
                throw new ArgumentNullException("key cannot be Nothing");
            }

            if (value == null)
            {
                throw new ArgumentNullException("value cannot be Nothing");
            }

            IntPtr mPtr = IntPtr.Zero; if (m != null)
            {
                mPtr = m.Pointer;
            }
            IntPtr keyPtr = IntPtr.Zero; if (key != null)
            {
                keyPtr = key.Pointer;
            }
            IntPtr valuePtr = IntPtr.Zero; if (value != null)

            {
                valuePtr = value.Pointer;
            }

            Natives.l_amapInsert(m.Pointer, key.Pointer, value.Pointer);
        }