/// <summary> /// Creates the merge operation for all fields of specified object. /// </summary> /// <param name="objectValue">The object value.</param> private void mergeObject(ObjectValue objectValue) { ObjectDescriptorBuilder builder = new ObjectDescriptor(objectValue, null, ObjectIndex.CreateUnknown(objectValue)) .Builder(); ContainerOperations collectVariables = new ContainerOperations(this, builder, builder.UnknownIndex, builder.UnknownIndex); foreach (Snapshot snapshot in sourceSnapshots) { ObjectDescriptor descriptor; if (snapshot.Structure.TryGetDescriptor(objectValue, out descriptor)) { collectVariables.CollectIndexes(snapshot, builder.UnknownIndex, descriptor); builder.Type = descriptor.Type; } else { collectVariables.SetUndefined(); } } collectVariables.MergeContainers(); Structure.ObjectDescriptors.Add(objectValue, builder.Build()); }
/// <summary> /// Determines whether this index is part of acces path of the other index. /// </summary> /// <param name="otherIndex">Index of the other.</param> /// <returns> /// True whether this index is prefix of the given one. /// </returns> internal override bool IsPrefixOf(MemoryIndex otherIndex) { ObjectIndex objIndex = otherIndex as ObjectIndex; if (objIndex != null) { return(Object.Equals(objIndex.Object) && base.IsPrefixOf(otherIndex)); } else { return(false); } }
/// <summary> /// Determines whether the specified <see cref="System.Object" />, is equal to this instance. /// </summary> /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param> /// <returns> /// <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>. /// </returns> public override bool Equals(object obj) { ObjectIndex otherIndex = obj as ObjectIndex; if (otherIndex != null) { return(Object.Equals(otherIndex.Object) && base.Equals(obj)); } else { return(false); } }
/// <summary> /// Initializes a new instance of the <see cref="ObjectIndex"/> class. /// </summary> /// <param name="parentIndex">Index of the parent.</param> /// <param name="callLevel">The call level.</param> public ObjectIndex(ObjectIndex parentIndex, int callLevel) : base(parentIndex, callLevel) { Object = parentIndex.Object; }
/// <summary> /// Initializes a new instance of the <see cref="ObjectIndex"/> class. /// </summary> /// <param name="parentIndex">Index of the parent.</param> /// <param name="path">The path.</param> public ObjectIndex(ObjectIndex parentIndex, List <IndexSegment> path) : base(parentIndex, path) { Object = parentIndex.Object; }
/// <summary> /// Initializes a new instance of the <see cref="ObjectIndex"/> class. /// </summary> /// <param name="parentIndex">Index of the parent.</param> /// <param name="pathName">Name of the path.</param> public ObjectIndex(ObjectIndex parentIndex, IndexSegment pathName) : base(parentIndex, pathName) { Object = parentIndex.Object; }