Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.EvolutionaryTracking/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/GenericWrapper.cs @ 9246

Last change on this file since 9246 was 9083, checked in by bburlacu, 12 years ago

#1772: Merged HeuristicLab.Encodings.SymbolicExpressionTreeEncoding from trunk. Added Fragment class implementing IFragment interface.

File size: 871 bytes
RevLine 
[7997]1using HeuristicLab.Common;
2using HeuristicLab.Core;
3using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
4
5namespace HeuristicLab.EvolutionaryTracking {
6  [Item("Generic wrapper", "Wrapper class for non-item HeuristicLab objects")]
[8213]7  [StorableClass]
[9083]8  public class GenericWrapper<T> : Item where T : class, IDeepCloneable {
[8557]9    [Storable]
[7997]10    public T Content { get; private set; }
11
12    public GenericWrapper(T content) {
13      Content = content;
14    }
15
16    [StorableConstructor]
[8557]17    private GenericWrapper(bool serializing) : base(serializing) { }
[7997]18
19    private GenericWrapper(GenericWrapper<T> original, Cloner cloner)
20      : base(original, cloner) {
[8557]21      this.Content = cloner.Clone(Content);
[7997]22    }
23
24    public override IDeepCloneable Clone(Cloner cloner) {
25      return new GenericWrapper<T>(this, cloner);
26    }
27  }
28}
Note: See TracBrowser for help on using the repository browser.