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
Files:
2 added
27 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  }
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs

    r13368 r14711  
    2828  /// Simple write-only format for debugging purposes.
    2929  /// </summary>
    30   [StorableClass("0299A38D-F1E7-4362-BDBF-B40ED98BA04F")]
     30  [StorableType("0299A38D-F1E7-4362-BDBF-B40ED98BA04F")]
    3131  public class DebugString : ISerialData {
    3232
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs

    r13368 r14711  
    2828  /// Simple write-only format for debugging purposes.
    2929  /// </summary>
    30   [StorableClass("197FACEB-E9E1-4D1F-AB74-4E017F083574")]
     30  [StorableType("197FACEB-E9E1-4D1F-AB74-4E017F083574")]
    3131  public class DebugStringFormat : FormatBase<DebugString> {
    3232    /// <summary>
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberArray2XmlSerializerBase.cs

    r13368 r14711  
    3131namespace HeuristicLab.Persistence.Default.Xml.Compact {
    3232
    33   [StorableClass("19C52154-260B-4003-99E0-1C47BD93618B")]
     33  [StorableType("19C52154-260B-4003-99E0-1C47BD93618B")]
    3434  internal abstract class NumberArray2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : class {
    3535
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/Compact/NumberEnumeration2XmlSerializerBase.cs

    r13368 r14711  
    2929namespace HeuristicLab.Persistence.Default.Xml.Compact {
    3030
    31   [StorableClass("994DD94B-001A-4834-8099-EC84B81B88D1")]
     31  [StorableType("994DD94B-001A-4834-8099-EC84B81B88D1")]
    3232  internal abstract class NumberEnumeration2XmlSerializerBase<T> : CompactXmlSerializerBase<T> where T : IEnumerable {
    3333
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs

    r13368 r14711  
    2929  /// or save to a file.
    3030  /// </summary>
    31   [StorableClass("954DB753-AE15-44EA-ACCA-61A4AF3D4B33")]
     31  [StorableType("954DB753-AE15-44EA-ACCA-61A4AF3D4B33")]
    3232  public class XmlFormat : FormatBase<XmlString> {
    3333    /// <summary>
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlGenerator.cs

    r12638 r14711  
    398398    /// <param name="obj">The object.</param>
    399399    /// <param name="stream">The stream.</param>
    400     /// <param name="compressionType">Type of compression, default is GZip.</param>
     400    /// <param name="compressionType">MemberSelection of compression, default is GZip.</param>
    401401    public static void Serialize(object obj, Stream stream, CompressionType compressionType = CompressionType.GZip) {
    402402      Serialize(obj, stream, ConfigurationService.Instance.GetConfiguration(new XmlFormat()), compressionType);
     
    410410    /// <param name="stream">The stream.</param>
    411411    /// <param name="config">The configuration.</param>
    412     /// <param name="compressionType">Type of compression, default is GZip.</param>
     412    /// <param name="compressionType">MemberSelection of compression, default is GZip.</param>
    413413    public static void Serialize(object obj, Stream stream, Configuration config, CompressionType compressionType = CompressionType.GZip) {
    414414      Serialize(obj, stream, config, false, compressionType);
     
    422422    /// <param name="config">The configuration.</param>
    423423    /// <param name="includeAssemblies">if set to <c>true</c> include need assemblies.</param>
    424     /// <param name="compressionType">Type of compression, default is GZip.</param>
     424    /// <param name="compressionType">MemberSelection of compression, default is GZip.</param>
    425425    public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies,
    426426                                 CompressionType compressionType = CompressionType.GZip) {
     
    449449    /// <param name="includeAssemblies">if set to <c>true</c> include need assemblies.</param>
    450450    /// <param name="types">The list of all serialized types.</param>
    451     /// <param name="compressionType">Type of compression, default is GZip.</param>
     451    /// <param name="compressionType">MemberSelection of compression, default is GZip.</param>
    452452    public static void Serialize(object obj, Stream stream, Configuration config, bool includeAssemblies, out IEnumerable<Type> types,
    453453                                 CompressionType compressionType = CompressionType.GZip) {
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlParser.cs

    r12638 r14711  
    3232namespace HeuristicLab.Persistence.Default.Xml {
    3333  /// <summary>
    34   /// Type of compression used for the Xml stream or file.
     34  /// MemberSelection of compression used for the Xml stream or file.
    3535  /// </summary>
    3636  public enum CompressionType {
     
    228228    /// <typeparam name="T">object type expected from the serialized stream</typeparam>
    229229    /// <param name="stream">The stream.</param>
    230     /// <param name="compressionType">Type of compression, default is GZip.</param>
     230    /// <param name="compressionType">MemberSelection of compression, default is GZip.</param>
    231231    /// <returns>A fresh object instance.</returns>
    232232    public static T Deserialize<T>(Stream stream, CompressionType compressionType = CompressionType.GZip) {
     
    238238    /// </summary>
    239239    /// <param name="stream">The stream.</param>
    240     /// <param name="compressionType">Type of compression, default is GZip.</param>
     240    /// <param name="compressionType">MemberSelection of compression, default is GZip.</param>
    241241    /// <returns>A fresh object instance.</returns>
    242242    public static object Deserialize(Stream stream, CompressionType compressionType = CompressionType.GZip) {
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs

    r13368 r14711  
    2929  /// XML friendly encapsulation of string data.
    3030  /// </summary>
    31   [StorableClass("CAB3BE44-DAFD-4642-ADC8-E8A4A2B18A97")]
     31  [StorableType("CAB3BE44-DAFD-4642-ADC8-E8A4A2B18A97")]
    3232  public class XmlString : ISerialData {
    3333
Note: See TracChangeset for help on using the changeset viewer.