Example #1
0
        public IValueModel GetValueModel(ITypeSymbol type, HeapModelLocation location, IHeapModel heap)
        {
            Contract.Requires(type != null, nameof(type));
            Contract.Requires(this.IsTypeSupported(type), nameof(type));

            return(new ReferenceValueModel(this, location, heap));
        }
Example #2
0
 public IEnumerable <HeapModelValue> GetValues(HeapModelLocation location)
 {
     if (location.Id == HeapModelLocation.NullId || location.Id == 2)
     {
         return(new HeapModelValue[0]);
     }
     else
     {
         return(new[]
         {
             new HeapModelValue(
                 SampleLinkedListDefinitions.Value,
                 ExpressionFactory.IntInterpretation(location.Id))
         });
     }
 }
Example #3
0
        public IEnumerable <HeapModelReference> GetReferences(HeapModelLocation location)
        {
            switch (location.Id)
            {
            case 1:
                if (location.HeapVersion <= 1)
                {
                    return(new[]
                    {
                        new HeapModelReference(SampleLinkedListDefinitions.Next, HeapModelLocation.NullId)
                    });
                }
                else
                {
                    return(new[]
                    {
                        new HeapModelReference(SampleLinkedListDefinitions.Next, 2)
                    });
                }

            case 2:
                if (location.HeapVersion <= 2)
                {
                    return(new HeapModelReference[0]);
                }
                else
                {
                    return(new[]
                    {
                        new HeapModelReference(SampleLinkedListDefinitions.Next, 3)
                    });
                }

            case 3:
                return(new[]
                {
                    new HeapModelReference(SampleLinkedListDefinitions.Next, 3)
                });

            default:
                return(new HeapModelReference[0]);
            }
        }
 public IValueModel GetValueModel(ITypeSymbol type, HeapModelLocation location, IHeapModel heap)
 {
     throw new NotSupportedException();
 }
 internal ReferenceValueModel(ReferenceModelFactory factory, HeapModelLocation location, IHeapModel heap)
     : base(factory)
 {
     this.location = location;
     this.heap     = heap;
 }
Example #6
0
 public IEnumerable <HeapModelValue> GetValues(HeapModelLocation location)
 {
     return(this.heapVersions[location.HeapVersion][location.Id].ValueFields
            .Select(kvp => new HeapModelValue(kvp.Key, kvp.Value)));
 }