- Timestamp:
- 03/28/19 16:54:20 (5 years ago)
- Location:
- branches/2521_ProblemRefactoring
- Files:
-
- 5 deleted
- 75 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2521_ProblemRefactoring
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Persistence
- Property svn:mergeinfo changed
-
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Persistence.Core; 25 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;25 using HEAL.Attic; 26 26 using HeuristicLab.Persistence.Interfaces; 27 27 28 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 29 29 30 [Storable Class]30 [StorableType("EBEA3A72-AF1D-44BF-8A09-1645402E0715")] 31 31 internal sealed class ArraySerializer : ICompositeSerializer { 32 32 33 33 [StorableConstructor] 34 private ArraySerializer( bool deserializing) { }34 private ArraySerializer(StorableConstructorFlag _) { } 35 35 public ArraySerializer() { } 36 36 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using HeuristicLab.Persistence.Auxiliary; 27 27 using HeuristicLab.Persistence.Core; 28 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HEAL.Attic; 29 29 using HeuristicLab.Persistence.Interfaces; 30 30 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class]33 [StorableType("19E6CBD6-B977-4828-8121-5B5E9E856F2B")] 34 34 public sealed class CompactNumberArray2StringSerializer : ICompositeSerializer { 35 35 … … 82 82 83 83 [StorableConstructor] 84 private CompactNumberArray2StringSerializer( bool deserializing) { }84 private CompactNumberArray2StringSerializer(StorableConstructorFlag _) { } 85 85 public CompactNumberArray2StringSerializer() { } 86 86 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ConcreteDictionarySerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Linq; 26 26 using HeuristicLab.Persistence.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HEAL.Attic; 28 28 using HeuristicLab.Persistence.Interfaces; 29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class]32 [StorableType("5C0B5959-CFCA-4067-9D4D-540846D8F6EF")] 33 33 internal sealed class ConcreteDictionarySerializer : ICompositeSerializer { 34 34 35 35 [StorableConstructor] 36 private ConcreteDictionarySerializer( bool deserializing) { }36 private ConcreteDictionarySerializer(StorableConstructorFlag _) { } 37 37 public ConcreteDictionarySerializer() { } 38 38 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using HeuristicLab.Persistence.Auxiliary; 26 26 using HeuristicLab.Persistence.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HEAL.Attic; 28 28 using HeuristicLab.Persistence.Interfaces; 29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class]32 [StorableType("D66B7E71-1399-41F0-A97B-E2A2A0C87D71")] 33 33 internal sealed class DictionarySerializer : ICompositeSerializer { 34 34 35 35 [StorableConstructor] 36 private DictionarySerializer( bool deserializing) { }36 private DictionarySerializer(StorableConstructorFlag _) { } 37 37 public DictionarySerializer() { } 38 38 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using HeuristicLab.Persistence.Core; 25 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;25 using HEAL.Attic; 26 26 using HeuristicLab.Persistence.Interfaces; 27 27 28 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 29 29 30 [Storable Class]30 [StorableType("1DBD47D9-312B-4572-8B66-C3BFFD004FD6")] 31 31 internal sealed class EnumSerializer : ICompositeSerializer { 32 32 33 33 [StorableConstructor] 34 private EnumSerializer( bool deserializing) { }34 private EnumSerializer(StorableConstructorFlag _) { } 35 35 public EnumSerializer() { } 36 36 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using HeuristicLab.Persistence.Auxiliary; 27 27 using HeuristicLab.Persistence.Core; 28 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HEAL.Attic; 29 29 using HeuristicLab.Persistence.Interfaces; 30 30 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class]33 [StorableType("0EC0CBC9-A9C3-49BB-B3AC-6991DE771F27")] 34 34 internal sealed class EnumerableSerializer : ICompositeSerializer { 35 35 36 36 [StorableConstructor] 37 private EnumerableSerializer( bool deserializing) { }37 private EnumerableSerializer(StorableConstructorFlag _) { } 38 38 public EnumerableSerializer() { } 39 39 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/HashSetSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using System.Reflection; 27 27 using HeuristicLab.Persistence.Core; 28 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HEAL.Attic; 29 29 using HeuristicLab.Persistence.Interfaces; 30 30 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class]33 [StorableType("3A6430F5-B40C-46D1-89F2-B8AAAD46F052")] 34 34 internal sealed class HashSetSerializer : ICompositeSerializer { 35 35 36 36 [StorableConstructor] 37 private HashSetSerializer( bool deserializing) { }37 private HashSetSerializer(StorableConstructorFlag _) { } 38 38 public HashSetSerializer() { } 39 39 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Reflection; 26 26 using HeuristicLab.Persistence.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HEAL.Attic; 28 28 using HeuristicLab.Persistence.Interfaces; 29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class]32 [StorableType("7A42AEE3-A9C5-46B7-9968-F8EF3E146DF3")] 33 33 internal sealed class KeyValuePairSerializer : ICompositeSerializer { 34 34 35 35 [StorableConstructor] 36 private KeyValuePairSerializer( bool deserializing) { }36 private KeyValuePairSerializer(StorableConstructorFlag _) { } 37 37 public KeyValuePairSerializer() { } 38 38 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using HeuristicLab.Persistence.Auxiliary; 26 26 using HeuristicLab.Persistence.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HEAL.Attic; 28 28 using HeuristicLab.Persistence.Default.Xml; 29 29 using HeuristicLab.Persistence.Default.Xml.Primitive; … … 40 40 /// but can be useful in generating custom serializers. 41 41 /// </summary> 42 [Storable Class]42 [StorableType("CD4E3C0C-C766-42EA-B968-C6EBD0FAA637")] 43 43 public sealed class Number2StringSerializer : ICompositeSerializer { 44 44 45 45 [StorableConstructor] 46 private Number2StringSerializer( bool deserializing) { }46 private Number2StringSerializer(StorableConstructorFlag _) { } 47 47 public Number2StringSerializer() { } 48 48 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using HeuristicLab.Persistence.Auxiliary; 27 27 using HeuristicLab.Persistence.Core; 28 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;28 using HEAL.Attic; 29 29 using HeuristicLab.Persistence.Interfaces; 30 30 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class]33 [StorableType("44392644-F6AE-48F3-B0D8-08D3ED7DA307")] 34 34 internal sealed class NumberEnumerable2StringSerializer : ICompositeSerializer { 35 35 36 36 [StorableConstructor] 37 private NumberEnumerable2StringSerializer( bool deserializing) { }37 private NumberEnumerable2StringSerializer(StorableConstructorFlag _) { } 38 38 public NumberEnumerable2StringSerializer() { } 39 39 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Reflection; 26 26 using HeuristicLab.Persistence.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HEAL.Attic; 28 28 using HeuristicLab.Persistence.Interfaces; 29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class]32 [StorableType("EAAB8D01-445B-4834-B318-2AD56B7B537E")] 33 33 internal sealed class QueueSerializer : ICompositeSerializer { 34 34 35 35 [StorableConstructor] 36 private QueueSerializer( bool deserializing) { }36 private QueueSerializer(StorableConstructorFlag _) { } 37 37 public QueueSerializer() { } 38 38 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Reflection; 26 26 using HeuristicLab.Persistence.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HEAL.Attic; 28 28 using HeuristicLab.Persistence.Interfaces; 29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class]32 [StorableType("0EFD0631-C3A9-4233-B5B2-06103C908D78")] 33 33 internal sealed class StackSerializer : ICompositeSerializer { 34 34 35 35 [StorableConstructor] 36 private StackSerializer( bool deserializing) { }36 private StackSerializer(StorableConstructorFlag _) { } 37 37 public StackSerializer() { } 38 38 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableMemberInfo.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Reflection; 24 24 using System.Text; 25 using H euristicLab.Persistence.Core;25 using HEAL.Attic; 26 26 27 27 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableReflection.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using System.Linq; 25 25 using System.Reflection; 26 using H euristicLab.Persistence.Core;26 using HEAL.Attic; 27 27 28 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers.Storable { … … 43 43 storableMembers.AddRange(GenerateStorableMembers(type.BaseType)); 44 44 45 var storable ClassAttribute = GetStorableClassAttribute(type);46 if (storable ClassAttribute != null) {47 switch (storable ClassAttribute.Type) {48 case Storable ClassType.MarkedOnly:45 var storableTypeAttribute = GetStorableTypeAttribute(type); 46 if (storableTypeAttribute != null) { 47 switch (storableTypeAttribute.MemberSelection) { 48 case StorableMemberSelection.MarkedOnly: 49 49 AddMarkedMembers(type, storableMembers); break; 50 case Storable ClassType.AllFields:50 case StorableMemberSelection.AllFields: 51 51 AddAll(type, MemberTypes.Field, storableMembers); break; 52 case Storable ClassType.AllProperties:52 case StorableMemberSelection.AllProperties: 53 53 AddAll(type, MemberTypes.Property, storableMembers); break; 54 case Storable ClassType.AllFieldsAndAllProperties:54 case StorableMemberSelection.AllFieldsAndAllProperties: 55 55 AddAll(type, MemberTypes.Field | MemberTypes.Property, storableMembers); break; 56 56 default: 57 throw new PersistenceException("unsupported [Storable ClassType]: " + storableClassAttribute.Type);57 throw new PersistenceException("unsupported [StorableMemberSelection]: " + storableTypeAttribute.MemberSelection); 58 58 } 59 59 } … … 62 62 63 63 public static bool IsEmptyOrStorableType(Type type, bool recursive) { 64 if (!HasStorable ClassAttribute(type) && !IsEmptyType(type, false)) return false;64 if (!HasStorableTypeAttribute(type) && !IsEmptyType(type, false)) return false; 65 65 return !recursive || type.BaseType == null || IsEmptyOrStorableType(type.BaseType, true); 66 66 } … … 72 72 foreach (var hook in CollectHooks(hookType, type.BaseType)) 73 73 yield return hook; 74 if (HasStorable ClassAttribute(type)) {74 if (HasStorableTypeAttribute(type)) { 75 75 foreach (MethodInfo methodInfo in type.GetMethods(DECLARED_INSTANCE_MEMBERS)) { 76 76 if (methodInfo.ReturnType == typeof(void) && methodInfo.GetParameters().Length == 0) { … … 174 174 #region [StorableClass] helpers 175 175 176 private static Storable ClassAttribute GetStorableClassAttribute(Type type) {177 lock (storable ClassCache) {178 if (storable ClassCache.ContainsKey(type))179 return storable ClassCache[type];180 Storable ClassAttribute attribute = type181 .GetCustomAttributes(typeof(Storable ClassAttribute), false)182 .SingleOrDefault() as Storable ClassAttribute;183 storable ClassCache.Add(type, attribute);176 private static StorableTypeAttribute GetStorableTypeAttribute(Type type) { 177 lock (storableTypeCache) { 178 if (storableTypeCache.ContainsKey(type)) 179 return storableTypeCache[type]; 180 StorableTypeAttribute attribute = type 181 .GetCustomAttributes(typeof(StorableTypeAttribute), false) 182 .SingleOrDefault() as StorableTypeAttribute; 183 storableTypeCache.Add(type, attribute); 184 184 return attribute; 185 185 } 186 186 } 187 187 188 public static bool HasStorable ClassAttribute(Type type) {189 return GetStorable ClassAttribute(type) != null;190 } 191 192 private static Dictionary<Type, Storable ClassAttribute> storableClassCache =193 new Dictionary<Type, Storable ClassAttribute>();188 public static bool HasStorableTypeAttribute(Type type) { 189 return GetStorableTypeAttribute(type) != null; 190 } 191 192 private static Dictionary<Type, StorableTypeAttribute> storableTypeCache = 193 new Dictionary<Type, StorableTypeAttribute>(); 194 194 195 195 #endregion -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using System.Reflection.Emit; 27 27 using System.Text; 28 using HEAL.Attic; 28 29 using HeuristicLab.Persistence.Core; 29 30 using HeuristicLab.Persistence.Interfaces; … … 33 34 /// <summary> 34 35 /// Intended for serialization of all custom classes. Classes should have the 35 /// <c>[Storable Class]</c> attribute set. The default mode is to serialize36 /// <c>[StorableType]</c> attribute set. The default mode is to serialize 36 37 /// members with the <c>[Storable]</c> attribute set. Alternatively the 37 38 /// storable mode can be set to <c>AllFields</c>, <c>AllProperties</c> 38 39 /// or <c>AllFieldsAndAllProperties</c>. 39 40 /// </summary> 40 [Storable Class]41 [StorableType("F60343E8-4337-4171-A50A-6A57D09267ED")] 41 42 public sealed class StorableSerializer : ICompositeSerializer { 42 43 … … 49 50 50 51 [StorableConstructor] 51 private StorableSerializer( bool deserializing) : this() { }52 private StorableSerializer(StorableConstructorFlag _) { } 52 53 53 54 #region ICompositeSerializer implementation … … 69 70 /// </returns> 70 71 public bool CanSerialize(Type type) { 71 var markedStorable = StorableReflection.HasStorableClassAttribute(type); 72 if (type.IsEnum || type.IsValueType) return false; // there are other more specific serializers for enums and structs 73 var markedStorable = StorableReflection.HasStorableTypeAttribute(type); 72 74 if (GetConstructor(type) == null) 73 if (markedStorable )75 if (markedStorable && !type.IsInterface) 74 76 throw new Exception("[Storable] type has no default constructor and no [StorableConstructor]"); 75 77 else 76 78 return false; 77 79 if (!StorableReflection.IsEmptyOrStorableType(type, true)) 78 if (markedStorable )80 if (markedStorable && !type.IsInterface) 79 81 throw new Exception("[Storable] type has non emtpy, non [Storable] base classes"); 80 82 else … … 240 242 .Where(ci => ci.GetCustomAttributes(typeof(StorableConstructorAttribute), false).Length > 0)) { 241 243 if (ci.GetParameters().Length != 1 || 242 ci.GetParameters()[0].ParameterType != typeof( bool))243 throw new PersistenceException("StorableConstructor must have exactly one argument of type bool");244 ci.GetParameters()[0].ParameterType != typeof(StorableConstructorFlag)) 245 throw new PersistenceException("StorableConstructor must have exactly one argument of type StorableConstructorFlag"); 244 246 var dm = new DynamicMethod("", typeof(object), null, type, true); 245 247 var ilgen = dm.GetILGenerator(); 246 ilgen.Emit(OpCodes.Ldc_I4_1); // load true 248 var defaultFlagFieldInfo = typeof(StorableConstructorFlag).GetField("Default", BindingFlags.Static | BindingFlags.Public); 249 ilgen.Emit(OpCodes.Ldsfld, defaultFlagFieldInfo); // load the object 247 250 ilgen.Emit(OpCodes.Newobj, ci); 248 251 ilgen.Emit(OpCodes.Ret); -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StructSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using System.Reflection; 25 25 using HeuristicLab.Persistence.Core; 26 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;26 using HEAL.Attic; 27 27 using HeuristicLab.Persistence.Interfaces; 28 28 29 29 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 30 30 31 [Storable Class]31 [StorableType("85C63E3B-C604-4267-8008-6B89521BA312")] 32 32 internal sealed class StructSerializer : ICompositeSerializer { 33 33 34 34 [StorableConstructor] 35 private StructSerializer( bool deserializing) { }35 private StructSerializer(StorableConstructorFlag _) { } 36 36 public StructSerializer() { } 37 37 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TupleSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 25 25 using System.Reflection; 26 26 using HeuristicLab.Persistence.Core; 27 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;27 using HEAL.Attic; 28 28 using HeuristicLab.Persistence.Interfaces; 29 29 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class]32 [StorableType("463686AC-AA54-4D85-88DF-65F67AE0FA85")] 33 33 internal sealed class TupleSerializer : ICompositeSerializer { 34 34 35 35 [StorableConstructor] 36 private TupleSerializer( bool deserializing) { }36 private TupleSerializer(StorableConstructorFlag _) { } 37 37 public TupleSerializer() { } 38 38 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 24 24 using HeuristicLab.Persistence.Auxiliary; 25 25 using HeuristicLab.Persistence.Core; 26 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;26 using HEAL.Attic; 27 27 using HeuristicLab.Persistence.Interfaces; 28 28 29 29 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 30 30 31 [Storable Class]31 [StorableType("0CF9A082-629F-4554-8912-CC37228175E2")] 32 32 internal sealed class TypeSerializer : ICompositeSerializer { 33 33 34 34 [StorableConstructor] 35 private TypeSerializer( bool deserializing) { }35 private TypeSerializer(StorableConstructorFlag _) { } 36 36 public TypeSerializer() { } 37 37 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;22 using HEAL.Attic; 23 23 using HeuristicLab.Persistence.Interfaces; 24 24 … … 28 28 /// Simple write-only format for debugging purposes. 29 29 /// </summary> 30 [Storable Class]30 [StorableType("11A7D76E-AB88-43E1-97E8-D195959C34A2")] 31 31 public class DebugString : ISerialData { 32 32 … … 39 39 40 40 [StorableConstructor] 41 protected DebugString( bool deserializing) { }41 protected DebugString(StorableConstructorFlag _) { } 42 42 private DebugString() { } 43 43 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;22 using HEAL.Attic; 23 23 using HeuristicLab.Persistence.Interfaces; 24 24 … … 28 28 /// Simple write-only format for debugging purposes. 29 29 /// </summary> 30 [Storable Class]30 [StorableType("961AC268-6669-4B0E-A2B5-38C99BA63FD9")] 31 31 public class DebugStringFormat : FormatBase<DebugString> { 32 32 /// <summary> … … 37 37 38 38 [StorableConstructor] 39 protected DebugStringFormat( bool deserializing) : base(deserializing) { }39 protected DebugStringFormat(StorableConstructorFlag _) : base(_) { } 40 40 public DebugStringFormat() { } 41 41 } -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringGenerator.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Bool2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Byte2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Char2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/DateTime2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Double2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Float2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Int2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Long2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/SByte2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Short2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/String2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/Type2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UInt2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ULong2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/UShort2DebugStringSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/DebugString/PrimitiveSerializers/ValueType2DebugStringSerializerBase.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/ByteArray2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/CompactXmlSerializerBase.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleArray2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/DoubleList2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using System.Text; 25 using HEAL.Attic; 25 26 using HeuristicLab.Persistence.Auxiliary; 26 using HeuristicLab.Persistence.Core;27 27 using HeuristicLab.Persistence.Default.Xml.Primitive; 28 28 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntArray2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/IntList2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using System.Collections;24 23 using System.Collections.Generic; 25 24 using System.Linq; 26 25 using System.Text; 26 using HEAL.Attic; 27 27 using HeuristicLab.Persistence.Auxiliary; 28 using HeuristicLab.Persistence.Core;29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;30 28 31 29 namespace HeuristicLab.Persistence.Default.Xml.Compact { 32 30 33 [Storable Class]31 [StorableType("CE0A5AEB-FC09-4F66-9F92-C7B30BAB2713")] 34 32 internal abstract class NumberArray2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : class { 35 33 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberEnumeration2XmlSerializerBase.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections; 24 24 using System.Text; 25 using HEAL.Attic; 25 26 using HeuristicLab.Persistence.Auxiliary; 26 using HeuristicLab.Persistence.Core;27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;28 27 29 28 namespace HeuristicLab.Persistence.Default.Xml.Compact { 30 29 31 [Storable Class]30 [StorableType("B4D23353-9322-4005-BAF2-AB3034DEE34A")] 32 31 internal abstract class NumberEnumeration2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : IEnumerable { 33 32 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/EasyXmlGenerator.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Collections.Generic; 24 24 using System.IO; 25 using HEAL.Attic; 25 26 using HeuristicLab.Persistence.Auxiliary; 26 27 using HeuristicLab.Persistence.Core; … … 181 182 try { 182 183 using (StreamWriter writer = new StreamWriter(stream)) { 183 Serializer serializer = newSerializer(obj, config);184 Core.Serializer serializer = new Core.Serializer(obj, config); 184 185 serializer.InterleaveTypeInformation = true; 185 186 ReadableXmlGenerator generator = new ReadableXmlGenerator(); -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Bool2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Byte2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Char2XmlFormatter.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Text; 24 24 using System.Text.RegularExpressions; 25 using H euristicLab.Persistence.Core;25 using HEAL.Attic; 26 26 using HeuristicLab.Persistence.Interfaces; 27 27 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/DateTime2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using H euristicLab.Persistence.Core;23 using HEAL.Attic; 24 24 25 25 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Decimal2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Double2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Float2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Guid2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Globalization; 24 using H euristicLab.Persistence.Core;24 using HEAL.Attic; 25 25 26 26 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Int2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Long2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/PrimitiveXmlSerializerBase.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SByte2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/Short2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/SimpleNumber2XmlSerializerBase.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 22 22 using System; 23 23 using System.Reflection; 24 using H euristicLab.Persistence.Core;24 using HEAL.Attic; 25 25 26 26 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/String2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 23 23 using System.Text; 24 24 using System.Text.RegularExpressions; 25 using H euristicLab.Persistence.Core;25 using HEAL.Attic; 26 26 27 27 namespace HeuristicLab.Persistence.Default.Xml.Primitive { -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Bitmap2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/System.Drawing/Font2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/TimeSpan2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System; 23 using H euristicLab.Persistence.Core;23 using HEAL.Attic; 24 24 25 25 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UInt2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/ULong2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/Primitive/UShort2XmlSerializer.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;22 using HEAL.Attic; 23 23 using HeuristicLab.Persistence.Interfaces; 24 24 … … 29 29 /// or save to a file. 30 30 /// </summary> 31 [Storable Class]31 [StorableType("4E9895D9-BB30-43A6-AB35-4263FFDE3C0E")] 32 32 public class XmlFormat : FormatBase<XmlString> { 33 33 /// <summary> … … 38 38 39 39 [StorableConstructor] 40 protected XmlFormat( bool deserializing) : base(deserializing) { }40 protected XmlFormat(StorableConstructorFlag _) : base(_) { } 41 41 public XmlFormat() { } 42 42 } -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using System.Linq; 27 27 using System.Text; 28 using System.Threading; 29 using HEAL.Attic; 28 30 using HeuristicLab.Persistence.Core; 29 31 using HeuristicLab.Persistence.Core.Tokens; … … 61 63 } 62 64 63 protected enum NodeType { Start, End, Inline } 65 protected enum NodeType { Start, End, Inline }; 64 66 65 67 protected static void AddXmlTagContent(StringBuilder sb, string name, Dictionary<string, string> attributes) { … … 256 258 {"typeName", lastTypeToken.TypeName }, 257 259 {"serializer", lastTypeToken.Serializer }}); 258 } 259 finally { 260 } finally { 260 261 lastTypeToken = null; 261 262 } … … 284 285 /// <param name="o">The object.</param> 285 286 /// <param name="filename">The filename.</param> 286 public static void Serialize(object o, string filename ) {287 Serialize(o, filename, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, CompressionLevel.Optimal );287 public static void Serialize(object o, string filename, CancellationToken cancellationToken = default(CancellationToken)) { 288 Serialize(o, filename, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, CompressionLevel.Optimal, cancellationToken); 288 289 } 289 290 … … 296 297 /// <param name="filename">The filename.</param> 297 298 /// <param name="compression">ZIP file compression level</param> 298 public static void Serialize(object o, string filename, CompressionLevel compression ) {299 Serialize(o, filename, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, compression );299 public static void Serialize(object o, string filename, CompressionLevel compression, CancellationToken cancellationToken = default(CancellationToken)) { 300 Serialize(o, filename, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), false, compression, cancellationToken); 300 301 } 301 302 … … 307 308 /// <param name="filename">The filename.</param> 308 309 /// <param name="config">The configuration.</param> 309 public static void Serialize(object obj, string filename, Configuration config) { 310 Serialize(obj, filename, config, false, CompressionLevel.Optimal); 311 } 312 313 private static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies 314 , CompressionLevel compression) { 315 Serializer serializer = new Serializer(obj, config); 316 Serialize(stream, includeAssemblies, compression, serializer); 317 } 318 319 private static void Serialize(Stream stream, bool includeAssemblies, CompressionLevel compression, Serializer serializer) { 310 public static void Serialize(object obj, string filename, Configuration config, CancellationToken cancellationToken = default(CancellationToken)) { 311 Serialize(obj, filename, config, false, CompressionLevel.Optimal, cancellationToken); 312 } 313 314 private static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, CompressionLevel compression, CancellationToken cancellationToken = default(CancellationToken)) { 315 Core.Serializer serializer = new Core.Serializer(obj, config); 316 Serialize(stream, includeAssemblies, compression, serializer, cancellationToken); 317 } 318 319 private static void Serialize(Stream stream, bool includeAssemblies, CompressionLevel compression, Core.Serializer serializer, CancellationToken cancellationToken = default(CancellationToken)) { 320 320 try { 321 cancellationToken.ThrowIfCancellationRequested(); 321 322 DateTime start = DateTime.Now; 322 323 serializer.InterleaveTypeInformation = false; … … 326 327 using (StreamWriter writer = new StreamWriter(entry.Open())) { 327 328 foreach (ISerializationToken token in serializer) { 329 cancellationToken.ThrowIfCancellationRequested(); 328 330 string line = generator.Format(token); 329 331 writer.Write(line); … … 338 340 if (includeAssemblies) { 339 341 foreach (string name in serializer.RequiredFiles) { 342 cancellationToken.ThrowIfCancellationRequested(); 340 343 Uri uri = new Uri(name); 341 344 if (!uri.IsFile) { … … 348 351 byte[] buffer = new byte[1024 * 1024]; 349 352 while (true) { 353 cancellationToken.ThrowIfCancellationRequested(); 350 354 int bytesRead = reader.Read(buffer, 0, 1024 * 1024); 351 355 if (bytesRead == 0) … … 360 364 Logger.Info(String.Format("serialization took {0} seconds with compression level {1}", 361 365 (DateTime.Now - start).TotalSeconds, compression)); 362 } 363 catch (Exception) { 366 } catch (Exception) { 364 367 Logger.Warn("Exception caught, no data has been serialized."); 365 368 throw; … … 375 378 /// <param name="includeAssemblies">if set to <c>true</c> include needed assemblies.</param> 376 379 /// <param name="compression">The ZIP compression level.</param> 377 public static void Serialize(object obj, string filename, Configuration config, bool includeAssemblies, CompressionLevel compression) { 380 public static void Serialize(object obj, string filename, Configuration config, bool includeAssemblies, CompressionLevel compression, CancellationToken cancellationToken = default(CancellationToken)) { 381 string tempfile = null; 378 382 try { 379 stringtempfile = Path.GetTempFileName();383 tempfile = Path.GetTempFileName(); 380 384 381 385 using (FileStream stream = File.Create(tempfile)) { 382 Serialize(obj, stream, config, includeAssemblies, compression );383 } 384 386 Serialize(obj, stream, config, includeAssemblies, compression, cancellationToken); 387 } 388 // copy only if needed 385 389 File.Copy(tempfile, filename, true); 386 File.Delete(tempfile); 387 } 388 catch (Exception) { 390 } catch (Exception) { 389 391 Logger.Warn("Exception caught, no data has been written."); 390 392 throw; 393 } finally { 394 if (tempfile != null && File.Exists(tempfile)) 395 File.Delete(tempfile); 391 396 } 392 397 } … … 399 404 /// <param name="stream">The stream.</param> 400 405 /// <param name="compressionType">Type of compression, default is GZip.</param> 401 public static void Serialize(object obj, Stream stream, CompressionType compressionType = CompressionType.GZip ) {402 Serialize(obj, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), compressionType );406 public static void Serialize(object obj, Stream stream, CompressionType compressionType = CompressionType.GZip, CancellationToken cancellationToken = default(CancellationToken)) { 407 Serialize(obj, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), compressionType, cancellationToken); 403 408 } 404 409 … … 411 416 /// <param name="config">The configuration.</param> 412 417 /// <param name="compressionType">Type of compression, default is GZip.</param> 413 public static void Serialize(object obj, Stream stream, Configuration config, CompressionType compressionType = CompressionType.GZip ) {414 Serialize(obj, stream, config, false, compressionType );418 public static void Serialize(object obj, Stream stream, Configuration config, CompressionType compressionType = CompressionType.GZip, CancellationToken cancellationToken = default(CancellationToken)) { 419 Serialize(obj, stream, config, false, compressionType, cancellationToken); 415 420 } 416 421 … … 423 428 /// <param name="includeAssemblies">if set to <c>true</c> include need assemblies.</param> 424 429 /// <param name="compressionType">Type of compression, default is GZip.</param> 425 public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, 426 CompressionType compressionType = CompressionType.GZip) { 430 public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, CompressionType compressionType = CompressionType.GZip, CancellationToken cancellationToken = default(CancellationToken)) { 427 431 try { 428 Serializer serializer = newSerializer(obj, config);432 Core.Serializer serializer = new Core.Serializer(obj, config); 429 433 if (compressionType == CompressionType.Zip) { 430 Serialize(obj, stream, config, includeAssemblies, CompressionLevel.Optimal );434 Serialize(obj, stream, config, includeAssemblies, CompressionLevel.Optimal, cancellationToken); 431 435 } else { 432 Serialize(stream, serializer); 433 } 434 } 435 catch (PersistenceException) { 436 Serialize(stream, serializer, cancellationToken); 437 } 438 } catch (PersistenceException) { 436 439 throw; 437 } 438 catch (Exception e) { 440 } catch (Exception e) { 439 441 throw new PersistenceException("Unexpected exception during Serialization.", e); 440 442 } … … 451 453 /// <param name="compressionType">Type of compression, default is GZip.</param> 452 454 public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, out IEnumerable<Type> types, 453 CompressionType compressionType = CompressionType.GZip ) {455 CompressionType compressionType = CompressionType.GZip, CancellationToken cancellationToken = default(CancellationToken)) { 454 456 try { 455 Serializer serializer = newSerializer(obj, config);457 Core.Serializer serializer = new Core.Serializer(obj, config); 456 458 if (compressionType == CompressionType.Zip) { 457 Serialize(stream, includeAssemblies, CompressionLevel.Optimal, serializer );459 Serialize(stream, includeAssemblies, CompressionLevel.Optimal, serializer, cancellationToken); 458 460 } else { 459 Serialize(stream, serializer );461 Serialize(stream, serializer, cancellationToken); 460 462 } 461 463 types = serializer.SerializedTypes; 462 } 463 catch (PersistenceException) { 464 } catch (PersistenceException) { 464 465 throw; 465 } 466 catch (Exception e) { 466 } catch (Exception e) { 467 467 throw new PersistenceException("Unexpected exception during Serialization.", e); 468 468 } 469 469 } 470 470 471 private static void Serialize(Stream stream, Serializer serializer) { 471 private static void Serialize(Stream stream, Core.Serializer serializer, CancellationToken cancellationToken = default(CancellationToken)) { 472 cancellationToken.ThrowIfCancellationRequested(); 472 473 using (StreamWriter writer = new StreamWriter(new GZipStream(stream, CompressionMode.Compress))) { 473 474 serializer.InterleaveTypeInformation = true; 474 475 XmlGenerator generator = new XmlGenerator(); 475 476 foreach (ISerializationToken token in serializer) { 477 cancellationToken.ThrowIfCancellationRequested(); 476 478 string line = generator.Format(token); 477 479 writer.Write(line); -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 26 26 using System.IO.Compression; 27 27 using System.Xml; 28 using HEAL.Attic; 28 29 using HeuristicLab.Persistence.Core; 29 30 using HeuristicLab.Persistence.Core.Tokens; -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/XmlSerializerBase.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 21 21 22 22 using System.Text; 23 using H euristicLab.Persistence.Default.CompositeSerializers.Storable;23 using HEAL.Attic; 24 24 using HeuristicLab.Persistence.Interfaces; 25 25 … … 29 29 /// XML friendly encapsulation of string data. 30 30 /// </summary> 31 [Storable Class]31 [StorableType("C7207D30-79F0-47C7-B151-6E96A594F75C")] 32 32 public class XmlString : ISerialData { 33 33 … … 41 41 42 42 [StorableConstructor] 43 protected XmlString( bool deserializing) { }43 protected XmlString(StorableConstructorFlag _) { } 44 44 private XmlString() { } 45 45 -
branches/2521_ProblemRefactoring/HeuristicLab.Persistence/3.3/Default/Xml/XmlStringConstants.cs
r16692 r16723 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 8Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2019 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab.
Note: See TracChangeset
for help on using the changeset viewer.