Free cookie consent management tool by TermsFeed Policy Generator

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

#2520

  • renamed StorableClass -> StorableType
  • changed persistence to use GUIDs instead of type names
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PersistenceOverhaul/HeuristicLab.Persistence/4.0/Core/Mapper.cs

    r14594 r14711  
    139139      bundle.RootBoxId = mapper.GetBoxId(o);
    140140      bundle.AddRangeTransformerGuids(mapper.transformers.GetValues().Select(x => x.Guid).Select(x => ByteString.CopyFrom(x.ToByteArray())));
    141       bundle.AddRangeTypeGuids(mapper.types.GetValues().Select(x => x.AssemblyQualifiedName ?? x.Name).Select(x => ByteString.CopyFromUtf8(x)));
     141      bundle.AddRangeTypeGuids(mapper.types.GetValues().Select(x => ByteString.CopyFrom(StaticCache.GetGuid(x).ToByteArray())));
    142142      bundle.AddRangeStrings(mapper.strings.GetValues());
    143143      bundle.AddRangeBoxes(mapper.boxId2Box.OrderBy(x => x.Key).Select(x => x.Value));
     
    146146    public static object ToObject(Bundle bundle) {
    147147      var mapper = new Mapper();
    148       mapper.types = new Index<Type>(bundle.TypeGuidsList.Select(x => x.ToStringUtf8()).Select(x => Type.GetType(x)));
     148      mapper.types = new Index<Type>(bundle.TypeGuidsList.Select(x => StaticCache.GetType(new Guid(x.ToByteArray()))));
    149149      mapper.strings = new Index<string>(bundle.StringsList);
    150150      mapper.boxId2Box = bundle.BoxesList.Select((b, i) => new { Box = b, Index = i }).ToDictionary(k => (uint)k.Index + 1, v => v.Box);
Note: See TracChangeset for help on using the changeset viewer.