Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/02/10 17:27:24 (14 years ago)
Author:
cneumuel
Message:
  • Made HiveExperiment storable, so that a running HiveExperiment can be disconnected, stored and later resumed. (#1115)
  • Added Log to each JobItem (#1115)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3-HiveMigration/sources/HeuristicLab.Hive/HeuristicLab.Hive.Contracts/3.3/BusinessObjects/SerializedJob.cs

    r3011 r4133  
    2525using System.Text;
    2626using System.Runtime.Serialization;
     27using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
     28using HeuristicLab.Common;
    2729
    2830namespace HeuristicLab.Hive.Contracts.BusinessObjects {
     31  [StorableClass]
    2932  [DataContract]
    3033  [Serializable]
    31   public class SerializedJob {
     34  public class SerializedJob : IDeepCloneable {
     35    [Storable]
    3236    [DataMember]
    3337    public JobDto JobInfo { get; set; }
    34    
     38    [Storable]
    3539    [DataMember]
    3640    public byte[] SerializedJobData { get; set; }
     41
     42    public virtual IDeepCloneable Clone(Cloner cloner) {
     43      SerializedJob clone = (SerializedJob)Activator.CreateInstance(this.GetType(), true);
     44      cloner.RegisterClonedObject(this, clone);
     45      clone.JobInfo = (JobDto)cloner.Clone(this.JobInfo);
     46      clone.SerializedJobData = new byte[this.SerializedJobData.Length];
     47      Array.Copy(this.SerializedJobData, clone.SerializedJobData, this.SerializedJobData.Length);
     48      return clone;
     49    }
     50
     51    public object Clone() {
     52      return Clone(new Cloner());
     53    }
    3754  }
    3855}
Note: See TracChangeset for help on using the changeset viewer.