Last change
on this file since 13067 was
9835,
checked in by bburlacu, 11 years ago
|
#1772: Merged remaining trunk changes into the EvolutionaryTracking branch.
|
File size:
871 bytes
|
Rev | Line | |
---|
[9835] | 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 | [StorableClass]
|
---|
| 8 | public class GenericWrapper<T> : Item where T : class, IDeepCloneable {
|
---|
| 9 | [Storable]
|
---|
| 10 | public T Content { get; private set; }
|
---|
| 11 |
|
---|
| 12 | public GenericWrapper(T content) {
|
---|
| 13 | Content = content;
|
---|
| 14 | }
|
---|
| 15 |
|
---|
| 16 | [StorableConstructor]
|
---|
| 17 | private GenericWrapper(bool serializing) : base(serializing) { }
|
---|
| 18 |
|
---|
| 19 | private GenericWrapper(GenericWrapper<T> original, Cloner cloner)
|
---|
| 20 | : base(original, cloner) {
|
---|
| 21 | this.Content = cloner.Clone(Content);
|
---|
| 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.