Пример #1
0
        private BTreePointer GetPointerForKey(int key)
        {
            IBTreeRange range    = Search(key);
            IEnumerator pointers = range.Pointers();

            Assert.IsTrue(pointers.MoveNext());
            BTreePointer pointer = (BTreePointer)pointers.Current;

            return(pointer);
        }
Пример #2
0
        public override int AddressForId(int id)
        {
            IBTreeRange range    = _slotTree.SearchRange(Trans(), new IdSlotMapping(id, 0, 0));
            IEnumerator pointers = range.Pointers();

            if (pointers.MoveNext())
            {
                BTreePointer pointer = (BTreePointer)pointers.Current;
                return(((IdSlotMapping)pointer.Key())._address);
            }
            return(0);
        }
Пример #3
0
        private BTreeNode Node(int value)
        {
            IBTreeRange range = Search(value);
            IEnumerator i     = range.Pointers();

            i.MoveNext();
            BTreePointer firstPointer = (BTreePointer)i.Current;
            BTreeNode    node         = firstPointer.Node();

            node.DebugLoadFully(SystemTrans());
            return(node);
        }
Пример #4
0
        public override int MappedId(int oldID)
        {
            if (_cache.Orig() == oldID)
            {
                return(_cache.Mapped());
            }
            int classID = MappedClassID(oldID);

            if (classID != 0)
            {
                return(classID);
            }
            IBTreeRange range    = _idTree.SearchRange(Trans(), new MappedIDPair(oldID, 0));
            IEnumerator pointers = range.Pointers();

            if (pointers.MoveNext())
            {
                BTreePointer pointer = (BTreePointer)pointers.Current;
                _cache = (MappedIDPair)pointer.Key();
                return(_cache.Mapped());
            }
            return(0);
        }