Example #1
0
 public MergingIterator(Comparator comparator, Iterator[] children)
 {
     comparator_ = comparator;
       children_ = new IteratorWrapper[children.Length];
       current_ = null;
       direction_ = Direction.kForward;
       for (int i = 0; i < children.Length; i++)
     children_[i] = new IteratorWrapper(children[i]);
 }
Example #2
0
   public TwoLevelIterator(
 Iterator index_iter,
 BlockFunctionDelegate block_function,
 object arg,
 ReadOptions options)
   {
       block_function_ = block_function;
         arg_ = arg;
         options_ = options;
         index_iter_ = new IteratorWrapper(index_iter);
         data_iter_ = null;
   }
Example #3
0
   internal static Iterator NewTwoLevelIterator(
 Iterator index_iter, BlockFunctionDelegate block_function, object arg, ReadOptions options)
   {
       return new TwoLevelIterator(index_iter, block_function, arg, options);
   }
Example #4
0
        internal static Iterator NewMergingIterator(Comparator comparator, Iterator[] children)
        {
            Debug.Assert(children.Length >= 0);

              if (children.Length == 0)
              {
            return EmptyIterator;
              }
              else if (children.Length == 1)
              {
            return children[0];
              }
              else
              {
            return new MergingIterator(comparator, children);
              }
        }
Example #5
0
 public IteratorWrapper(Iterator iter)
 {
     Iterator = iter;
 }
Example #6
0
 public IteratorWrapper()
 {
     iter_ = null;
       valid_ = false;
 }
Example #7
0
        void SetDataIterator(Iterator data_iter)
        {
            if (data_iter_.Iterator != null)
            SaveError(data_iter_.Status);

              data_iter_.Iterator = data_iter;
        }