예제 #1
0
        /// <inheritdoc />
        public override void SetArray(MemoryIndex index, AssociativeArray arrayValue)
        {
            IIndexDefinition data;

            if (!indexDefinitions.TryGetValue(index, out data))
            {
                data = new CopyIndexDefinition();
            }

            IIndexDefinitionBuilder builder = data.Builder(this);

            builder.SetArray(arrayValue);

            indexDefinitions[index] = builder.Build(this);

            IArrayDescriptor descriptor;

            if (TryGetDescriptor(arrayValue, out descriptor))
            {
                if (descriptor.ParentIndex != null)
                {
                    GetWriteableStackContext(descriptor.ParentIndex.CallLevel).WriteableArrays.Remove(arrayValue);
                }
            }
            GetWriteableStackContext(index.CallLevel).WriteableArrays.Add(arrayValue);
        }
예제 #2
0
        /// <inheritdoc />
        public override void SetAlias(MemoryIndex index, IMemoryAlias alias)
        {
            IIndexDefinition data;

            if (!indexDefinitions.TryGetValue(index, out data))
            {
                data = new CopyIndexDefinition();
            }

            IIndexDefinitionBuilder builder = data.Builder(this);

            builder.SetAliases(alias);

            indexDefinitions[index] = builder.Build(this);
        }
예제 #3
0
        /// <inheritdoc />
        public override void SetObjects(MemoryIndex index, IObjectValueContainer objects)
        {
            IIndexDefinition data;

            if (!indexDefinitions.TryGetValue(index, out data))
            {
                data = new CopyIndexDefinition();
            }

            IIndexDefinitionBuilder builder = data.Builder(this);

            builder.SetObjects(objects);

            indexDefinitions[index] = builder.Build(this);
        }
예제 #4
0
        /// <inheritdoc />
        public override void RemoveArray(MemoryIndex index, AssociativeArray arrayValue)
        {
            arrayDescriptors.Remove(arrayValue);

            IIndexDefinition data;

            if (!indexDefinitions.TryGetValue(index, out data))
            {
                data = new CopyIndexDefinition();
            }

            IIndexDefinitionBuilder builder = data.Builder(this);

            builder.SetArray(null);

            indexDefinitions[index] = builder.Build(this);
            GetWriteableStackContext(index.CallLevel).WriteableArrays.Remove(arrayValue);
        }
예제 #5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CopyIndexDefinition"/> class.
 /// </summary>
 /// <param name="indexDefinition">The index definition.</param>
 public CopyIndexDefinition(CopyIndexDefinition indexDefinition)
 {
     this.aliases    = indexDefinition.aliases;
     this.objects    = indexDefinition.objects;
     this.arrayValue = indexDefinition.arrayValue;
 }
예제 #6
0
        /// <inheritdoc />
        public override void NewIndex(MemoryIndex index)
        {
            CopyIndexDefinition data = new CopyIndexDefinition();

            indexDefinitions.Add(index, data);
        }