예제 #1
0
        /// <summary>
        /// Merges the memory index data.
        /// </summary>
        /// <param name="targetIndex">Index of the target.</param>
        private void mergeMemoryIndexData(MemoryIndex targetIndex)
        {
            IIndexDefinition definition;

            if (targetStructure.TryGetIndexDefinition(targetIndex, out definition))
            {
                bool valuesAlwaysDefined = collectValues(targetIndex);

                if (definition.Array != null)
                {
                    values.Add(definition.Array);
                }
                if (!valuesAlwaysDefined)
                {
                    values.Add(targetSnapshot.UndefinedValue);
                }

                MemoryEntry entry = targetSnapshot.CreateMemoryEntry(values);
                writeableTargetData.SetMemoryEntry(targetIndex, entry);

                values.Clear();
            }
            else
            {
                // Target index is not part of the structure - remove it
                writeableTargetData.RemoveMemoryEntry(targetIndex);
            }
        }
예제 #2
0
            public override void provideCustomOperation(MemoryIndex targetIndex)
            {
                if (operation.IsUndefined)
                {
                    values.Add(targetSnapshot.UndefinedValue);
                }

                IIndexDefinition definition;

                if (targetStructure.TryGetIndexDefinition(operation.TargetIndex, out definition))
                {
                    if (definition.Array != null)
                    {
                        values.Add(definition.Array);
                    }
                }

                writeableTargetData.SetMemoryEntry(operation.TargetIndex, targetSnapshot.CreateMemoryEntry(values));
            }