Free cookie consent management tool by TermsFeed Policy Generator

source: branches/1772_HeuristicLab.EvolutionTracking/HeuristicLab.EvolutionTracking/3.4/Fragment.cs @ 17607

Last change on this file since 17607 was 17434, checked in by bburlacu, 5 years ago

#1772: Merge trunk changes and fix all errors and compilation warnings.

File size: 1.7 KB
Line 
1using HEAL.Attic;
2using HeuristicLab.Common;
3using HeuristicLab.Core;
4using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
5
6namespace HeuristicLab.EvolutionTracking {
7  [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")]
8  [StorableType("21BE7538-052E-451E-A0A3-CD8CBF51B051")]
9  public class Fragment : Item, IFragment {
10    [Storable]
11    public int Index1 { get; set; }
12
13    [Storable]
14    public int Index2 { get; set; }
15
16    [Storable]
17    private object root;
18    public object Root {
19      get { return root; }
20      set { root = value; }
21    }
22    [StorableConstructor]
23    protected Fragment(StorableConstructorFlag _) : base(_) { }
24
25    protected Fragment(Fragment original, Cloner cloner)
26      : base(original, cloner) {
27      Root = original.Root;
28      Index1 = original.Index1;
29      Index2 = original.Index2;
30    }
31
32    public override IDeepCloneable Clone(Cloner cloner) {
33      return new Fragment(this, cloner);
34    }
35
36    public Fragment() { }
37  }
38
39  [Item("Fragment", "A fragment is an object that represents a piece of inherited genetic information.")]
40  [StorableType("19346017-6C9E-41BF-BCD2-00B1FE82F2FA")]
41  public class Fragment<T> : Fragment, IFragment<T> where T : class {
42    public new T Root {
43      get { return (T)base.Root; }
44      set { base.Root = value; }
45    }
46
47    public override IDeepCloneable Clone(Cloner cloner) {
48      return new Fragment<T>(this, cloner);
49    }
50
51    protected Fragment(Fragment<T> original, Cloner cloner)
52      : base(original, cloner) {
53    }
54
55    [StorableConstructor]
56    protected Fragment(StorableConstructorFlag _) : base(_) { }
57
58    public Fragment() { }
59  }
60}
Note: See TracBrowser for help on using the repository browser.