Exemplo n.º 1
0
        protected override MemoryIndex createNewTargetIndex(ITargetContainerContext targetContainerContext, string childName)
        {
            MemoryIndex targetIndex = targetContainerContext.createMemoryIndex(childName);

            targetContainerContext.getWriteableSourceContainer().AddIndex(childName, targetIndex);

            return(targetIndex);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Enqueues the delete operation.
        /// </summary>
        /// <param name="childName">Name of the child.</param>
        /// <param name="operation">The operation.</param>
        /// <param name="targetContainerContext">The target container context.</param>
        /// <param name="childTreeNode">The child tree node.</param>
        private void enqueueDeleteOperation(string childName, MergeOperation operation, ITargetContainerContext targetContainerContext, MemoryIndexTreeNode childTreeNode)
        {
            IReadonlyIndexContainer targetContainer = targetContainerContext.getSourceContainer();
            MemoryIndex             targetIndex;

            if (targetContainer.TryGetIndex(childName, out targetIndex))
            {
                // Enque delete operation only if target index exists in paret snapshot
                operation.TreeNode = childTreeNode;
                operation.SetTargetIndex(targetIndex);
                operation.SetDeleteOperation();
                operationQueue.AddLast(operation);

                // Delete child from parent container
                targetContainerContext.getWriteableSourceContainer().RemoveIndex(childName);
            }
        }
Exemplo n.º 3
0
 protected override void deleteChild(ITargetContainerContext targetContainerContext, string childName)
 {
     targetContainerContext.getWriteableSourceContainer().RemoveIndex(childName);
 }