Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/17 11:41:43 (8 years ago)
Author:
gkronber
Message:

#2520

  • renamed StorableClass -> StorableType
  • changed persistence to use GUIDs instead of type names
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  
    2828namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    2929
    30   [StorableClass("DED1FAD5-BD24-49FA-8F8A-E6DA78FA91EF")]
     30  [StorableType("DED1FAD5-BD24-49FA-8F8A-E6DA78FA91EF")]
    3131  internal sealed class ArraySerializer : ICompositeSerializer {
    3232
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs

    r13368 r14711  
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass("F3E94492-318E-41BA-8707-F20001911B92")]
     33  [StorableType("F3E94492-318E-41BA-8707-F20001911B92")]
    3434  public sealed class CompactNumberArray2StringSerializer : ICompositeSerializer {
    3535
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ConcreteDictionarySerializer.cs

    r13368 r14711  
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass("D56A21E9-720A-4ABC-88B0-0BD64A852F42")]
     32  [StorableType("D56A21E9-720A-4ABC-88B0-0BD64A852F42")]
    3333  internal sealed class ConcreteDictionarySerializer : ICompositeSerializer {
    3434
     
    4747
    4848    public string JustifyRejection(Type type) {
    49       return "Type is not a generic Dictionary<>";
     49      return "MemberSelection is not a generic Dictionary<>";
    5050    }
    5151
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs

    r13368 r14711  
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass("8D8AA145-C845-454E-BE7D-472A949FF5E9")]
     32  [StorableType("8D8AA145-C845-454E-BE7D-472A949FF5E9")]
    3333  internal sealed class DictionarySerializer : ICompositeSerializer {
    3434
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs

    r13368 r14711  
    2828namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    2929
    30   [StorableClass("9208E160-B797-4A5A-9474-539FE9D10FED")]
     30  [StorableType("9208E160-B797-4A5A-9474-539FE9D10FED")]
    3131  internal sealed class EnumSerializer : ICompositeSerializer {
    3232
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs

    r13368 r14711  
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass("925173F9-9DBB-4110-9ADE-F2144DE674CD")]
     33  [StorableType("925173F9-9DBB-4110-9ADE-F2144DE674CD")]
    3434  internal sealed class EnumerableSerializer : ICompositeSerializer {
    3535
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/HashSetSerializer.cs

    r13368 r14711  
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass("BBE5697E-7FEC-49DE-923A-FCE72C43B0D9")]
     33  [StorableType("BBE5697E-7FEC-49DE-923A-FCE72C43B0D9")]
    3434  internal sealed class HashSetSerializer : ICompositeSerializer {
    3535
     
    4747
    4848    public string JustifyRejection(Type type) {
    49       return "Type is not a generic HashSet<>";
     49      return "MemberSelection is not a generic HashSet<>";
    5050    }
    5151
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs

    r13368 r14711  
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass("4DBE73C7-DD3B-4222-A18F-8873B6F45A7B")]
     32  [StorableType("4DBE73C7-DD3B-4222-A18F-8873B6F45A7B")]
    3333  internal sealed class KeyValuePairSerializer : ICompositeSerializer {
    3434
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs

    r13368 r14711  
    4040  /// but can be useful in generating custom serializers.
    4141  /// </summary>
    42   [StorableClass("F6AD0D2A-275D-4CA1-9557-87CD43260DB0")]
     42  [StorableType("F6AD0D2A-275D-4CA1-9557-87CD43260DB0")]
    4343  public sealed class Number2StringSerializer : ICompositeSerializer {
    4444
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs

    r13368 r14711  
    3131namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3232
    33   [StorableClass("7ECEC2AF-524F-4703-8BF9-C8660DE048C6")]
     33  [StorableType("7ECEC2AF-524F-4703-8BF9-C8660DE048C6")]
    3434  internal sealed class NumberEnumerable2StringSerializer : ICompositeSerializer {
    3535
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs

    r13368 r14711  
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass("B02DED3E-53E8-45FD-8331-9BF13A4364D6")]
     32  [StorableType("B02DED3E-53E8-45FD-8331-9BF13A4364D6")]
    3333  internal sealed class QueueSerializer : ICompositeSerializer {
    3434
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs

    r13368 r14711  
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass("20A8AE66-617A-457D-9219-B2C095575053")]
     32  [StorableType("20A8AE66-617A-457D-9219-B2C095575053")]
    3333  internal sealed class StackSerializer : ICompositeSerializer {
    3434
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableAttribute.cs

    r13368 r14711  
    3030  /// Mark the member of a class to be considered by the <c>StorableSerializer</c>.
    3131  /// The class must be marked as <c>[StorableClass("05FE6F11-87C6-435E-800A-166AFACCF5AC")]</c> and the
    32   /// <c>StorableClassType</c> should be set to <c>MarkedOnly</c> for
     32  /// <c>StorableMemberSelection</c> should be set to <c>MarkedOnly</c> for
    3333  /// this attribute to kick in.
    3434  /// </summary>
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableHookAttribute.cs

    r13347 r14711  
    7272    /// at the <c>HookType</c> time.
    7373    /// </summary>
    74     /// <param name="hookType">Type of the hook.</param>
     74    /// <param name="hookType">MemberSelection of the hook.</param>
    7575    public StorableHookAttribute(HookType hookType) {
    7676      this.hookType = hookType;
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableReflection.cs

    r13368 r14711  
    4545      var storableClassAttribute = GetStorableClassAttribute(type);
    4646      if (storableClassAttribute != null) {
    47         switch (storableClassAttribute.Type) {
    48           case StorableClassType.MarkedOnly:
     47        switch (storableClassAttribute.MemberSelection) {
     48          case StorableMemberSelection.MarkedOnly:
    4949            AddMarkedMembers(type, storableMembers); break;
    50           case StorableClassType.AllFields:
     50          case StorableMemberSelection.AllFields:
    5151            AddAll(type, MemberTypes.Field, storableMembers); break;
    52           case StorableClassType.AllProperties:
     52          case StorableMemberSelection.AllProperties:
    5353            AddAll(type, MemberTypes.Property, storableMembers); break;
    54           case StorableClassType.AllFieldsAndAllProperties:
     54          case StorableMemberSelection.AllFieldsAndAllProperties:
    5555            AddAll(type, MemberTypes.Field | MemberTypes.Property, storableMembers); break;
    5656          default:
    57             throw new PersistenceException("unsupported [StorableClassType]: " + storableClassAttribute.Type);
     57            throw new PersistenceException("unsupported [StorableMemberSelection]: " + storableClassAttribute.MemberSelection);
    5858        }
    5959      }
     
    174174    #region [StorableClass("BBAFAC35-1753-4FF2-8CD5-9D307C782287")] helpers
    175175
    176     private static StorableClassAttribute GetStorableClassAttribute(Type type) {
     176    private static StorableTypeAttribute GetStorableClassAttribute(Type type) {
    177177      lock (storableClassCache) {
    178178        if (storableClassCache.ContainsKey(type))
    179179          return storableClassCache[type];
    180         StorableClassAttribute attribute = type
    181           .GetCustomAttributes(typeof(StorableClassAttribute), false)
    182           .SingleOrDefault() as StorableClassAttribute;
     180        StorableTypeAttribute attribute = type
     181          .GetCustomAttributes(typeof(StorableTypeAttribute), false)
     182          .SingleOrDefault() as StorableTypeAttribute;
    183183        storableClassCache.Add(type, attribute);
    184184        return attribute;
     
    190190    }
    191191
    192     private static Dictionary<Type, StorableClassAttribute> storableClassCache =
    193       new Dictionary<Type, StorableClassAttribute>();
     192    private static Dictionary<Type, StorableTypeAttribute> storableClassCache =
     193      new Dictionary<Type, StorableTypeAttribute>();
    194194
    195195    #endregion
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs

    r13368 r14711  
    3838  /// or <c>AllFieldsAndAllProperties</c>.
    3939  /// </summary>
    40   [StorableClass("FB71B522-2818-48CD-AF43-EB1E0C2D6504")]
     40  [StorableType("FB71B522-2818-48CD-AF43-EB1E0C2D6504")]
    4141  public sealed class StorableSerializer : ICompositeSerializer {
    4242
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StructSerializer.cs

    r13368 r14711  
    2929namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3030
    31   [StorableClass("47A795AF-7F1C-4EA7-84A8-DAE07C00EFB6")]
     31  [StorableType("47A795AF-7F1C-4EA7-84A8-DAE07C00EFB6")]
    3232  internal sealed class StructSerializer : ICompositeSerializer {
    3333
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TupleSerializer.cs

    r13368 r14711  
    3030namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3131
    32   [StorableClass("A1768781-CFE2-4C87-BF7C-6B344483F30B")]
     32  [StorableType("A1768781-CFE2-4C87-BF7C-6B344483F30B")]
    3333  internal sealed class TupleSerializer : ICompositeSerializer {
    3434
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs

    r13368 r14711  
    2929namespace HeuristicLab.Persistence.Default.CompositeSerializers {
    3030
    31   [StorableClass("EC815939-4BC3-44D1-8464-7FCEA6D802C5")]
     31  [StorableType("EC815939-4BC3-44D1-8464-7FCEA6D802C5")]
    3232  internal sealed class TypeSerializer : ICompositeSerializer {
    3333
     
    5050    public string JustifyRejection(Type type) {
    5151      #region Mono Compatibility
    52       return "not System.Type, System.RuntimeType, System.MonoType";
     52      return "not System.MemberSelection, System.RuntimeType, System.MonoType";
    5353      #endregion
    5454    }
     
    6868      }
    6969      catch (InvalidOperationException e) {
    70         throw new PersistenceException("Insufficient meta information to instantiate Type object", e);
     70        throw new PersistenceException("Insufficient meta information to instantiate MemberSelection object", e);
    7171      }
    7272      try {
     
    7474      }
    7575      catch (InvalidCastException e) {
    76         throw new PersistenceException("Invalid meta information during reconstruction of Type object", e);
     76        throw new PersistenceException("Invalid meta information during reconstruction of MemberSelection object", e);
    7777      }
    7878      catch (TypeLoadException e) {
    7979        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.",
    8181          (string)it.Current.Value), e);
    8282      }
     
    8484
    8585    public void Populate(object instance, IEnumerable<Tag> objects, Type type) {
    86       // Type ojects are populated during instance creation.
     86      // MemberSelection ojects are populated during instance creation.
    8787    }
    8888  }
Note: See TracChangeset for help on using the changeset viewer.