private void CancelRemoval(Transaction trans, object obj, int index) { BTreeUpdate patch = (BTreeUpdate)KeyPatch(index); BTreeUpdate nextPatch = patch.RemoveFor(trans); _keys[index] = NewCancelledRemoval(trans, patch.GetObject(), obj, nextPatch); SizeIncrement(trans); }
public BTreeCancelledRemoval(Transaction transaction, object originalKey, object newKey, BTreeUpdate existingPatches) : base(transaction, originalKey) { _newKey = newKey; if (null != existingPatches) { Append(existingPatches); } }
public override int SizeDiff(Transaction trans) { Db4objects.Db4o.Internal.Btree.BTreeUpdate patchForTransaction = (Db4objects.Db4o.Internal.Btree.BTreeUpdate )ForTransaction(trans); if (patchForTransaction == null) { return(1); } return(patchForTransaction.SizeDiff()); }
private void SetNextIfPatch(object newNext) { if (newNext is Db4objects.Db4o.Internal.Btree.BTreeUpdate) { _next = (Db4objects.Db4o.Internal.Btree.BTreeUpdate)newNext; } else { _next = null; } }
private void SetNextIfPatch(object newNext) { if (newNext is BTreeUpdate) { _next = (BTreeUpdate)newNext; } else { _next = null; } }
public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate RemoveFor(Transaction trans ) { if (_transaction == trans) { return _next; } if (_next != null) { _next = _next.RemoveFor(trans); } return this; }
public virtual BTreeUpdate RemoveFor(Transaction trans ) { if (_transaction == trans) { return(_next); } if (_next != null) { _next = _next.RemoveFor(trans); } return(this); }
public virtual BTreeUpdate RemoveFor(Transaction trans ) { if (_transaction == trans) { return _next; } if (_next != null) { _next = _next.RemoveFor(trans); } return this; }
public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate RemoveFor(Transaction trans ) { if (_transaction == trans) { return(_next); } if (_next != null) { _next = _next.RemoveFor(trans); } return(this); }
public virtual void Append(Db4objects.Db4o.Internal.Btree.BTreeUpdate patch) { if (_transaction == patch._transaction) { throw new ArgumentException(); } if (!HasNext()) { _next = patch; } else { _next.Append(patch); } }
public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate ReplacePatch(BTreePatch patch, Db4objects.Db4o.Internal.Btree.BTreeUpdate update) { if (patch == this) { update._next = _next; return(update); } if (_next == null) { throw new InvalidOperationException(); } _next = _next.ReplacePatch(patch, update); return(this); }
public virtual BTreeUpdate ReplacePatch(BTreePatch patch, BTreeUpdate update) { if (patch == this) { update._next = _next; return(update); } if (_next == null) { throw new InvalidOperationException(); } _next = _next.ReplacePatch(patch, update); return(this); }
public virtual void Append(BTreeUpdate patch) { if (_transaction == patch._transaction) { // don't allow two patches for the same transaction throw new ArgumentException(); } if (!HasNext()) { _next = patch; } else { _next.Append(patch); } }
public override object Commit(Transaction trans, BTree btree, BTreeNode node) { Db4objects.Db4o.Internal.Btree.BTreeUpdate patch = (Db4objects.Db4o.Internal.Btree.BTreeUpdate )ForTransaction(trans); if (patch is BTreeCancelledRemoval) { object obj = patch.GetCommittedObject(); ApplyKeyChange(obj); } else { if (patch is BTreeRemove) { RemovedBy(trans, btree, node); patch.Committed(btree); return(No4.Instance); } } return(InternalCommit(trans, btree)); }
private BTreePatch NewCancelledRemoval(Transaction trans, object originalObject, object currentObject, BTreeUpdate existingPatches) { return(new BTreeCancelledRemoval(trans, originalObject, currentObject, existingPatches )); }
public virtual Db4objects.Db4o.Internal.Btree.BTreeUpdate ReplacePatch(BTreePatch patch, Db4objects.Db4o.Internal.Btree.BTreeUpdate update) { if (patch == this) { update._next = _next; return update; } if (_next == null) { throw new InvalidOperationException(); } _next = _next.ReplacePatch(patch, update); return this; }
private BTreePatch NewCancelledRemoval(Transaction trans, object originalObject, object currentObject, BTreeUpdate existingPatches) { return new BTreeCancelledRemoval(trans, originalObject, currentObject, existingPatches ); }
public virtual BTreeUpdate ReplacePatch(BTreePatch patch, BTreeUpdate update) { if (patch == this) { update._next = _next; return update; } if (_next == null) { throw new InvalidOperationException(); } _next = _next.ReplacePatch(patch, update); return this; }
private void SetNextIfPatch(object newNext) { if (newNext is BTreeUpdate) { _next = (BTreeUpdate) newNext; } else { _next = null; } }