]> SALOME platform Git repositories - modules/med.git/blob - src/MEDMEM/MEDMEM_MedMedDriver21.hxx
Salome HOME
Merge from BR_V5_DEV 16Feb09
[modules/med.git] / src / MEDMEM / MEDMEM_MedMedDriver21.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 //  This library is free software; you can redistribute it and/or
7 //  modify it under the terms of the GNU Lesser General Public
8 //  License as published by the Free Software Foundation; either
9 //  version 2.1 of the License.
10 //
11 //  This library is distributed in the hope that it will be useful,
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 //  Lesser General Public License for more details.
15 //
16 //  You should have received a copy of the GNU Lesser General Public
17 //  License along with this library; if not, write to the Free Software
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 #ifndef MED_MED_DRIVER21_HXX
23 #define MED_MED_DRIVER21_HXX
24
25 #include "MEDMEM_MedMedDriver.hxx"
26 #include <string>
27 #include "MEDMEM_Utilities.hxx"
28 #include "MEDMEM_Exception.hxx"
29 #include "MEDMEM_GenDriver.hxx"
30 #include "MEDMEM_define.hxx"
31
32 /*!
33
34   Driver Med for MED.
35
36   Generic part : implement open and close methods.
37
38 */
39
40 // This driver pilots within a MED class read/write accesses of fields/meshes
41 namespace MEDMEM {
42 class MESH;
43 class FIELD_;
44 class MED;
45
46 class MED_MED_DRIVER21 : public virtual MED_MED_DRIVER
47 {
48 protected:
49
50   med_2_1::med_idt           _medIdt;         // The _medIdt used to write/read Meshes to ::_filename
51    
52 public :
53   MED_MED_DRIVER21();
54   MED_MED_DRIVER21(const string & fileName,  MED * const ptrMed);
55   MED_MED_DRIVER21(const string & fileName,  MED * const ptrMed,
56                    MED_EN::med_mode_acces accessMode);
57   MED_MED_DRIVER21(const MED_MED_DRIVER21 & driver);
58   virtual ~MED_MED_DRIVER21();
59   void open() throw (MEDEXCEPTION) ;
60   void close();
61   virtual void write          ( void ) const ;
62   virtual void writeFrom      ( void ) const  ;
63   virtual void read           ( void )  ;
64   virtual void readFileStruct ( void ) ;
65 private:
66   virtual GENDRIVER * copy ( void ) const  ;
67 };
68
69 /*!
70
71   Driver Med for MED : Read only.
72
73   Implement read method.
74
75 */
76
77   class MED_MED_RDONLY_DRIVER21 : public virtual IMED_MED_RDONLY_DRIVER, public virtual MED_MED_DRIVER21
78 {
79 public :
80   MED_MED_RDONLY_DRIVER21();
81   MED_MED_RDONLY_DRIVER21(const string & fileName,  MED * const ptrMed);
82   MED_MED_RDONLY_DRIVER21(const MED_MED_RDONLY_DRIVER21 & driver);
83   virtual ~MED_MED_RDONLY_DRIVER21();
84   void write          ( void ) const throw (MEDEXCEPTION) ;
85   void writeFrom      ( void ) const throw (MEDEXCEPTION) ;
86   void read           ( void ) throw (MEDEXCEPTION);
87   void readFileStruct ( void ) throw (MEDEXCEPTION) ;
88 private:
89   virtual GENDRIVER * copy ( void ) const ;
90 };
91
92 class MED_MED_WRONLY_DRIVER21 : public virtual IMED_MED_WRONLY_DRIVER, public virtual MED_MED_DRIVER21
93 {
94
95 public :
96   MED_MED_WRONLY_DRIVER21();
97   MED_MED_WRONLY_DRIVER21(const string & fileName,  MED * const ptrMed);
98   MED_MED_WRONLY_DRIVER21(const MED_MED_WRONLY_DRIVER21 & driver);
99   virtual ~MED_MED_WRONLY_DRIVER21();
100   void write          ( void ) const throw (MEDEXCEPTION);
101   void writeFrom      ( void ) const throw (MEDEXCEPTION);
102   void read           ( void ) throw (MEDEXCEPTION) ;
103   void readFileStruct ( void ) throw (MEDEXCEPTION) ;
104 private:
105   virtual GENDRIVER * copy ( void ) const ;
106 };
107
108 class MED_MED_RDWR_DRIVER21 : public MED_MED_RDONLY_DRIVER21,
109                               public MED_MED_WRONLY_DRIVER21,
110                               public IMED_MED_RDWR_DRIVER
111 {
112 public :
113   MED_MED_RDWR_DRIVER21();
114   MED_MED_RDWR_DRIVER21(const string & fileName,  MED * const ptrMed);
115   MED_MED_RDWR_DRIVER21(const MED_MED_RDWR_DRIVER21 & driver);
116   ~MED_MED_RDWR_DRIVER21();
117   void write          ( void ) const throw (MEDEXCEPTION);
118   void writeFrom      ( void ) const throw (MEDEXCEPTION);
119   void read           ( void ) throw (MEDEXCEPTION);
120   void readFileStruct ( void ) throw (MEDEXCEPTION);
121 private:
122   virtual GENDRIVER * copy ( void ) const ;
123 };
124
125 }
126
127 #endif /* MED_MED_DRIVER21_HXX */