- Timestamp:
- 03/03/17 11:41:43 (8 years ago)
- Location:
- branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default
- Files:
-
- 2 added
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs
r13368 r14711 28 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 29 29 30 [Storable Class("DED1FAD5-BD24-49FA-8F8A-E6DA78FA91EF")]30 [StorableType("DED1FAD5-BD24-49FA-8F8A-E6DA78FA91EF")] 31 31 internal sealed class ArraySerializer : ICompositeSerializer { 32 32 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs
r13368 r14711 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class("F3E94492-318E-41BA-8707-F20001911B92")]33 [StorableType("F3E94492-318E-41BA-8707-F20001911B92")] 34 34 public sealed class CompactNumberArray2StringSerializer : ICompositeSerializer { 35 35 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ConcreteDictionarySerializer.cs
r13368 r14711 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class("D56A21E9-720A-4ABC-88B0-0BD64A852F42")]32 [StorableType("D56A21E9-720A-4ABC-88B0-0BD64A852F42")] 33 33 internal sealed class ConcreteDictionarySerializer : ICompositeSerializer { 34 34 … … 47 47 48 48 public string JustifyRejection(Type type) { 49 return " Typeis not a generic Dictionary<>";49 return "MemberSelection is not a generic Dictionary<>"; 50 50 } 51 51 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs
r13368 r14711 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class("8D8AA145-C845-454E-BE7D-472A949FF5E9")]32 [StorableType("8D8AA145-C845-454E-BE7D-472A949FF5E9")] 33 33 internal sealed class DictionarySerializer : ICompositeSerializer { 34 34 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs
r13368 r14711 28 28 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 29 29 30 [Storable Class("9208E160-B797-4A5A-9474-539FE9D10FED")]30 [StorableType("9208E160-B797-4A5A-9474-539FE9D10FED")] 31 31 internal sealed class EnumSerializer : ICompositeSerializer { 32 32 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs
r13368 r14711 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class("925173F9-9DBB-4110-9ADE-F2144DE674CD")]33 [StorableType("925173F9-9DBB-4110-9ADE-F2144DE674CD")] 34 34 internal sealed class EnumerableSerializer : ICompositeSerializer { 35 35 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/HashSetSerializer.cs
r13368 r14711 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class("BBE5697E-7FEC-49DE-923A-FCE72C43B0D9")]33 [StorableType("BBE5697E-7FEC-49DE-923A-FCE72C43B0D9")] 34 34 internal sealed class HashSetSerializer : ICompositeSerializer { 35 35 … … 47 47 48 48 public string JustifyRejection(Type type) { 49 return " Typeis not a generic HashSet<>";49 return "MemberSelection is not a generic HashSet<>"; 50 50 } 51 51 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs
r13368 r14711 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class("4DBE73C7-DD3B-4222-A18F-8873B6F45A7B")]32 [StorableType("4DBE73C7-DD3B-4222-A18F-8873B6F45A7B")] 33 33 internal sealed class KeyValuePairSerializer : ICompositeSerializer { 34 34 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs
r13368 r14711 40 40 /// but can be useful in generating custom serializers. 41 41 /// </summary> 42 [Storable Class("F6AD0D2A-275D-4CA1-9557-87CD43260DB0")]42 [StorableType("F6AD0D2A-275D-4CA1-9557-87CD43260DB0")] 43 43 public sealed class Number2StringSerializer : ICompositeSerializer { 44 44 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs
r13368 r14711 31 31 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 32 32 33 [Storable Class("7ECEC2AF-524F-4703-8BF9-C8660DE048C6")]33 [StorableType("7ECEC2AF-524F-4703-8BF9-C8660DE048C6")] 34 34 internal sealed class NumberEnumerable2StringSerializer : ICompositeSerializer { 35 35 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs
r13368 r14711 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class("B02DED3E-53E8-45FD-8331-9BF13A4364D6")]32 [StorableType("B02DED3E-53E8-45FD-8331-9BF13A4364D6")] 33 33 internal sealed class QueueSerializer : ICompositeSerializer { 34 34 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs
r13368 r14711 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class("20A8AE66-617A-457D-9219-B2C095575053")]32 [StorableType("20A8AE66-617A-457D-9219-B2C095575053")] 33 33 internal sealed class StackSerializer : ICompositeSerializer { 34 34 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs
r13368 r14711 30 30 /// Mark the member of a class to be considered by the <c>StorableSerializer</c>. 31 31 /// The class must be marked as <c>[StorableClass("05FE6F11-87C6-435E-800A-166AFACCF5AC")]</c> and the 32 /// <c>Storable ClassType</c> should be set to <c>MarkedOnly</c> for32 /// <c>StorableMemberSelection</c> should be set to <c>MarkedOnly</c> for 33 33 /// this attribute to kick in. 34 34 /// </summary> -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs
r13347 r14711 72 72 /// at the <c>HookType</c> time. 73 73 /// </summary> 74 /// <param name="hookType"> Typeof the hook.</param>74 /// <param name="hookType">MemberSelection of the hook.</param> 75 75 public StorableHookAttribute(HookType hookType) { 76 76 this.hookType = hookType; -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableReflection.cs
r13368 r14711 45 45 var storableClassAttribute = GetStorableClassAttribute(type); 46 46 if (storableClassAttribute != null) { 47 switch (storableClassAttribute. Type) {48 case Storable ClassType.MarkedOnly:47 switch (storableClassAttribute.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]: " + storableClassAttribute.MemberSelection); 58 58 } 59 59 } … … 174 174 #region [StorableClass("BBAFAC35-1753-4FF2-8CD5-9D307C782287")] helpers 175 175 176 private static Storable ClassAttribute GetStorableClassAttribute(Type type) {176 private static StorableTypeAttribute GetStorableClassAttribute(Type type) { 177 177 lock (storableClassCache) { 178 178 if (storableClassCache.ContainsKey(type)) 179 179 return storableClassCache[type]; 180 Storable ClassAttribute attribute = type181 .GetCustomAttributes(typeof(Storable ClassAttribute), false)182 .SingleOrDefault() as Storable ClassAttribute;180 StorableTypeAttribute attribute = type 181 .GetCustomAttributes(typeof(StorableTypeAttribute), false) 182 .SingleOrDefault() as StorableTypeAttribute; 183 183 storableClassCache.Add(type, attribute); 184 184 return attribute; … … 190 190 } 191 191 192 private static Dictionary<Type, Storable ClassAttribute> storableClassCache =193 new Dictionary<Type, Storable ClassAttribute>();192 private static Dictionary<Type, StorableTypeAttribute> storableClassCache = 193 new Dictionary<Type, StorableTypeAttribute>(); 194 194 195 195 #endregion -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r13368 r14711 38 38 /// or <c>AllFieldsAndAllProperties</c>. 39 39 /// </summary> 40 [Storable Class("FB71B522-2818-48CD-AF43-EB1E0C2D6504")]40 [StorableType("FB71B522-2818-48CD-AF43-EB1E0C2D6504")] 41 41 public sealed class StorableSerializer : ICompositeSerializer { 42 42 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StructSerializer.cs
r13368 r14711 29 29 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 30 30 31 [Storable Class("47A795AF-7F1C-4EA7-84A8-DAE07C00EFB6")]31 [StorableType("47A795AF-7F1C-4EA7-84A8-DAE07C00EFB6")] 32 32 internal sealed class StructSerializer : ICompositeSerializer { 33 33 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TupleSerializer.cs
r13368 r14711 30 30 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 31 31 32 [Storable Class("A1768781-CFE2-4C87-BF7C-6B344483F30B")]32 [StorableType("A1768781-CFE2-4C87-BF7C-6B344483F30B")] 33 33 internal sealed class TupleSerializer : ICompositeSerializer { 34 34 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs
r13368 r14711 29 29 namespace HeuristicLab.Persistence.Default.CompositeSerializers { 30 30 31 [Storable Class("EC815939-4BC3-44D1-8464-7FCEA6D802C5")]31 [StorableType("EC815939-4BC3-44D1-8464-7FCEA6D802C5")] 32 32 internal sealed class TypeSerializer : ICompositeSerializer { 33 33 … … 50 50 public string JustifyRejection(Type type) { 51 51 #region Mono Compatibility 52 return "not System. Type, System.RuntimeType, System.MonoType";52 return "not System.MemberSelection, System.RuntimeType, System.MonoType"; 53 53 #endregion 54 54 } … … 68 68 } 69 69 catch (InvalidOperationException e) { 70 throw new PersistenceException("Insufficient meta information to instantiate Typeobject", e);70 throw new PersistenceException("Insufficient meta information to instantiate MemberSelection object", e); 71 71 } 72 72 try { … … 74 74 } 75 75 catch (InvalidCastException e) { 76 throw new PersistenceException("Invalid meta information during reconstruction of Typeobject", e);76 throw new PersistenceException("Invalid meta information during reconstruction of MemberSelection object", e); 77 77 } 78 78 catch (TypeLoadException e) { 79 79 throw new PersistenceException(String.Format( 80 "Cannot load Type{0}, make sure all required assemblies are available.",80 "Cannot load MemberSelection {0}, make sure all required assemblies are available.", 81 81 (string)it.Current.Value), e); 82 82 } … … 84 84 85 85 public void Populate(object instance, IEnumerable<Tag> objects, Type type) { 86 // Typeojects are populated during instance creation.86 // MemberSelection ojects are populated during instance creation. 87 87 } 88 88 } -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs
r13368 r14711 28 28 /// Simple write-only format for debugging purposes. 29 29 /// </summary> 30 [Storable Class("0299A38D-F1E7-4362-BDBF-B40ED98BA04F")]30 [StorableType("0299A38D-F1E7-4362-BDBF-B40ED98BA04F")] 31 31 public class DebugString : ISerialData { 32 32 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs
r13368 r14711 28 28 /// Simple write-only format for debugging purposes. 29 29 /// </summary> 30 [Storable Class("197FACEB-E9E1-4D1F-AB74-4E017F083574")]30 [StorableType("197FACEB-E9E1-4D1F-AB74-4E017F083574")] 31 31 public class DebugStringFormat : FormatBase<DebugString> { 32 32 /// <summary> -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs
r13368 r14711 31 31 namespace HeuristicLab.Persistence.Default.Xml.Compact { 32 32 33 [Storable Class("19C52154-260B-4003-99E0-1C47BD93618B")]33 [StorableType("19C52154-260B-4003-99E0-1C47BD93618B")] 34 34 internal abstract class NumberArray2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : class { 35 35 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberEnumeration2XmlSerializerBase.cs
r13368 r14711 29 29 namespace HeuristicLab.Persistence.Default.Xml.Compact { 30 30 31 [Storable Class("994DD94B-001A-4834-8099-EC84B81B88D1")]31 [StorableType("994DD94B-001A-4834-8099-EC84B81B88D1")] 32 32 internal abstract class NumberEnumeration2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : IEnumerable { 33 33 -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs
r13368 r14711 29 29 /// or save to a file. 30 30 /// </summary> 31 [Storable Class("954DB753-AE15-44EA-ACCA-61A4AF3D4B33")]31 [StorableType("954DB753-AE15-44EA-ACCA-61A4AF3D4B33")] 32 32 public class XmlFormat : FormatBase<XmlString> { 33 33 /// <summary> -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs
r12638 r14711 398 398 /// <param name="obj">The object.</param> 399 399 /// <param name="stream">The stream.</param> 400 /// <param name="compressionType"> Typeof compression, default is GZip.</param>400 /// <param name="compressionType">MemberSelection of compression, default is GZip.</param> 401 401 public static void Serialize(object obj, Stream stream, CompressionType compressionType = CompressionType.GZip) { 402 402 Serialize(obj, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), compressionType); … … 410 410 /// <param name="stream">The stream.</param> 411 411 /// <param name="config">The configuration.</param> 412 /// <param name="compressionType"> Typeof compression, default is GZip.</param>412 /// <param name="compressionType">MemberSelection of compression, default is GZip.</param> 413 413 public static void Serialize(object obj, Stream stream, Configuration config, CompressionType compressionType = CompressionType.GZip) { 414 414 Serialize(obj, stream, config, false, compressionType); … … 422 422 /// <param name="config">The configuration.</param> 423 423 /// <param name="includeAssemblies">if set to <c>true</c> include need assemblies.</param> 424 /// <param name="compressionType"> Typeof compression, default is GZip.</param>424 /// <param name="compressionType">MemberSelection of compression, default is GZip.</param> 425 425 public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, 426 426 CompressionType compressionType = CompressionType.GZip) { … … 449 449 /// <param name="includeAssemblies">if set to <c>true</c> include need assemblies.</param> 450 450 /// <param name="types">The list of all serialized types.</param> 451 /// <param name="compressionType"> Typeof compression, default is GZip.</param>451 /// <param name="compressionType">MemberSelection of compression, default is GZip.</param> 452 452 public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, out IEnumerable<Type> types, 453 453 CompressionType compressionType = CompressionType.GZip) { -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs
r12638 r14711 32 32 namespace HeuristicLab.Persistence.Default.Xml { 33 33 /// <summary> 34 /// Typeof compression used for the Xml stream or file.34 /// MemberSelection of compression used for the Xml stream or file. 35 35 /// </summary> 36 36 public enum CompressionType { … … 228 228 /// <typeparam name="T">object type expected from the serialized stream</typeparam> 229 229 /// <param name="stream">The stream.</param> 230 /// <param name="compressionType"> Typeof compression, default is GZip.</param>230 /// <param name="compressionType">MemberSelection of compression, default is GZip.</param> 231 231 /// <returns>A fresh object instance.</returns> 232 232 public static T Deserialize<T>(Stream stream, CompressionType compressionType = CompressionType.GZip) { … … 238 238 /// </summary> 239 239 /// <param name="stream">The stream.</param> 240 /// <param name="compressionType"> Typeof compression, default is GZip.</param>240 /// <param name="compressionType">MemberSelection of compression, default is GZip.</param> 241 241 /// <returns>A fresh object instance.</returns> 242 242 public static object Deserialize(Stream stream, CompressionType compressionType = CompressionType.GZip) { -
branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs
r13368 r14711 29 29 /// XML friendly encapsulation of string data. 30 30 /// </summary> 31 [Storable Class("CAB3BE44-DAFD-4642-ADC8-E8A4A2B18A97")]31 [StorableType("CAB3BE44-DAFD-4642-ADC8-E8A4A2B18A97")] 32 32 public class XmlString : ISerialData { 33 33
Note: See TracChangeset
for help on using the changeset viewer.