コード例 #1
0
ファイル: LRU2QXCache.cs プロジェクト: pondyond/db4o
 public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
                               )
 {
     if (key == null)
     {
         throw new ArgumentNullException();
     }
     if (_am.Remove(key))
     {
         _am.AddFirst(key);
         return(_slots[key]);
     }
     if (_a1out.Contains(key))
     {
         ReclaimFor(key, producer, finalizer);
         _am.AddFirst(key);
         return(_slots[key]);
     }
     if (_a1in.Contains(key))
     {
         return(_slots[key]);
     }
     ReclaimFor(key, producer, finalizer);
     _a1in.AddFirst(key);
     return(_slots[key]);
 }
コード例 #2
0
		public virtual object Produce(object key, IFunction4 producer, IProcedure4 onDiscard
			)
		{
			_calls++;
			IFunction4 delegateProducer = new _IFunction4_26(this, producer);
			return _delegate.Produce(key, delegateProducer, onDiscard);
		}
コード例 #3
0
        public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
                                      )
        {
            if (key == null)
            {
                throw new ArgumentNullException();
            }
            if (_am.Remove(key))
            {
                _am.AddFirst(key);
                return(_slots[key]);
            }
            if (_a1.Remove(key))
            {
                _am.AddFirst(key);
                return(_slots[key]);
            }
            if (_slots.Count >= _maxSize)
            {
                DiscardPage(finalizer);
            }
            object value = producer.Apply(key);

            _slots[key] = value;
            _a1.AddFirst(key);
            return(value);
        }
コード例 #4
0
		public AbstractFreespaceManager(IProcedure4 slotFreedCallback, int discardLimit, 
			int remainderSizeLimit)
		{
			_slotFreedCallback = slotFreedCallback;
			_discardLimit = discardLimit;
			_remainderSizeLimit = remainderSizeLimit;
		}
コード例 #5
0
ファイル: LRU2QCache.cs プロジェクト: erdincay/db4o
		public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
			)
		{
			if (key == null)
			{
				throw new ArgumentNullException();
			}
			if (_am.Remove(key))
			{
				_am.AddFirst(key);
				return _slots[key];
			}
			if (_a1.Remove(key))
			{
				_am.AddFirst(key);
				return _slots[key];
			}
			if (_slots.Count >= _maxSize)
			{
				DiscardPage(finalizer);
			}
			object value = producer.Apply(key);
			_slots[key] = value;
			_a1.AddFirst(key);
			return value;
		}
コード例 #6
0
 public AbstractFreespaceManager(IProcedure4 slotFreedCallback, int discardLimit,
                                 int remainderSizeLimit)
 {
     _slotFreedCallback  = slotFreedCallback;
     _discardLimit       = discardLimit;
     _remainderSizeLimit = remainderSizeLimit;
 }
コード例 #7
0
		public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
			)
		{
			object value = _slots[key];
			if (value == null)
			{
				object newValue = producer.Apply(key);
				if (newValue == null)
				{
					return null;
				}
				if (_slots.Count >= _maxSize)
				{
					object discarded = Sharpen.Collections.Remove(_slots, _lru.RemoveLast());
					if (null != finalizer)
					{
						finalizer.Apply(discarded);
					}
				}
				_slots[key] = newValue;
				_lru.AddFirst(key);
				return newValue;
			}
			_lru.Remove(key);
			// O(N) 
			_lru.AddFirst(key);
			return value;
		}
コード例 #8
0
ファイル: EventInfo.cs プロジェクト: masroore/db4o
 public EventInfo(string eventFirerName, bool isClientServerEvent, IProcedure4 eventListenerSetter
     )
 {
     _listenerSetter = eventListenerSetter;
     _eventFirerName = eventFirerName;
     _isClientServerEvent = isClientServerEvent;
 }
コード例 #9
0
		public BTreeFreespaceManager(LocalObjectContainer file, IProcedure4 slotFreedCallback
			, int discardLimit) : base(slotFreedCallback, discardLimit)
		{
			_file = file;
			_delegate = new InMemoryFreespaceManager(slotFreedCallback, discardLimit);
			_idSystem = file.SystemData().FreespaceIdSystem();
		}
コード例 #10
0
 private void ForEachClassId(IProcedure4 procedure)
 {
     for (IEnumerator ids = _stream.ClassCollection().Ids(); ids.MoveNext();)
     {
         procedure.Apply((int)ids.Current);
     }
 }
