- Timestamp:
- 06/01/17 11:29:49 (8 years ago)
- Location:
- branches/PersistenceReintegration/HeuristicLab.Persistence
- Files:
-
- 1 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Auxiliary/TypeName.cs
r14927 r15018 104 104 105 105 [StorableConstructor] 106 protected TypeName( booldeserializing) { }106 protected TypeName(StorableConstructorFlag deserializing) { } 107 107 /// <summary> 108 108 /// Initializes a new instance of the <see cref="TypeName"/> class. -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Core/FormatBase.cs
r14927 r15018 44 44 45 45 [StorableConstructor] 46 protected FormatBase( booldeserializing) { }46 protected FormatBase(StorableConstructorFlag deserializing) { } 47 47 protected FormatBase() { } 48 48 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ArraySerializer.cs
r14927 r15018 32 32 33 33 [StorableConstructor] 34 private ArraySerializer( booldeserializing) { }34 private ArraySerializer(StorableConstructorFlag deserializing) { } 35 35 public ArraySerializer() { } 36 36 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/CompactNumberArray2StringSerializer.cs
r14927 r15018 82 82 83 83 [StorableConstructor] 84 private CompactNumberArray2StringSerializer( booldeserializing) { }84 private CompactNumberArray2StringSerializer(StorableConstructorFlag deserializing) { } 85 85 public CompactNumberArray2StringSerializer() { } 86 86 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/ConcreteDictionarySerializer.cs
r14927 r15018 34 34 35 35 [StorableConstructor] 36 private ConcreteDictionarySerializer( booldeserializing) { }36 private ConcreteDictionarySerializer(StorableConstructorFlag deserializing) { } 37 37 public ConcreteDictionarySerializer() { } 38 38 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/DictionarySerializer.cs
r14927 r15018 34 34 35 35 [StorableConstructor] 36 private DictionarySerializer( booldeserializing) { }36 private DictionarySerializer(StorableConstructorFlag deserializing) { } 37 37 public DictionarySerializer() { } 38 38 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumSerializer.cs
r14928 r15018 32 32 33 33 [StorableConstructor] 34 private EnumSerializer( booldeserializing) { }34 private EnumSerializer(StorableConstructorFlag deserializing) { } 35 35 public EnumSerializer() { } 36 36 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/EnumerableSerializer.cs
r14927 r15018 35 35 36 36 [StorableConstructor] 37 private EnumerableSerializer( booldeserializing) { }37 private EnumerableSerializer(StorableConstructorFlag deserializing) { } 38 38 public EnumerableSerializer() { } 39 39 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/HashSetSerializer.cs
r14927 r15018 35 35 36 36 [StorableConstructor] 37 private HashSetSerializer( booldeserializing) { }37 private HashSetSerializer(StorableConstructorFlag deserializing) { } 38 38 public HashSetSerializer() { } 39 39 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/KeyValuePairSerializer.cs
r14927 r15018 34 34 35 35 [StorableConstructor] 36 private KeyValuePairSerializer( booldeserializing) { }36 private KeyValuePairSerializer(StorableConstructorFlag deserializing) { } 37 37 public KeyValuePairSerializer() { } 38 38 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Number2StringSerializer.cs
r14927 r15018 44 44 45 45 [StorableConstructor] 46 private Number2StringSerializer( booldeserializing) { }46 private Number2StringSerializer(StorableConstructorFlag deserializing) { } 47 47 public Number2StringSerializer() { } 48 48 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/NumberEnumerable2StringSerializer.cs
r14927 r15018 35 35 36 36 [StorableConstructor] 37 private NumberEnumerable2StringSerializer( booldeserializing) { }37 private NumberEnumerable2StringSerializer(StorableConstructorFlag deserializing) { } 38 38 public NumberEnumerable2StringSerializer() { } 39 39 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/QueueSerializer.cs
r14927 r15018 34 34 35 35 [StorableConstructor] 36 private QueueSerializer( booldeserializing) { }36 private QueueSerializer(StorableConstructorFlag deserializing) { } 37 37 public QueueSerializer() { } 38 38 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StackSerializer.cs
r14927 r15018 34 34 35 35 [StorableConstructor] 36 private StackSerializer( booldeserializing) { }36 private StackSerializer(StorableConstructorFlag deserializing) { } 37 37 public StackSerializer() { } 38 38 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/Storable/StorableSerializer.cs
r14928 r15018 50 50 51 51 [StorableConstructor] 52 private StorableSerializer( booldeserializing) : this() { }52 private StorableSerializer(StorableConstructorFlag deserializing) : this() { } 53 53 54 54 #region ICompositeSerializer implementation … … 241 241 .Where(ci => ci.GetCustomAttributes(typeof(StorableConstructorAttribute), false).Length > 0)) { 242 242 if (ci.GetParameters().Length != 1 || 243 ci.GetParameters()[0].ParameterType != typeof( bool))244 throw new PersistenceException("StorableConstructor must have exactly one argument of type bool");243 ci.GetParameters()[0].ParameterType != typeof(StorableConstructorFlag)) 244 throw new PersistenceException("StorableConstructor must have exactly one argument of type StorableConstructorFlag"); 245 245 var dm = new DynamicMethod("", typeof(object), null, type, true); 246 246 var ilgen = dm.GetILGenerator(); 247 ilgen.Emit(OpCodes.Ldc_I4_1); // load true 247 var local = ilgen.DeclareLocal(typeof(StorableConstructorFlag)); 248 ilgen.Emit(OpCodes.Ldloca_S, local); 249 ilgen.Emit(OpCodes.Initobj,typeof(StorableConstructorFlag)); // load default value for StorableConstructorFlag 250 ilgen.Emit(OpCodes.Ldloc_0); 248 251 ilgen.Emit(OpCodes.Newobj, ci); 249 252 ilgen.Emit(OpCodes.Ret); -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/StructSerializer.cs
r14928 r15018 33 33 34 34 [StorableConstructor] 35 private StructSerializer( booldeserializing) { }35 private StructSerializer(StorableConstructorFlag deserializing) { } 36 36 public StructSerializer() { } 37 37 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TupleSerializer.cs
r14927 r15018 34 34 35 35 [StorableConstructor] 36 private TupleSerializer( booldeserializing) { }36 private TupleSerializer(StorableConstructorFlag deserializing) { } 37 37 public TupleSerializer() { } 38 38 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/CompositeSerializers/TypeSerializer.cs
r14927 r15018 33 33 34 34 [StorableConstructor] 35 private TypeSerializer( booldeserializing) { }35 private TypeSerializer(StorableConstructorFlag deserializing) { } 36 36 public TypeSerializer() { } 37 37 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/DebugString/DebugString.cs
r14927 r15018 39 39 40 40 [StorableConstructor] 41 protected DebugString( booldeserializing) { }41 protected DebugString(StorableConstructorFlag deserializing) { } 42 42 private DebugString() { } 43 43 -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/DebugString/DebugStringFormat.cs
r14927 r15018 37 37 38 38 [StorableConstructor] 39 protected DebugStringFormat( booldeserializing) : base(deserializing) { }39 protected DebugStringFormat(StorableConstructorFlag deserializing) : base(deserializing) { } 40 40 public DebugStringFormat() { } 41 41 } -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/XmlFormat.cs
r14927 r15018 38 38 39 39 [StorableConstructor] 40 protected XmlFormat( booldeserializing) : base(deserializing) { }40 protected XmlFormat(StorableConstructorFlag deserializing) : base(deserializing) { } 41 41 public XmlFormat() { } 42 42 } -
branches/PersistenceReintegration/HeuristicLab.Persistence/3.3/Default/Xml/XmlString.cs
r14927 r15018 41 41 42 42 [StorableConstructor] 43 protected XmlString( booldeserializing) { }43 protected XmlString(StorableConstructorFlag deserializing) { } 44 44 private XmlString() { } 45 45 -
branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/Core/TypeInfo.cs
r14927 r15018 120 120 var ctor = Type.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic) 121 121 .Where(x => StorableConstructorAttribute.IsStorableConstructor(x)) 122 .Where(x => (x.GetParameters().Length == 1) && (x.GetParameters()[0].ParameterType == typeof( bool)))122 .Where(x => (x.GetParameters().Length == 1) && (x.GetParameters()[0].ParameterType == typeof(StorableConstructorFlag))) 123 123 .FirstOrDefault(); 124 124 if (ctor != null) { 125 125 DynamicMethod dm = new DynamicMethod("", typeof(object), null, Type, true); 126 126 ILGenerator ilgen = dm.GetILGenerator(); 127 ilgen.Emit(OpCodes.Ldc_I4_1); // load true 127 var local = ilgen.DeclareLocal(typeof(StorableConstructorFlag)); 128 ilgen.Emit(OpCodes.Ldloca_S, local); 129 ilgen.Emit(OpCodes.Initobj, typeof(StorableConstructorFlag)); // load default value for StorableConstructorFlag 130 ilgen.Emit(OpCodes.Ldloc_0); 128 131 ilgen.Emit(OpCodes.Newobj, ctor); 129 132 ilgen.Emit(OpCodes.Ret); -
branches/PersistenceReintegration/HeuristicLab.Persistence/4.0/HeuristicLab.Persistence-4.0.csproj
r14927 r15018 60 60 <Compile Include="Core\StorableClassType.cs" /> 61 61 <Compile Include="Core\StorableConstructorAttribute.cs" /> 62 <Compile Include="Core\StorableConstructorFlag.cs" /> 62 63 <Compile Include="Core\StorableHookAttribute.cs" /> 63 64 <Compile Include="Core\StorableMemberSelection.cs" />
Note: See TracChangeset
for help on using the changeset viewer.