[3743] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[7259] | 3 | * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[3743] | 4 | *
|
---|
| 5 | * This file is part of HeuristicLab.
|
---|
| 6 | *
|
---|
| 7 | * HeuristicLab is free software: you can redistribute it and/or modify
|
---|
| 8 | * it under the terms of the GNU General Public License as published by
|
---|
| 9 | * the Free Software Foundation, either version 3 of the License, or
|
---|
| 10 | * (at your option) any later version.
|
---|
| 11 | *
|
---|
| 12 | * HeuristicLab is distributed in the hope that it will be useful,
|
---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 15 | * GNU General Public License for more details.
|
---|
| 16 | *
|
---|
| 17 | * You should have received a copy of the GNU General Public License
|
---|
| 18 | * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
|
---|
| 19 | */
|
---|
| 20 | #endregion
|
---|
[1454] | 21 |
|
---|
[3743] | 22 | using System.Collections.Generic;
|
---|
| 23 |
|
---|
[1454] | 24 | namespace HeuristicLab.Persistence.Core {
|
---|
| 25 |
|
---|
[3004] | 26 | /// <summary>
|
---|
| 27 | /// Association of id, type name and serializer
|
---|
| 28 | /// </summary>
|
---|
[1542] | 29 | public class TypeMapping {
|
---|
[1623] | 30 |
|
---|
[3016] | 31 | /// <summary>
|
---|
| 32 | /// The type's id.
|
---|
| 33 | /// </summary>
|
---|
[1454] | 34 | public readonly int Id;
|
---|
[3016] | 35 |
|
---|
| 36 | /// <summary>
|
---|
| 37 | /// The type's full name.
|
---|
| 38 | /// </summary>
|
---|
[1454] | 39 | public readonly string TypeName;
|
---|
[3016] | 40 |
|
---|
| 41 |
|
---|
| 42 | /// <summary>
|
---|
| 43 | /// The full name of the serializes used to serialize the
|
---|
| 44 | /// <see cref="TypeName"/>.
|
---|
| 45 | /// </summary>
|
---|
[1566] | 46 | public readonly string Serializer;
|
---|
[1623] | 47 |
|
---|
[3016] | 48 | /// <summary>
|
---|
| 49 | /// Initializes a new instance of the <see cref="TypeMapping"/> class.
|
---|
| 50 | /// </summary>
|
---|
| 51 | /// <param name="id">The type's id.</param>
|
---|
| 52 | /// <param name="typeName">The type's full name.</param>
|
---|
| 53 | /// <param name="serializer">The full name of the serializer use to
|
---|
| 54 | /// serialize this type.</param>
|
---|
[1454] | 55 | public TypeMapping(int id, string typeName, string serializer) {
|
---|
| 56 | Id = id;
|
---|
| 57 | TypeName = typeName;
|
---|
| 58 | Serializer = serializer;
|
---|
| 59 | }
|
---|
[1623] | 60 |
|
---|
[3016] | 61 | /// <summary>
|
---|
| 62 | /// Creates a dictionary that conatins all properties
|
---|
| 63 | /// and values of this instance.
|
---|
| 64 | /// </summary>
|
---|
| 65 | /// <returns>A dictionary containing all properties
|
---|
| 66 | /// and values of this instance.</returns>
|
---|
[3937] | 67 | public Dictionary<string, string> GetDict() {
|
---|
| 68 | return new Dictionary<string, string> {
|
---|
| 69 | {"id", Id.ToString()},
|
---|
[1454] | 70 | {"typeName", TypeName},
|
---|
[1566] | 71 | {"serializer", Serializer}};
|
---|
[1454] | 72 | }
|
---|
[1623] | 73 |
|
---|
[1566] | 74 | }
|
---|
[1454] | 75 |
|
---|
| 76 | } |
---|