コード例 #11
0
ファイル: LRUCache.cs プロジェクト: git-thinh/limada
        public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
                                      )
        {
            object value = _slots[key];

            if (value == null)
            {
                object newValue = producer.Apply(key);
                if (newValue == null)
                {
                    return(null);
                }
                if (_slots.Count >= _maxSize)
                {
                    object discarded = Sharpen.Collections.Remove(_slots, _lru.RemoveLast());
                    if (null != finalizer)
                    {
                        finalizer.Apply(discarded);
                    }
                }
                _slots[key] = newValue;
                _lru.AddFirst(key);
                return(newValue);
            }
            _lru.Remove(key);
            // O(N)
            _lru.AddFirst(key);
            return(value);
        }
コード例 #12
0
ファイル: EventInfo.cs プロジェクト: azureskydiver/db4objects
 public EventInfo(string eventFirerName, bool isClientServerEvent, IProcedure4 eventListenerSetter
                  )
 {
     _listenerSetter      = eventListenerSetter;
     _eventFirerName      = eventFirerName;
     _isClientServerEvent = isClientServerEvent;
 }
コード例 #13
0
		public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
			)
		{
			if (key == null)
			{
				throw new ArgumentNullException();
			}
			if (_am.Remove(key))
			{
				_am.AddFirst(key);
				return _slots[key];
			}
			if (_a1out.Contains(key))
			{
				ReclaimFor(key, producer, finalizer);
				_am.AddFirst(key);
				return _slots[key];
			}
			if (_a1in.Contains(key))
			{
				return _slots[key];
			}
			ReclaimFor(key, producer, finalizer);
			_a1in.AddFirst(key);
			return _slots[key];
		}
コード例 #14
0
 public BTreeFreespaceManager(LocalObjectContainer file, IProcedure4 slotFreedCallback
                              , int discardLimit) : base(slotFreedCallback, discardLimit)
 {
     _file     = file;
     _delegate = new InMemoryFreespaceManager(slotFreedCallback, discardLimit);
     _idSystem = file.SystemData().FreespaceIdSystem();
 }
コード例 #15
0
 private void Discard(object key, IProcedure4 finalizer)
 {
     if (null != finalizer)
     {
         finalizer.Apply(_slots[key]);
     }
     Sharpen.Collections.Remove(_slots, key);
 }
コード例 #16
0
        public virtual object Produce(object key, IFunction4 producer, IProcedure4 onDiscard
                                      )
        {
            _calls++;
            IFunction4 delegateProducer = new _IFunction4_26(this, producer);

            return(_delegate.Produce(key, delegateProducer, onDiscard));
        }
コード例 #17
0
		private void AssertEventThrows(string eventName, ICodeBlock codeBlock, IProcedure4
			 listenerSetter)
		{
			IEventRegistry eventRegistry = EventRegistryFactory.ForObjectContainer(Db());
			listenerSetter.Apply(eventRegistry);
			Assert.Expect(typeof(EventException), typeof(NotImplementedException), codeBlock, 
				eventName);
		}
コード例 #18
0
		private void Discard(long key, IProcedure4 finalizer)
		{
			if (null != finalizer)
			{
				finalizer.Apply(_slots[key]);
			}
			Sharpen.Collections.Remove(_slots, key);
		}
コード例 #19
0
ファイル: LRU2QXCache.cs プロジェクト: pondyond/db4o
        private void Discard(object key, IProcedure4 finalizer)
        {
            var removed = Sharpen.Collections.Remove(_slots, key);

            if (finalizer != null)
            {
                finalizer.Apply(removed);
            }
        }
コード例 #20
0
        private void AssertEventThrows(string eventName, ICodeBlock codeBlock, IProcedure4
                                       listenerSetter)
        {
            IEventRegistry eventRegistry = EventRegistryFactory.ForObjectContainer(Db());

            listenerSetter.Apply(eventRegistry);
            Assert.Expect(typeof(EventException), typeof(NotImplementedException), codeBlock,
                          eventName);
        }
コード例 #21
0
 private void AssertInconsistencyDetected(IProcedure4 proc)
 {
     ConsistencyCheckerTestSuite.Item item = new ConsistencyCheckerTestSuite.Item();
     _db.Store(item);
     _db.Commit();
     Assert.IsTrue(new ConsistencyChecker(_db).CheckSlotConsistency().Consistent());
     proc.Apply(item);
     _db.Commit();
     Assert.IsFalse(new ConsistencyChecker(_db).CheckSlotConsistency().Consistent());
 }
