Free cookie consent management tool by TermsFeed Policy Generator

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

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

#1772: New analyzer: SymbolicExpressionTreeRelativeLengthAnalyzer. Rewrote the SymbolicExpressionTreeFragmentsAnalyzer, added generic wrapper to wrap HL objects as items.

File size: 835 bytes
Line 
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")]
7  public class GenericWrapper<T> : NamedItem where T : class {
8    public T Content { get; private set; }
9
10    private GenericWrapper() {
11    }
12
13    public GenericWrapper(T content) {
14      Content = content;
15    }
16
17    [StorableConstructor]
18    protected GenericWrapper(bool serializing)
19      : base(serializing) {
20    }
21
22    private GenericWrapper(GenericWrapper<T> original, Cloner cloner)
23      : base(original, cloner) {
24    }
25
26    public override IDeepCloneable Clone(Cloner cloner) {
27      return new GenericWrapper<T>(this, cloner);
28    }
29  }
30}
Note: See TracBrowser for help on using the repository browser.