Changeset 887 for branches/CloningRefactorBranch/HeuristicLab.DistributedEngine/DistributedEngine.cs
- Timestamp:
- 12/02/08 21:10:17 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/CloningRefactorBranch/HeuristicLab.DistributedEngine/DistributedEngine.cs
r438 r887 47 47 } 48 48 } 49 50 /// <summary> 51 /// Default constructor 52 /// </summary> 53 public DistributedEngine() { } 54 55 /// <summary> 56 /// Copy constructor to create deep clones. 57 /// </summary> 58 /// <param name="original">The instance to be cloned.</param> 59 public DistributedEngine(DistributedEngine original) : this(original, new Dictionary<Guid, object>()) { } 60 61 /// <summary> 62 /// Copy constructor for DistributedEngine clones (deep clone) reusing already cloned object references 63 /// </summary> 64 /// <remarks>Calls the copy constructor of the base class <see cref="EngineBase"/></remarks> 65 /// <param name="original">Instance to be cloned</param> 66 /// <param name="clonedObjects">Already cloned object reference</param> 67 protected DistributedEngine(DistributedEngine original, IDictionary<Guid, object> clonedObjects) 68 : base(original, clonedObjects) { 69 this.ServerAddress = original.ServerAddress; 70 } 71 /// <summary> 72 /// Creates a deep clone with the copy constructor reusing already cloned 73 /// object references. 74 /// </summary> 75 /// <param name="clonedObjects">Already cloned objects (for referential integrity).</param> 76 /// <returns>The cloned instance.</returns> 49 77 public override object Clone(IDictionary<Guid, object> clonedObjects) { 50 DistributedEngine clone = (DistributedEngine)base.Clone(clonedObjects); 51 clone.ServerAddress = serverAddress; 52 return clone; 78 return new DistributedEngine(this, clonedObjects); 53 79 } 54 80 … … 313 339 } 314 340 341 315 342 #region Persistence Methods 316 343 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
Note: See TracChangeset
for help on using the changeset viewer.