コード例 #22
0
 private static long Time(IProcedure4 procedure4)
 {
     var storage = new PagingMemoryStorage();
     StoreItems(storage);
     StopWatch stopWatch = new AutoStopWatch();
     for (var i = 0; i < Iterations; ++i)
     {
         ApplyProcedure(storage, procedure4);
     }
     return stopWatch.Peek();
 }
コード例 #23
0
 private static long Time(IProcedure4 procedure4)
 {
     PagingMemoryStorage storage = new PagingMemoryStorage();
     StoreItems(storage);
     StopWatch stopWatch = new AutoStopWatch();
     for (int i = 0; i < Iterations; ++i)
     {
         ApplyProcedure(storage, procedure4);
     }
     return stopWatch.Peek();
 }
コード例 #24
0
ファイル: CachingBin.cs プロジェクト: erdincay/db4o
		/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
		public CachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize) : base(bin
			)
		{
			_onDiscardPage = new _IProcedure4_22(this);
			_producerFromDisk = new _IFunction4_138(this);
			_producerFromPool = new _IFunction4_147(this);
			_pageSize = pageSize;
			_pagePool = new SimpleObjectPool(NewPagePool(pageCount));
			_cache = cache;
			_fileLength = _bin.Length();
		}
コード例 #25
0
		private void DiscardPage(IProcedure4 finalizer)
		{
			if (_a1.Size() >= _a1_threshold)
			{
				DiscardPageFrom(_a1, finalizer);
			}
			else
			{
				DiscardPageFrom(_am, finalizer);
			}
		}
コード例 #26
0
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public CachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize) : base(bin
                                                                                )
 {
     _onDiscardPage    = new _IProcedure4_22(this);
     _producerFromDisk = new _IFunction4_138(this);
     _producerFromPool = new _IFunction4_147(this);
     _pageSize         = pageSize;
     _pagePool         = new SimpleObjectPool(NewPagePool(pageCount));
     _cache            = cache;
     _fileLength       = _bin.Length();
 }
コード例 #27
0
 private void DiscardPage(IProcedure4 finalizer)
 {
     if (_a1.Size() >= _a1_threshold)
     {
         DiscardPageFrom(_a1, finalizer);
     }
     else
     {
         DiscardPageFrom(_am, finalizer);
     }
 }
コード例 #28
0
        public virtual void TraverseOwnSlots(IProcedure4 block)
        {
            _parentIdSystem.TraverseOwnSlots(block);
            block.Apply(OwnSlotInfo(_persistentState.GetID()));
            block.Apply(OwnSlotInfo(_bTree.GetID()));
            var nodeIds = _bTree.AllNodeIds(_container.SystemTransaction());

            while (nodeIds.MoveNext())
            {
                block.Apply(OwnSlotInfo((((int)nodeIds.Current))));
            }
        }
コード例 #29
0
		public Db4oEmbeddedReplicationProvider(IObjectContainer objectContainer, string name
			)
		{
			// TODO: Add additional query methods (whereModified )
			IConfiguration cfg = objectContainer.Ext().Configure();
			cfg.Callbacks(false);
			_name = name;
			_container = (ExternalObjectContainer)objectContainer;
			_reflector = _container.Reflector();
			_signatureMap = new Db4oSignatureMap(_container);
			_activationStrategy = CreateActivationStrategy();
		}
コード例 #30
0
        public Db4oEmbeddedReplicationProvider(IObjectContainer objectContainer, string name
                                               )
        {
            // TODO: Add additional query methods (whereModified )
            IConfiguration cfg = objectContainer.Ext().Configure();

            cfg.Callbacks(false);
            _name               = name;
            _container          = (ExternalObjectContainer)objectContainer;
            _reflector          = _container.Reflector();
            _signatureMap       = new Db4oSignatureMap(_container);
            _activationStrategy = CreateActivationStrategy();
        }
コード例 #31
0
 private void ProcessEachNode(IProcedure4 action)
 {
     if (_nodes == null)
     {
         return;
     }
     ProcessAllNodes();
     while (_processing.HasNext())
     {
         action.Apply((BTreeNode)_processing.Next());
     }
     _processing = null;
 }
コード例 #32
0
ファイル: ReflectorUtils.cs プロジェクト: erdincay/db4o
		public static void ForEachField(IReflectClass claxx, IProcedure4 procedure)
		{
			while (claxx != null)
			{
				IReflectField[] declaredFields = claxx.GetDeclaredFields();
				for (int reflectFieldIndex = 0; reflectFieldIndex < declaredFields.Length; ++reflectFieldIndex)
				{
					IReflectField reflectField = declaredFields[reflectFieldIndex];
					procedure.Apply(reflectField);
				}
				claxx = claxx.GetSuperclass();
			}
		}
