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 | |
---|
1 | using HeuristicLab.Common;
|
---|
2 | using HeuristicLab.Core;
|
---|
3 | using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
|
---|
4 |
|
---|
5 | namespace 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.