Exemplo n.º 1
0
        public KeyValuePair <TimestampLog, IEnumerable <ValueListImpl> > Scan(KeyImpl begin, KeyImpl end, IPredicate <ValueListImpl> p)
        {
            CheckInitialized();
            var b = index.Scan(begin, end).Where(v => p.Evaluate(v));

            lock (stamp) {
                return(new KeyValuePair <TimestampLog, IEnumerable <ValueListImpl> >(stamp, b));
            }
        }
Exemplo n.º 2
0
        private void _timer_Elapsed(object sender, ElapsedEventArgs e)
        {
            _registryGroupState.Round++;

            if (_isBlockProducerPredicate.Evaluate())
            {
                //_registryGroupState.WaitLastBlockConfirmationReceived();
                _transactionsRegistryProducingFlow.Post(_registryMemPool);
            }
        }
        /// <summary> Set nextObject to the next object. If there are no more
        /// objects then return false. Otherwise, return true.
        /// </summary>
        private bool SetNextObject()
        {
            while (iter.MoveNext())
            {
                var object_Renamed = iter.Current;
                if (predicate.Evaluate(object_Renamed))
                {
                    nextObject    = object_Renamed;
                    nextObjectSet = true;
                    return(true);
                }
            }

            return(false);
        }
Exemplo n.º 4
0
        private void Iterate(
            IPredicate predicate
            )
        {
            PdfDictionary firstBead = FirstBead;
            PdfDictionary bead      = firstBead;

            while (bead != null)
            {
                if (predicate.Evaluate(bead))
                {
                    break;
                }

                bead = (PdfDictionary)bead.Resolve(PdfName.N);
                if (bead == firstBead)
                {
                    break;
                }
            }
        }
Exemplo n.º 5
0
 public IEnumerable <ValueListImpl> AtomicScan(KeyImpl begin, KeyImpl end, IPredicate <ValueListImpl> predicate)
 {
     CheckInitialized();
     return(index.AtomicScan(begin, end).Where(v => predicate.Evaluate(v)));
 }
 public static bool SatisfiesPrecondition <T>(this T candidate, IPredicate <T> condition)
 {
     return(condition.Evaluate(candidate));
 }