コード例 #1
0
ファイル: IndexList.cs プロジェクト: mkbiltek2019/Dataphor
            public override void PrependTo(Node node)
            {
                RoutingNode target = node as RoutingNode;

                for (int i = 0; i < _count; i++)
                {
                    target.InsertNode(_keys[i], _nodes[i], i);
                }
            }
コード例 #2
0
ファイル: IndexList.cs プロジェクト: mkbiltek2019/Dataphor
            public override void AppendTo(Node node, int count)
            {
                RoutingNode target = node as RoutingNode;

                for (int i = 0; i < count; i++)
                {
                    target.InsertNode(_keys[i], _nodes[i], target._count);
                }
                Array.Copy(_keys, count, _keys, 0, _count - count);
                Array.Copy(_nodes, count, _nodes, 0, _count - count);
                _count -= count;
            }
コード例 #3
0
ファイル: IndexList.cs プロジェクト: mkbiltek2019/Dataphor
        public void Insert(IComparable key, object data)
        {
            for (;;)
            {
                if (!_root.Insert(key, data, this))
                {
                    RoutingNode newRoot  = AcquireRoutingNode();
                    Node        newChild = SplitNode(_root);
                    newRoot.InsertNode(_root._keys[0], _root, 0);
                    newRoot.InsertNode(newChild._keys[0], newChild, 1);
                    _root = newRoot;

                                        #if (DEBUG)
                    _height++;
                                        #endif

                    continue;
                }
                break;
            }
            _count++;
        }