コード例 #1
0
 public BTree(Transaction trans, BTreeConfiguration config, int id, IIndexable4 keyHandler
              , int treeNodeSize) : base(config._idSystem)
 {
     _config = config;
     if (null == keyHandler)
     {
         throw new ArgumentNullException();
     }
     _nodeSize     = treeNodeSize;
     _nodeCache    = CacheFactory.NewLRUIntCache(config._cacheSize);
     _halfNodeSize = _nodeSize / 2;
     _nodeSize     = _halfNodeSize * 2;
     _keyHandler   = keyHandler;
     SetID(id);
     if (IsNew())
     {
         SetStateDirty();
         _root = new BTreeNode(this, 0, true, 0, 0, 0);
         _root.Write(trans.SystemTransaction());
         AddNode(_root);
         Write(trans.SystemTransaction());
     }
     else
     {
         SetStateDeactivated();
     }
 }
コード例 #2
0
ファイル: BTree.cs プロジェクト: superyfwy/db4o
		public BTree(Transaction trans, BTreeConfiguration config, int id, IIndexable4 keyHandler
			, int treeNodeSize) : base(config._idSystem)
		{
			_config = config;
			if (null == keyHandler)
			{
				throw new ArgumentNullException();
			}
			_nodeSize = treeNodeSize;
			_nodeCache = CacheFactory.NewLRUIntCache(config._cacheSize);
			_halfNodeSize = _nodeSize / 2;
			_nodeSize = _halfNodeSize * 2;
			_keyHandler = keyHandler;
			SetID(id);
			if (IsNew())
			{
				SetStateDirty();
				_root = new BTreeNode(this, 0, true, 0, 0, 0);
				_root.Write(trans.SystemTransaction());
				AddNode(_root);
				Write(trans.SystemTransaction());
			}
			else
			{
				SetStateDeactivated();
			}
		}
コード例 #3
0
ファイル: SynchronizedCache.cs プロジェクト: pondyond/db4o
 public SynchronizedCache(ICache4 <TKey, TValue> implementation)
 {
     if (null == implementation)
     {
         throw new ArgumentNullException("implementation");
     }
     this.implementation = implementation;
 }
コード例 #4
0
        public virtual void TestProduce()
        {
            object  obj   = new object();
            ICache4 cache = ((ICache4)SubjectFixtureProvider.Value());
            object  value = cache.Produce(1, new _IFunction4_39(obj), null);

            Assert.AreSame(obj, value);
            Assert.AreSame(obj, cache.Produce(1, null, null));
        }
コード例 #5
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();
 }
コード例 #6
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();
		}
コード例 #7
0
 public static ICache4 <TKey, TValue> For(ICache4 cache4, IEqualityComparer <TKey> comparer)
 {
     return(new Cache4CachingStrategyWithComparer <TKey, TValue>(cache4, comparer));
 }
コード例 #8
0
 public static ICache4 <TKey, TValue> For(ICache4 cache4)
 {
     return(new Cache4CachingStrategy <TKey, TValue>(cache4));
 }
コード例 #9
0
 public TracingCacheDecorator(ICache4 <TKey, TValue> @delegate)
 {
     _delegate = @delegate;
 }
コード例 #10
0
 /// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
 public NonFlushingCachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize
                              ) : base(bin, cache, pageCount, pageSize)
 {
 }
コード例 #11
0
        private MetadataResolver()
        {
            _assemblyCache = CacheFactory <Assembly, AssemblyDefinition> .For(CacheFactory.New2QXCache(5));

            _methodCache = CacheFactory <MethodInfo, MethodDefinition> .For(CacheFactory.New2QXCache(5));
        }
コード例 #12
0
		private MetadataResolver()
		{
			_assemblyCache = CacheFactory<Assembly, AssemblyDefinition>.For(CacheFactory.New2QXCache(5));
			_methodCache = CacheFactory<MethodInfo, MethodDefinition>.For(CacheFactory.New2QXCache(5));
		}
コード例 #13
0
		public CacheStatistics(ICache4 delegate_)
		{
			_delegate = delegate_;
		}
コード例 #14
0
 public CacheStatistics(ICache4 delegate_)
 {
     _delegate = delegate_;
 }
コード例 #15
0
			/// <exception cref="Db4objects.Db4o.Ext.Db4oIOException"></exception>
			public NonFlushingCachingBin(IBin bin, ICache4 cache, int pageCount, int pageSize
				) : base(bin, cache, pageCount, pageSize)
			{
			}
コード例 #16
0
 public Cache4CachingStrategy(ICache4 cache4)
 {
     _cache4 = cache4;
 }
コード例 #17
0
 public Cache4CachingStrategyWithComparer(ICache4 cache4, IEqualityComparer <TKey> comparer) : base(cache4)
 {
     _comparer = comparer;
 }
コード例 #18
0
 private static ICache4 <TKey, TValue> SynchonizedCache(ICache4 <TKey, TValue> cacheImplementation)
 {
     return(new SynchronizedCache <TKey, TValue>(cacheImplementation));
 }