示例#1
0
        internal BTreeNode(IHierarchyObj owner)
        {
            m_tuples = new BTreeNodeTupleList(3);
            BTreeNodeTuple tuple = new BTreeNodeTuple(CreateBTreeNode(null, owner), -1);

            m_tuples.Add(tuple, null);
        }
 internal void Add(BTreeNodeTuple tuple, ScalableList <BTreeNode> nodes)
 {
     if (m_list.Count == m_capacity)
     {
         throw new InvalidOperationException();
     }
     m_list.Add(tuple);
     if (-1 != tuple.ChildIndex)
     {
         BTreeNode item;
         using (nodes.GetAndPin(tuple.ChildIndex, out item))
         {
             item.IndexInParent = m_list.Count - 1;
         }
     }
 }
 internal void Insert(int index, BTreeNodeTuple tuple, ScalableList <BTreeNode> nodes)
 {
     if (m_list.Count == m_capacity)
     {
         throw new InvalidOperationException();
     }
     m_list.Insert(index, tuple);
     for (int i = index; i < m_list.Count; i++)
     {
         int childIndex = m_list[i].ChildIndex;
         if (childIndex != -1)
         {
             BTreeNode item;
             using (nodes.GetAndPin(childIndex, out item))
             {
                 item.IndexInParent = i;
             }
         }
     }
 }