1 // MED MEDMEM : MED files in memory
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : MEDMEM_MedMedDriver.hxx
27 #ifndef MED_MED_DRIVER_HXX
28 #define MED_MED_DRIVER_HXX
31 #include "MEDMEM_STRING.hxx"
32 #include "utilities.h"
33 #include "MEDMEM_Exception.hxx"
35 #include "MEDMEM_GenDriver.hxx"
37 #include "MEDMEM_define.hxx"
39 //using namaspace MED_FR ;
49 Generic part : implement open and close methods.
53 // This driver pilots within a MED class read/write accesses of fields/meshes
54 class MED_MED_DRIVER : public GENDRIVER
58 MED * const _ptrMed; // Store 'MED_DRIVER (0..n)----(1) MED' associations
59 med_idt _medIdt; // The _medIdt used to write/read Meshes to ::_filename
72 MED_MED_DRIVER(const string & fileName, MED * const ptrMed);
76 MED_MED_DRIVER(const string & fileName, MED * const ptrMed,
77 MED_EN::med_mode_acces accessMode);
79 // OPERATEUR DE RECOPIE AVEC _medIdt ??
83 MED_MED_DRIVER(const MED_MED_DRIVER & driver);
88 virtual ~MED_MED_DRIVER() ;
90 void open() throw (MEDEXCEPTION) ;
93 //virtual void write ( void ) const = 0 ;
94 virtual void write ( void ) const ;
95 //virtual void writeFrom ( void ) const = 0 ;
96 virtual void writeFrom ( void ) const ;
97 //virtual void read ( void ) = 0 ;
98 virtual void read ( void ) ;
99 //virtual void readFileStruct ( void ) = 0 ;
100 virtual void readFileStruct ( void ) ;
103 //virtual GENDRIVER * copy ( void ) const = 0 ;
104 virtual GENDRIVER * copy ( void ) const ;
110 Driver Med for MED : Read only.
112 Implement read method.
116 class MED_MED_RDONLY_DRIVER : public virtual MED_MED_DRIVER
122 MED_MED_RDONLY_DRIVER();
126 MED_MED_RDONLY_DRIVER(const string & fileName, MED * const ptrMed);
130 MED_MED_RDONLY_DRIVER(const MED_MED_RDONLY_DRIVER & driver);
135 virtual ~MED_MED_RDONLY_DRIVER();
138 Return a MEDEXCEPTION : it is the read-only driver.
140 void write ( void ) const throw (MEDEXCEPTION) ;
142 Return a MEDEXCEPTION : it is the read-only driver.
144 void writeFrom ( void ) const throw (MEDEXCEPTION) ;
146 Read all from the file.
148 void read ( void ) throw (MEDEXCEPTION);
150 Read only table of contents of the file.
152 All objects are created but there values are not read.
154 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
157 virtual GENDRIVER * copy ( void ) const ;
163 Driver Med for MED : Write only.
165 Implement write method.
169 class MED_MED_WRONLY_DRIVER : public virtual MED_MED_DRIVER
176 MED_MED_WRONLY_DRIVER();
180 MED_MED_WRONLY_DRIVER(const string & fileName, MED * const ptrMed);
184 MED_MED_WRONLY_DRIVER(const MED_MED_WRONLY_DRIVER & driver);
189 virtual ~MED_MED_WRONLY_DRIVER();
194 void write ( void ) const throw (MEDEXCEPTION);
196 Write only objects created from this MED driver in file.
198 void writeFrom ( void ) const throw (MEDEXCEPTION);
200 Return a MEDEXCEPTION : it is the write-only driver.
202 void read ( void ) throw (MEDEXCEPTION) ;
204 Return a MEDEXCEPTION : it is the write-only driver.
206 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
209 virtual GENDRIVER * copy ( void ) const ;
215 Driver Med for MED : Read write.
216 - Use read method from MED_MED_RDONLY_DRIVER
217 - Use write method from MED_MED_WDONLY_DRIVER
221 class MED_MED_RDWR_DRIVER : public virtual MED_MED_RDONLY_DRIVER,
222 public virtual MED_MED_WRONLY_DRIVER
229 MED_MED_RDWR_DRIVER();
233 MED_MED_RDWR_DRIVER(const string & fileName, MED * const ptrMed);
237 MED_MED_RDWR_DRIVER(const MED_MED_RDWR_DRIVER & driver);
242 ~MED_MED_RDWR_DRIVER();
247 void write ( void ) const throw (MEDEXCEPTION);
249 Write only objects created from this MED driver in file.
251 void writeFrom ( void ) const throw (MEDEXCEPTION);
253 Read all from the file.
255 void read ( void ) throw (MEDEXCEPTION);
257 Read only table of contents of the file.
259 All objects are created but there values are not read.
261 void readFileStruct ( void ) throw (MEDEXCEPTION);
264 virtual GENDRIVER * copy ( void ) const ;
268 #endif /* MED_MED_DRIVER_HXX */