コード例 #33
0
 private void RunTestAfterCommit(IProcedure4 setOperations)
 {
     BigSetTestCase.Holder <BigSetTestCase.Item> holder = NewHolderWithBigSet(new BigSetTestCase.Item
                                                                                  ("1"), new BigSetTestCase.Item("2"));
     StoreAndCommit(holder);
     Db4objects.Db4o.Collections.ISet <BigSetTestCase.Item> set = holder._set;
     Assert.AreEqual(2, set.Count);
     setOperations.Apply(set);
     PurgeAll(holder, holder._set);
     BigSetTestCase.Holder <BigSetTestCase.Item> resurrected = (BigSetTestCase.Holder <BigSetTestCase.Item
                                                                                       >)RetrieveOnlyInstance(holder.GetType());
     IteratorAssert.SameContent(set.GetEnumerator(), resurrected._set.GetEnumerator());
 }
コード例 #34
0
        private void ForEachConstraint(IProcedure4 proc)
        {
            IEnumerator i = IterateConstraints();

            while (i.MoveNext())
            {
                QCon constraint = (QCon)i.Current;
                if (!constraint.ProcessedByIndex())
                {
                    proc.Apply(constraint);
                }
            }
        }
コード例 #35
0
ファイル: ReflectorUtils.cs プロジェクト: pondyond/db4o
 public static void ForEachField(IReflectClass claxx, IProcedure4 procedure)
 {
     while (claxx != null)
     {
         var declaredFields = claxx.GetDeclaredFields();
         for (var reflectFieldIndex = 0; reflectFieldIndex < declaredFields.Length; ++reflectFieldIndex)
         {
             var reflectField = declaredFields[reflectFieldIndex];
             procedure.Apply(reflectField);
         }
         claxx = claxx.GetSuperclass();
     }
 }
コード例 #36
0
 private void WithCache(IProcedure4 procedure)
 {
     IClientSlotCache clientSlotCache = null;
     try
     {
         clientSlotCache = (IClientSlotCache) Reflection4.GetFieldValue(Container(), "_clientSlotCache"
             );
     }
     catch (ReflectException e)
     {
         Assert.Fail("Can't get field _clientSlotCache on  container. " + e);
     }
     procedure.Apply(clientSlotCache);
 }
コード例 #37
0
        private void WithCache(IProcedure4 procedure)
        {
            IClientSlotCache clientSlotCache = null;

            try
            {
                clientSlotCache = (IClientSlotCache)Reflection4.GetFieldValue(Container(), "_clientSlotCache"
                                                                              );
            }
            catch (ReflectException e)
            {
                Assert.Fail("Can't get field _clientSlotCache on  container. " + e.ToString());
            }
            procedure.Apply(clientSlotCache);
        }
コード例 #38
0
 private static void ApplyProcedure(PagingMemoryStorage storage, IProcedure4 procedure4
     )
 {
     IEmbeddedConfiguration config = Db4oEmbedded.NewConfiguration();
     config.File.Storage = storage;
     IEmbeddedObjectContainer container = Db4oEmbedded.OpenFile(config, "benchmark.db4o"
         );
     try
     {
         procedure4.Apply(container);
     }
     finally
     {
         container.Close();
     }
 }
コード例 #39
0
ファイル: BigSetTestCase.cs プロジェクト: pondyond/db4o
        private void RunTestAfterCommit(IProcedure4 setOperations)
        {
            var holder = NewHolderWithBigSet(new Item
                                                 ("1"), new Item("2"));

            StoreAndCommit(holder);
            var set = holder._set;

            Assert.AreEqual(2, set.Count);
            setOperations.Apply(set);
            PurgeAll(holder, holder._set);
            var resurrected = (Holder <Item
                                       >)RetrieveOnlyInstance(holder.GetType());

            IteratorAssert.SameContent(set.GetEnumerator(), resurrected._set.GetEnumerator());
        }
コード例 #40
0
 private static void ApplyProcedure(PagingMemoryStorage storage, IProcedure4 procedure4
     )
 {
     var config = Db4oEmbedded.NewConfiguration();
     config.File.Storage = storage;
     var container = Db4oEmbedded.OpenFile(config, "benchmark.db4o"
         );
     try
     {
         procedure4.Apply(container);
     }
     finally
     {
         container.Close();
     }
 }
