Free cookie consent management tool by TermsFeed Policy Generator

Changeset 1567 for trunk


Ignore:
Timestamp:
04/16/09 13:20:55 (16 years ago)
Author:
epitzer
Message:

One file per class; rename ViewOnlyFormat -> DebugStringFormat (#548)

Location:
trunk/sources/HeuristicLab.Persistence/3.3
Files:
15 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Persistence/3.3/Core/DeSerializer.cs

    r1566 r1567  
    44using HeuristicLab.Persistence.Core.Tokens;
    55
    6 namespace HeuristicLab.Persistence.Core {
     6namespace HeuristicLab.Persistence.Core { 
    77
    8   public class ParentReference { }
     8  public class Deserializer {   
    99
    10   class Midwife {
     10    class Midwife {
    1111
    12     public int? Id { get; private set; }
    13     public bool MetaMode { get; set; }
    14     public object Obj { get; private set; }
     12      public int? Id { get; private set; }
     13      public bool MetaMode { get; set; }
     14      public object Obj { get; private set; }
    1515
    16     private List<Tag> metaInfo;
    17     private List<Tag> customValues;
    18     private Type type;
    19     private IDecomposer decomposer;
     16      private List<Tag> metaInfo;
     17      private List<Tag> customValues;
     18      private Type type;
     19      private IDecomposer decomposer;
    2020
    21     public Midwife(object value) {
    22       this.Obj = value;
    23     }
     21      public Midwife(object value) {
     22        this.Obj = value;
     23      }
    2424
    25     public Midwife(Type type, IDecomposer decomposer, int? id) {
    26       this.type = type;
    27       this.decomposer = decomposer;
    28       this.Id = id;
    29       MetaMode = false;
    30       metaInfo = new List<Tag>();
    31       customValues = new List<Tag>();
    32     }
     25      public Midwife(Type type, IDecomposer decomposer, int? id) {
     26        this.type = type;
     27        this.decomposer = decomposer;
     28        this.Id = id;
     29        MetaMode = false;
     30        metaInfo = new List<Tag>();
     31        customValues = new List<Tag>();
     32      }
    3333
    34     public void CreateInstance() {
    35       if (Obj != null)
    36         throw new ApplicationException("object already instantiated");
    37       Obj = decomposer.CreateInstance(type, metaInfo);
    38     }
     34      public void CreateInstance() {
     35        if (Obj != null)
     36          throw new ApplicationException("object already instantiated");
     37        Obj = decomposer.CreateInstance(type, metaInfo);
     38      }
    3939
    40     public void AddValue(string name, object value) {
    41       if (MetaMode) {
    42         metaInfo.Add(new Tag(name, value));
    43       } else {
    44         customValues.Add(new Tag(name, value));
     40      public void AddValue(string name, object value) {
     41        if (MetaMode) {
     42          metaInfo.Add(new Tag(name, value));
     43        } else {
     44          customValues.Add(new Tag(name, value));
     45        }
     46      }
     47
     48      public void Populate() {
     49        decomposer.Populate(Obj, customValues, type);
    4550      }
    4651    }
    47 
    48     public void Populate() {
    49       decomposer.Populate(Obj, customValues, type);
    50     }
    51   }
    52 
    53   public class Deserializer {
    5452
    5553    private readonly Dictionary<int, object> id2obj;
  • trunk/sources/HeuristicLab.Persistence/3.3/HeuristicLab.Persistence-3.3.csproj

    r1564 r1567  
    101101    <Compile Include="Core\TypeStringBuilder.cs" />
    102102    <Compile Include="Core\GeneratorBase.cs" />
     103    <Compile Include="Default\DebugString\DebugString.cs" />
     104    <Compile Include="Default\DebugString\DebugStringFormat.cs" />
     105    <Compile Include="Default\DebugString\ValueType2DebugStringFormatterBase.cs" />
     106    <Compile Include="Default\DebugString\String2DebugStringFormatter.cs" />
     107    <Compile Include="Default\DebugString\Bool2DebugStringFormatter.cs" />
     108    <Compile Include="Default\DebugString\Int2DebugStringFormatter.cs" />
     109    <Compile Include="Default\DebugString\Doubld2DebugStringFormatter.cs" />
     110    <Compile Include="Default\DebugString\DateTime2DebugStringFormatter.cs" />
     111    <Compile Include="Default\DebugString\Type2DebugStringFormatter.cs" />
     112    <Compile Include="Default\DebugString\Float2DebugStringFormatter.cs" />
     113    <Compile Include="Default\DebugString\DebugStringGenerator.cs" />
    103114    <Compile Include="Default\Decomposers\ArrayDecomposer.cs" />
     115    <Compile Include="Default\Decomposers\Number2StringConverter.cs" />
     116    <Compile Include="Default\Decomposers\CompactNumberArray2StringDecomposer.cs" />
    104117    <Compile Include="Default\Decomposers\EnumerableDecomposer.cs" />
    105118    <Compile Include="Default\Decomposers\EnumDecomposer.cs" />
     
    108121    <Compile Include="Default\Decomposers\StorableDecomposer.cs" />
    109122    <Compile Include="Default\Decomposers\TypeDecomposer.cs" />
    110     <Compile Include="Default\Decomposers\X2StringDecomposer.cs" />
    111     <Compile Include="Default\ViewOnly\ViewOnlyFormat.cs">
    112       <SubType>Code</SubType>
    113     </Compile>
     123    <Compile Include="Default\Decomposers\NumberEnumerable2StringDecomposer.cs" />
    114124    <Compile Include="Default\Xml\Compact\IntArray2XmlFormatters.cs" />
    115125    <Compile Include="Default\Xml\Compact\DoubleArray2XmlFormatters.cs" />
Note: See TracChangeset for help on using the changeset viewer.