using HeuristicLab.Common; using HeuristicLab.Core; using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; namespace HeuristicLab.EvolutionaryTracking { [Item("Generic wrapper", "Wrapper class for non-item HeuristicLab objects")] [StorableClass] public class GenericWrapper : Item where T : class, IDeepCloneable { [Storable] public T Content { get; private set; } public GenericWrapper(T content) { Content = content; } [StorableConstructor] private GenericWrapper(bool serializing) : base(serializing) { } private GenericWrapper(GenericWrapper original, Cloner cloner) : base(original, cloner) { this.Content = cloner.Clone(Content); } public override IDeepCloneable Clone(Cloner cloner) { return new GenericWrapper(this, cloner); } } }