Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Persistence/3.3/Core/FormatBase.cs @ 1564

Last change on this file since 1564 was 1564, checked in by epitzer, 15 years ago

Stronger typing for formatters with the help of generics. Separate format and serial data type. (#548)

File size: 640 bytes
Line 
1using System;
2
3namespace HeuristicLab.Persistence.Interfaces {
4
5  public abstract class FormatBase<SerialDataFormat> : IFormat<SerialDataFormat> where SerialDataFormat : ISerialData {
6
7    public abstract string Name { get; }
8
9    public Type SerialDataType { get { return typeof(SerialDataFormat); } }
10
11    public bool Equals(FormatBase<SerialDataFormat> f) {
12      if (f == null)
13        return false;
14      return f.Name == this.Name;
15    }
16
17    public override bool Equals(object obj) {
18      FormatBase<SerialDataFormat> f = obj as FormatBase<SerialDataFormat>;     
19      return Equals(f);
20    }
21   
22  }
23
24}
Note: See TracBrowser for help on using the repository browser.