Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/06/10 01:56:04 (13 years ago)
Author:
swagner
Message:

Merged cloning refactoring branch back into trunk (#922)

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources

  • trunk/sources/HeuristicLab.Operators/3.3/Operator.cs

    r4477 r4722  
    8585    }
    8686
     87    [StorableConstructor]
     88    protected Operator(bool deserializing) : base(deserializing) { }
     89    protected Operator(Operator original, Cloner cloner)
     90      : base(original, cloner) {
     91      this.canceled = original.canceled;
     92      this.breakpoint = original.breakpoint;
     93      this.executionContext = cloner.Clone<IExecutionContext>(original.executionContext);
     94    }
    8795    /// <summary>
    8896    /// Initializes a new instance of <see cref="OperatorBase"/> setting the breakpoint flag and
     
    113121      canceled = false;
    114122      breakpoint = false;
    115     }
    116     [StorableConstructor]
    117     protected Operator(bool deserializing) : base(deserializing) { }
    118 
    119     /// <summary>
    120     /// Clones the current instance (deep clone).
    121     /// </summary>
    122     /// <remarks>Clones also sub operators, variables and variable infos.</remarks>
    123     /// <param name="clonedObjects">Dictionary of all already cloned objects. (Needed to avoid cycles.)</param>
    124     /// <returns>The cloned object as <see cref="OperatorBase"/>.</returns>
    125     public override IDeepCloneable Clone(Cloner cloner) {
    126       Operator clone = (Operator)base.Clone(cloner);
    127       clone.canceled = canceled;
    128       clone.breakpoint = breakpoint;
    129       clone.executionContext = (IExecutionContext)cloner.Clone(executionContext);
    130       return clone;
    131123    }
    132124
Note: See TracChangeset for help on using the changeset viewer.