예제 #1
0
        public void SetNewRoot(IRootNode artRoot)
        {
            var newRoot = (RootNode12)artRoot;

            if (newRoot._impl != _rootNode._impl)
            {
                throw new ArgumentException("SetNewRoot allows only same db instance");
            }
            _rootNode = (RootNode12)artRoot;
        }
예제 #2
0
        public IRootNode CreateWritableTransaction()
        {
            if (_writable)
            {
                throw new InvalidOperationException("Only readonly root node could be CreateWritableTransaction");
            }
            var node = new RootNode12(_impl);

            node._writable     = true;
            node._root         = _root;
            node.CommitUlong   = CommitUlong;
            node.TransactionId = TransactionId + 1;
            node.TrLogFileId   = TrLogFileId;
            node.TrLogOffset   = TrLogOffset;
            node._ulongs       = _ulongs == null ? null : (ulong[])_ulongs.Clone();
            NodeUtils12.Reference(_root);
            return(node);
        }
예제 #3
0
        public IRootNode Snapshot()
        {
            var snapshot = new RootNode12(_impl);

            snapshot._writable     = false;
            snapshot._root         = _root;
            snapshot.CommitUlong   = CommitUlong;
            snapshot.TransactionId = TransactionId;
            snapshot.TrLogFileId   = TrLogFileId;
            snapshot.TrLogOffset   = TrLogOffset;
            snapshot._ulongs       = _ulongs == null ? null : (ulong[])_ulongs.Clone();
            if (_writable)
            {
                TransactionId++;
            }
            NodeUtils12.Reference(_root);
            return(snapshot);
        }
예제 #4
0
파일: RootNode12.cs 프로젝트: yardee/BTDB
        public IRootNode CreateWritableTransaction()
        {
            if (Writable)
            {
                throw new InvalidOperationException("Only readonly root node could be CreateWritableTransaction");
            }
            var node = new RootNode12(Impl)
            {
                Writable      = true,
                Root          = Root,
                CommitUlong   = CommitUlong,
                TransactionId = TransactionId + 1,
                TrLogFileId   = TrLogFileId,
                TrLogOffset   = TrLogOffset,
                _ulongs       = (ulong[])_ulongs?.Clone()
            };

            NodeUtils12.Reference(Root);
            return(node);
        }
예제 #5
0
파일: RootNode12.cs 프로젝트: yardee/BTDB
        public IRootNode Snapshot()
        {
            var snapshot = new RootNode12(Impl)
            {
                Writable      = false,
                Root          = Root,
                CommitUlong   = CommitUlong,
                TransactionId = TransactionId,
                TrLogFileId   = TrLogFileId,
                TrLogOffset   = TrLogOffset,
                _ulongs       = (ulong[])_ulongs?.Clone()
            };

            if (Writable)
            {
                TransactionId++;
            }
            NodeUtils12.Reference(Root);
            return(snapshot);
        }
예제 #6
0
 Cursor12(Cursor12 from)
 {
     _rootNode = from._rootNode;
     _stack    = new StructList <CursorItem>(from._stack);
 }
예제 #7
0
 public Cursor12(RootNode12 rootNode)
 {
     _rootNode = rootNode;
     _stack    = new StructList <CursorItem>();
 }