Salome HOME
Copyright update 2021
[tools/medcoupling.git] / src / MEDLoader / MEDLoaderTraits.hxx
1 // Copyright (C) 2016-2021  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 // Author : Anthony Geay (EDF R&D)
20
21 #pragma once
22
23 #include "MEDLoaderDefines.hxx"
24 #include "MCType.hxx"
25
26 namespace MEDCoupling
27 {
28   template<class T>
29   struct MEDLOADER_EXPORT MLFieldTraits
30   {
31     typedef T EltType;
32   };
33
34   class MEDFileFieldMultiTS;
35   class MEDFileField1TS;
36   class MEDFileInt32FieldMultiTS;
37   class MEDFileInt64FieldMultiTS;
38   class MEDFileInt32Field1TS;
39   class MEDFileInt64Field1TS;
40   class MEDFileFloatFieldMultiTS;
41   class MEDFileFloatField1TS;
42   class MEDFileField1TSWithoutSDA;
43   class MEDFileInt32Field1TSWithoutSDA;
44   class MEDFileInt64Field1TSWithoutSDA;
45   class MEDFileFloatField1TSWithoutSDA;
46   class MEDFileFieldMultiTSWithoutSDA;
47   class MEDFileInt32FieldMultiTSWithoutSDA;
48   class MEDFileInt64FieldMultiTSWithoutSDA;
49   class MEDFileFloatFieldMultiTSWithoutSDA;
50   
51   template<>
52   struct MEDLOADER_EXPORT MLFieldTraits<double>
53   {
54     typedef MEDFileFieldMultiTSWithoutSDA FMTSWSDAType;
55     typedef MEDFileFieldMultiTS FMTSType;
56     typedef MEDFileField1TS F1TSType;
57     typedef MEDFileField1TSWithoutSDA F1TSWSDAType;
58   };
59
60   template<>
61   struct MEDLOADER_EXPORT MLFieldTraits<float>
62   {
63     typedef MEDFileFloatFieldMultiTSWithoutSDA FMTSWSDAType;
64     typedef MEDFileFloatFieldMultiTS FMTSType;
65     typedef MEDFileFloatField1TS F1TSType;
66     typedef MEDFileFloatField1TSWithoutSDA F1TSWSDAType;
67   };
68   
69   template<>
70   struct MEDLOADER_EXPORT MLFieldTraits<Int32>
71   {
72     typedef MEDFileInt32FieldMultiTSWithoutSDA FMTSWSDAType;
73     typedef MEDFileInt32FieldMultiTS FMTSType;
74     typedef MEDFileInt32Field1TS F1TSType;
75     typedef MEDFileInt32Field1TSWithoutSDA F1TSWSDAType;
76   };
77
78   template<>
79   struct MEDLOADER_EXPORT MLFieldTraits<Int64>
80   {
81     typedef MEDFileInt64FieldMultiTSWithoutSDA FMTSWSDAType;
82     typedef MEDFileInt64FieldMultiTS FMTSType;
83     typedef MEDFileInt64Field1TS F1TSType;
84     typedef MEDFileInt64Field1TSWithoutSDA F1TSWSDAType;
85   };
86
87   template<class T>
88   struct MEDLOADER_EXPORT MLMeshTraits
89   {
90   };
91   
92   class MEDFileUMesh;
93   class MEDFileCMesh;
94   class MEDFileCurveLinearMesh;
95   
96   template<>
97   struct MEDLOADER_EXPORT MLMeshTraits<MEDFileUMesh>
98   {
99     static const char ClassName[];
100   };
101   
102   template<>
103   struct MEDLOADER_EXPORT MLMeshTraits<MEDFileCMesh>
104   {
105     static const char ClassName[];
106   };
107
108   template<>
109   struct MEDLOADER_EXPORT MLMeshTraits<MEDFileCurveLinearMesh>
110   {
111     static const char ClassName[];
112   };
113 }