Last change
on this file since 1623 was
1574,
checked in by epitzer, 15 years ago
|
Fix problem with loading configuration. Properly initialize and register instance for empty types and make sure Formats have comparable hash codes. (#583)
|
File size:
714 bytes
|
Rev | Line | |
---|
[1556] | 1 | using System;
|
---|
| 2 |
|
---|
| 3 | namespace HeuristicLab.Persistence.Interfaces {
|
---|
| 4 |
|
---|
[1564] | 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)
|
---|
[1556] | 13 | return false;
|
---|
[1564] | 14 | return f.Name == this.Name;
|
---|
[1556] | 15 | }
|
---|
[1564] | 16 |
|
---|
| 17 | public override bool Equals(object obj) {
|
---|
[1566] | 18 | FormatBase<SerialDataFormat> f = obj as FormatBase<SerialDataFormat>;
|
---|
[1564] | 19 | return Equals(f);
|
---|
[1556] | 20 | }
|
---|
[1566] | 21 |
|
---|
[1574] | 22 | public override int GetHashCode() {
|
---|
| 23 | return Name.GetHashCode();
|
---|
| 24 | }
|
---|
| 25 |
|
---|
[1556] | 26 | }
|
---|
[1564] | 27 |
|
---|
[1556] | 28 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.