public virtual IBTreeRange CreateIncludingRange(Db4objects.Db4o.Internal.Btree.BTreeNodeSearchResult
                                                        end)
        {
            BTreePointer firstPointer = FirstValidPointer();
            BTreePointer endPointer   = end._foundMatch ? end._pointer.Next() : end.FirstValidPointer
                                            ();

            return(new BTreeRangeSingle(_transaction, _btree, firstPointer, endPointer));
        }
示例#2
0
 public virtual IBTreeRange CreateIncludingRange(BTreeNodeSearchResult
     end)
 {
     var firstPointer = FirstValidPointer();
     var endPointer = end._foundMatch
         ? end._pointer.Next()
         : end.FirstValidPointer
             ();
     return new BTreeRangeSingle(_transaction, _btree, firstPointer, endPointer);
 }
示例#3
0
        public virtual IBTreeRange CreateIncludingRange(BTreeNodeSearchResult
                                                        end)
        {
            var firstPointer = FirstValidPointer();
            var endPointer   = end._foundMatch
                ? end._pointer.Next()
                : end.FirstValidPointer
                                   ();

            return(new BTreeRangeSingle(_transaction, _btree, firstPointer, endPointer));
        }
示例#4
0
        private BTreePointer FirstBTreePointer()
        {
            // We don't want nulls included so we have to search for null and use the resulting pointer if we find one.
            IIndexable4 keyHandler = Btree().KeyHandler();

            if (keyHandler is ICanExcludeNullInQueries)
            {
                ICanExcludeNullInQueries canExcludeNullInQueries = (ICanExcludeNullInQueries)keyHandler;
                if (canExcludeNullInQueries.ExcludeNull())
                {
                    BTreeNodeSearchResult searchLeaf = Btree().SearchLeafByObject(Transaction(), null
                                                                                  , SearchTarget.Highest);
                    BTreePointer pointer = searchLeaf.FirstValidPointer();
                    if (pointer != null)
                    {
                        return(pointer);
                    }
                }
            }
            return(Btree().FirstPointer(Transaction()));
        }
示例#5
0
        public virtual BTreePointer SearchPointer(Transaction trans, object key)
        {
            EnsureActive(trans);
            KeyCantBeNull(key);
            IPreparedComparison preparedComparison = KeyHandler().PrepareComparison(trans.Context
                                                                                        (), key);
            BTreeNodeSearchResult start = SearchLeaf(trans, preparedComparison, SearchTarget.
                                                     Lowest);
            BTreePointer bTreePointer = start.FirstValidPointer();

            if (bTreePointer == null)
            {
                ConvertCacheEvictedNodesToReadMode();
                return(null);
            }
            object found = bTreePointer.Key();

            ConvertCacheEvictedNodesToReadMode();
            if (preparedComparison.CompareTo(found) == 0)
            {
                return(bTreePointer);
            }
            return(null);
        }