Changeset 14711 for branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers
- Timestamp:
- 03/03/17 11:41:43 (8 years ago)
- Location:
- branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers
- Files:
-
- 2 added
- 19 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 }
Note: See TracChangeset
for help on using the changeset viewer.