Changeset 12031 for branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs
- Timestamp:
- 02/18/15 10:54:32 (9 years ago)
- Location:
- branches/HeuristicLab.DatasetRefactor/sources
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources
- Property svn:mergeinfo changed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Core/3.3/Collections/DirectedGraph/Vertex.cs
r11263 r12031 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 4Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2015 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 52 52 } 53 53 54 [Storable]55 private IDeepCloneable data;56 public IDeepCloneable Data {57 get { return data; }58 set {59 if (data == value) return;60 data = value;61 OnChanged(this, EventArgs.Empty);62 }63 }64 65 54 private readonly List<IArc> inArcs = new List<IArc>(); 66 55 public IEnumerable<IArc> InArcs { … … 83 72 private void AfterDeserialization() { } 84 73 85 public Vertex(IDeepCloneable data) { 86 this.data = data; 87 } 74 public Vertex() { } 88 75 89 76 protected Vertex(Vertex original, Cloner cloner) 90 77 : base(original, cloner) { 91 data = cloner.Clone(original.Data);92 78 label = original.Label; 93 79 weight = original.Weight; 94 95 80 // we do not clone the arcs here (would cause too much recursion and ultimately a stack overflow) 96 81 } … … 157 142 158 143 [StorableClass] 159 public class Vertex<T> : Vertex, IVertex<T> where T : class,IItem { 160 public new T Data { 161 get { return (T)base.Data; } 162 set { base.Data = value; } 144 public class Vertex<T> : Vertex, IVertex<T> where T : class,IDeepCloneable { 145 [Storable] 146 private T data; 147 public T Data { 148 get { return data; } 149 set { 150 if (data == value) return; 151 data = value; 152 OnChanged(this, EventArgs.Empty); 153 } 163 154 } 164 155 … … 168 159 protected Vertex(Vertex<T> original, Cloner cloner) 169 160 : base(original, cloner) { 161 if (original.Data != null) 162 Data = cloner.Clone(original.Data); 170 163 } 171 164 172 public Vertex(IDeepCloneable data) 173 : base(data) { 174 } 165 public Vertex() : base() { } 175 166 176 167 public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset
for help on using the changeset viewer.