1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 #ifndef MED_MED_DRIVER22_HXX
23 #define MED_MED_DRIVER22_HXX
25 #include "MEDMEM_MedMedDriver.hxx"
27 #include "MEDMEM_Utilities.hxx"
28 #include "MEDMEM_Exception.hxx"
29 #include "MEDMEM_GenDriver.hxx"
30 #include "MEDMEM_define.hxx"
36 Generic part : implement open and close methods.
40 // This driver pilots within a MED class read/write accesses of fields/meshes
46 class MED_MED_DRIVER22 : public virtual MED_MED_DRIVER
50 med_2_3::med_idt _medIdt; // The _medIdt used to write/read Meshes to ::_filename
63 MED_MED_DRIVER22(const string & fileName, MED * const ptrMed);
67 MED_MED_DRIVER22(const string & fileName, MED * const ptrMed,
68 MED_EN::med_mode_acces accessMode);
70 // OPERATEUR DE RECOPIE AVEC _medIdt ??
74 MED_MED_DRIVER22(const MED_MED_DRIVER22 & driver);
79 virtual ~MED_MED_DRIVER22() ;
81 void open() throw (MEDEXCEPTION) ;
84 //virtual void write ( void ) const = 0 ;
85 virtual void write ( void ) const ;
86 //virtual void writeFrom ( void ) const = 0 ;
87 virtual void writeFrom ( void ) const ;
88 //virtual void read ( void ) = 0 ;
89 virtual void read ( void ) ;
90 //virtual void readFileStruct ( void ) = 0 ;
91 virtual void readFileStruct ( void ) ;
94 //virtual GENDRIVER * copy ( void ) const = 0 ;
95 virtual GENDRIVER * copy ( void ) const ;
101 Driver Med for MED : Read only.
103 Implement read method.
107 class MED_MED_RDONLY_DRIVER22 : public virtual IMED_MED_RDONLY_DRIVER, public virtual MED_MED_DRIVER22
113 MED_MED_RDONLY_DRIVER22();
117 MED_MED_RDONLY_DRIVER22(const string & fileName, MED * const ptrMed);
121 MED_MED_RDONLY_DRIVER22(const MED_MED_RDONLY_DRIVER22 & driver);
126 virtual ~MED_MED_RDONLY_DRIVER22();
129 Return a MEDEXCEPTION : it is the read-only driver.
131 void write ( void ) const throw (MEDEXCEPTION) ;
133 Return a MEDEXCEPTION : it is the read-only driver.
135 void writeFrom ( void ) const throw (MEDEXCEPTION) ;
137 Read all from the file.
139 void read ( void ) throw (MEDEXCEPTION);
141 Read only table of contents of the file.
143 All objects are created but there values are not read.
145 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
148 virtual GENDRIVER * copy ( void ) const ;
154 Driver Med for MED : Write only.
156 Implement write method.
160 class MED_MED_WRONLY_DRIVER22 : public virtual IMED_MED_WRONLY_DRIVER, public virtual MED_MED_DRIVER22
167 MED_MED_WRONLY_DRIVER22();
171 MED_MED_WRONLY_DRIVER22(const string & fileName, MED * const ptrMed);
175 MED_MED_WRONLY_DRIVER22(const MED_MED_WRONLY_DRIVER22 & driver);
180 virtual ~MED_MED_WRONLY_DRIVER22();
185 void write ( void ) const throw (MEDEXCEPTION);
187 Write only objects created from this MED driver in file.
189 void writeFrom ( void ) const throw (MEDEXCEPTION);
191 Return a MEDEXCEPTION : it is the write-only driver.
193 void read ( void ) throw (MEDEXCEPTION) ;
195 Return a MEDEXCEPTION : it is the write-only driver.
197 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
200 virtual GENDRIVER * copy ( void ) const ;
206 Driver Med for MED : Read write.
207 - Use read method from MED_MED_RDONLY_DRIVER
208 - Use write method from MED_MED_WDONLY_DRIVER
212 class MED_MED_RDWR_DRIVER22 : public virtual MED_MED_RDONLY_DRIVER22,
213 public virtual MED_MED_WRONLY_DRIVER22,
214 public virtual IMED_MED_RDWR_DRIVER
221 MED_MED_RDWR_DRIVER22();
225 MED_MED_RDWR_DRIVER22(const string & fileName, MED * const ptrMed);
229 MED_MED_RDWR_DRIVER22(const MED_MED_RDWR_DRIVER22 & driver);
234 ~MED_MED_RDWR_DRIVER22();
239 void write ( void ) const throw (MEDEXCEPTION);
241 Write only objects created from this MED driver in file.
243 void writeFrom ( void ) const throw (MEDEXCEPTION);
245 Read all from the file.
247 void read ( void ) throw (MEDEXCEPTION);
249 Read only table of contents of the file.
251 All objects are created but there values are not read.
253 void readFileStruct ( void ) throw (MEDEXCEPTION);
256 virtual GENDRIVER * copy ( void ) const ;
261 #endif /* MED_MED_DRIVER22_HXX */