コード例 #41
0
		private void AssertInconsistencyDetected(IProcedure4 proc)
		{
			IEmbeddedConfiguration config = NewConfiguration();
			LocalObjectContainer db = (LocalObjectContainer)Db4oEmbedded.OpenFile(config, TempFile
				());
			try
			{
				ConsistencyCheckerTestCase.Item item = new ConsistencyCheckerTestCase.Item();
				db.Store(item);
				db.Commit();
				Assert.IsTrue(new ConsistencyChecker(db).CheckSlotConsistency().Consistent());
				proc.Apply(new Pair(db, item));
				db.Commit();
				Assert.IsFalse(new ConsistencyChecker(db).CheckSlotConsistency().Consistent());
			}
			finally
			{
				db.Close();
			}
		}
コード例 #42
0
        private void AssertInconsistencyDetected(IProcedure4 proc)
        {
            IEmbeddedConfiguration config = NewConfiguration();
            LocalObjectContainer   db     = (LocalObjectContainer)Db4oEmbedded.OpenFile(config, TempFile
                                                                                            ());

            try
            {
                ConsistencyCheckerTestCase.Item item = new ConsistencyCheckerTestCase.Item();
                db.Store(item);
                db.Commit();
                Assert.IsTrue(new ConsistencyChecker(db).CheckSlotConsistency().Consistent());
                proc.Apply(new Pair(db, item));
                db.Commit();
                Assert.IsFalse(new ConsistencyChecker(db).CheckSlotConsistency().Consistent());
            }
            finally
            {
                db.Close();
            }
        }
コード例 #43
0
		public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
			)
		{
			if (_am.Remove((((long)key))))
			{
				_am.AddFirst((((long)key)));
				return _slots[((long)key)];
			}
			if (_a1.Remove((((long)key))))
			{
				_am.AddFirst((((long)key)));
				return _slots[((long)key)];
			}
			if (_slots.Count >= _maxSize)
			{
				DiscardPage(finalizer);
			}
			object value = producer.Apply(((long)key));
			_slots[((long)key)] = value;
			_a1.AddFirst((((long)key)));
			return value;
		}
コード例 #44
0
ファイル: LRU2QLongCache.cs プロジェクト: pondyond/db4o
        public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
                                      )
        {
            if (_am.Remove((((long)key))))
            {
                _am.AddFirst((((long)key)));
                return(_slots[((long)key)]);
            }
            if (_a1.Remove((((long)key))))
            {
                _am.AddFirst((((long)key)));
                return(_slots[((long)key)]);
            }
            if (_slots.Count >= _maxSize)
            {
                DiscardPage(finalizer);
            }
            var value = producer.Apply(((long)key));

            _slots[((long)key)] = value;
            _a1.AddFirst((((long)key)));
            return(value);
        }
コード例 #45
0
ファイル: LRU2QXCache.cs プロジェクト: pondyond/db4o
 private void ReclaimFor(object key, IFunction4 producer, IProcedure4 finalizer)
 {
     if (_slots.Count < _maxSize)
     {
         _slots[key] = producer.Apply(key);
         return;
     }
     if (_a1in.Size() > _inSize)
     {
         var lastKey = _a1in.RemoveLast();
         Discard(lastKey, finalizer);
         if (_a1out.IsFull())
         {
             _a1out.RemoveLast();
         }
         _a1out.AddFirst(lastKey);
     }
     else
     {
         var lastKey = _am.RemoveLast();
         Discard(lastKey, finalizer);
     }
     _slots[key] = producer.Apply(key);
 }
コード例 #46
0
		private void ReclaimFor(object key, IFunction4 producer, IProcedure4 finalizer)
		{
			if (_slots.Count < _maxSize)
			{
				_slots[key] = producer.Apply(key);
				return;
			}
			if (_a1in.Size() > _inSize)
			{
				object lastKey = _a1in.RemoveLast();
				Discard(lastKey, finalizer);
				if (_a1out.IsFull())
				{
					_a1out.RemoveLast();
				}
				_a1out.AddFirst(lastKey);
			}
			else
			{
				object lastKey = _am.RemoveLast();
				Discard(lastKey, finalizer);
			}
			_slots[key] = producer.Apply(key);
		}
