Beispiel #1
0
        /// <summary>
        /// Deletes the array.
        /// </summary>
        /// <param name="targetIndex">Index of the target.</param>
        /// <param name="targetArray">The target array.</param>
        public void DeleteArray(MemoryIndex targetIndex, AssociativeArray targetArray)
        {
            IArrayDescriptor targetArrayDescriptor = targetStructure.GetDescriptor(targetArray);

            foreach (var index in targetArrayDescriptor.Indexes)
            {
                // Enqueue delete operation for every child index
                MemoryIndex    childIndex     = index.Value;
                MergeOperation childOperation = new MergeOperation();
                childOperation.SetTargetIndex(childIndex);
                childOperation.SetDeleteOperation();
                operationQueue.AddLast(childOperation);
            }

            // Enqueue delete operation for unknown index
            MergeOperation unknownOperation = new MergeOperation();

            unknownOperation.SetTargetIndex(targetArrayDescriptor.UnknownIndex);
            unknownOperation.SetUndefined();
            unknownOperation.SetDeleteOperation();
            operationQueue.AddLast(unknownOperation);

            // Deletes array from structure
            writeableTargetStructure.RemoveArray(targetIndex, targetArray);
        }
Beispiel #2
0
            public override void provideCustomDeleteOperation(MemoryIndex targetIndex, IIndexDefinition targetDefinition)
            {
                if (targetDefinition.Array != null)
                {
                    writeableTargetStructure.RemoveArray(targetIndex, targetDefinition.Array);
                }

                if (targetDefinition.Aliases != null)
                {
                    foreach (MemoryIndex aliasIndex in targetDefinition.Aliases.MustAliases)
                    {
                        MemoryAliasInfo aliasInfo = mergeWorker.getAliasInfo(aliasIndex);
                        aliasInfo.AddRemovedAlias(targetIndex);
                    }

                    foreach (MemoryIndex aliasIndex in targetDefinition.Aliases.MayAliases)
                    {
                        MemoryAliasInfo aliasInfo = mergeWorker.getAliasInfo(aliasIndex);
                        aliasInfo.AddRemovedAlias(targetIndex);
                    }
                }

                writeableTargetStructure.RemoveIndex(targetIndex);
            }