コード例 #1
0
ファイル: DbEngine.cs プロジェクト: WongKyle/xoff
        public DbEngine(IDiskService disk, Logger log)
        {
            // initialize disk service and check if database exists
            var isNew = disk.Initialize();

            // new database? create new datafile
            if (isNew)
            {
                disk.CreateNew();
            }

            _log  = log;
            _disk = disk;

            // initialize all services
            _cache       = new CacheService();
            _pager       = new PageService(_disk, _cache);
            _indexer     = new IndexService(_pager);
            _data        = new DataService(_pager);
            _collections = new CollectionService(_pager, _indexer, _data);
            _transaction = new TransactionService(_disk, _pager, _cache);
        }