コード例 #47
0
ファイル: LRULongCache.cs プロジェクト: erdincay/db4o
		public virtual object Produce(object key, IFunction4 producer, IProcedure4 finalizer
			)
		{
			long longKey = (((long)key));
			if (_last == null)
			{
				object lastValue = producer.Apply(((long)key));
				if (lastValue == null)
				{
					return null;
				}
				_size = 1;
				LRULongCache.Entry lastEntry = new LRULongCache.Entry(longKey, lastValue);
				_slots.Put(longKey, lastEntry);
				_first = lastEntry;
				_last = lastEntry;
				return lastValue;
			}
			LRULongCache.Entry entry = (LRULongCache.Entry)_slots.Get(longKey);
			if (entry == null)
			{
				if (_size >= _maxSize)
				{
					LRULongCache.Entry oldEntry = (LRULongCache.Entry)_slots.Remove(_last._key);
					_last = oldEntry._previous;
					_last._next = null;
					if (null != finalizer)
					{
						finalizer.Apply((object)oldEntry._value);
					}
					_size--;
				}
				object newValue = producer.Apply(((long)key));
				if (newValue == null)
				{
					return null;
				}
				_size++;
				LRULongCache.Entry newEntry = new LRULongCache.Entry(longKey, newValue);
				_slots.Put(longKey, newEntry);
				_first._previous = newEntry;
				newEntry._next = _first;
				_first = newEntry;
				return newValue;
			}
			if (_first == entry)
			{
				return ((object)entry._value);
			}
			LRULongCache.Entry previous = entry._previous;
			entry._previous = null;
			if (_last == entry)
			{
				_last = previous;
			}
			previous._next = entry._next;
			if (previous._next != null)
			{
				previous._next._previous = previous;
			}
			_first._previous = entry;
			entry._next = _first;
			_first = entry;
			return ((object)entry._value);
		}
コード例 #48
0
		public InMemoryFreespaceManager(IProcedure4 slotFreedCallback, int discardLimit, 
			int remainderSizeLimit) : base(slotFreedCallback, discardLimit, remainderSizeLimit
			)
		{
		}
コード例 #49
0
 public object Produce(object key, IFunction4 producer, IProcedure4 onDiscard)
 {
     Record("Produce", key);
     return producer.Apply(key);
 }
コード例 #50
0
ファイル: QCandidates.cs プロジェクト: bvangrinsven/db4o-net
		private void ForEachConstraint(IProcedure4 proc)
		{
			IEnumerator i = IterateConstraints();
			while (i.MoveNext())
			{
				QCon constraint = (QCon)i.Current;
				if (!constraint.ProcessedByIndex())
				{
					proc.Apply(constraint);
				}
			}
		}
コード例 #51
0
			public virtual string Produce(int key, IProcedure4 onDiscard)
			{
				return ((string)cache.Produce(key, producer, onDiscard));
			}
コード例 #52
0
ファイル: EventInfo.cs プロジェクト: masroore/db4o
 public EventInfo(string eventFirerName, IProcedure4 eventListenerSetter) : this(eventFirerName
     , true, eventListenerSetter)
 {
 }
コード例 #53
0
 private void AssertCacheIsCleanAfterTransactionOperation(IProcedure4 operation)
 {
     WithCache(new _IProcedure4_64(this, operation));
 }
コード例 #54
0
 public _IProcedure4_64(ClientSlotCacheTestCase _enclosing, IProcedure4 operation)
 {
     this._enclosing = _enclosing;
     this.operation = operation;
 }
コード例 #55
0
 public virtual void TraverseOwnSlots(IProcedure4 block)
 {
     _delegate.TraverseOwnSlots(block);
 }
コード例 #56
0
 private void DiscardPageFrom(CircularBuffer4 list, IProcedure4 finalizer)
 {
     Discard(list.RemoveLast(), finalizer);
 }
コード例 #57
0
		private void DiscardPageFrom(CircularLongBuffer4 list, IProcedure4 finalizer)
		{
			Discard(list.RemoveLast(), finalizer);
		}
コード例 #58
0
ファイル: BTree.cs プロジェクト: erdincay/db4o
		private void ProcessEachNode(IProcedure4 action)
		{
			if (_nodes == null)
			{
				return;
			}
			ProcessAllNodes();
			while (_processing.HasNext())
			{
				action.Apply((BTreeNode)_processing.Next());
			}
			_processing = null;
		}
コード例 #59
0
		private void ForEachClassId(IProcedure4 procedure)
		{
			for (IEnumerator ids = _stream.ClassCollection().Ids(); ids.MoveNext(); )
			{
				procedure.Apply((int)ids.Current);
			}
		}
コード例 #60
0
 public virtual object Produce(object key, IFunction4 producer, IProcedure4 onDiscard
                               )
 {
     return(producer.Apply(key));
 }