1 // Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/
20 #ifndef TYPE_MESH_DRIVER_HXX
21 #define TYPE_MESH_DRIVER_HXX
26 #include "MEDMEM_define.hxx"
27 #include "MEDMEM_GenDriver.hxx"
29 #include "MEDMEM_STRING.hxx"
30 #include "MEDMEM_Exception.hxx"
31 #include "MEDMEM_Utilities.hxx"
37 Generic part : implement the readopen and close methods.
47 class TYPE_MESH_DRIVER : public GENDRIVER
52 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
64 TYPE_MESH_DRIVER(const string & fileName,
66 med_mode_acces accessMode) ;
70 TYPE_MESH_DRIVER(const TYPE_MESH_DRIVER & driver) ;
75 virtual ~TYPE_MESH_DRIVER() ;
77 void open() throw (MEDEXCEPTION);
78 void close() throw (MEDEXCEPTION);
80 virtual void write( void ) const = 0 ;
81 virtual void read ( void ) = 0 ;
84 Set the name of the MESH asked in file.
86 It could be different than the name of the MESH object.
88 void setMeshName(const string & meshName) ;
90 Get the name of the MESH asked in file.
92 string getMeshName() const ;
95 virtual GENDRIVER * copy ( void ) const = 0 ;
100 class TYPE_MESH_RDONLY_DRIVER : public virtual TYPE_MESH_DRIVER
108 TYPE_MESH_RDONLY_DRIVER() ;
112 TYPE_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
116 TYPE_MESH_RDONLY_DRIVER(const TYPE_MESH_RDONLY_DRIVER & driver) ;
121 virtual ~TYPE_MESH_RDONLY_DRIVER() ;
124 Return a MEDEXCEPTION : it is the read-only driver.
126 void write( void ) const throw (MEDEXCEPTION);
128 Read MESH in the specified file.
130 void read ( void ) throw (MEDEXCEPTION);
134 GENDRIVER * copy ( void ) const ;
140 Driver Med for MESH : Write only.
142 Implement write method.
146 class TYPE_MESH_WRONLY_DRIVER : public virtual TYPE_MESH_DRIVER {
153 TYPE_MESH_WRONLY_DRIVER() ;
157 TYPE_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
161 TYPE_MESH_WRONLY_DRIVER(const TYPE_MESH_WRONLY_DRIVER & driver) ;
166 virtual ~TYPE_MESH_WRONLY_DRIVER() ;
169 Write MESH in the specified file.
171 void write( void ) const throw (MEDEXCEPTION);
173 Return a MEDEXCEPTION : it is the write-only driver.
175 void read ( void ) throw (MEDEXCEPTION);
179 GENDRIVER * copy ( void ) const ;
185 Driver TYPE for MESH : Read write.
186 - Use read method from TYPE_MESH_RDONLY_DRIVER
187 - Use write method from TYPE_MESH_WRONLY_DRIVER
191 class TYPE_MESH_RDWR_DRIVER : public TYPE_MESH_RDONLY_DRIVER, public TYPE_MESH_WRONLY_DRIVER {
198 TYPE_MESH_RDWR_DRIVER() ;
202 TYPE_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
206 TYPE_MESH_RDWR_DRIVER(const TYPE_MESH_RDWR_DRIVER & driver) ;
211 ~TYPE_MESH_RDWR_DRIVER() ;
214 Write MESH in the specified file.
216 void write(void) const throw (MEDEXCEPTION);
218 Read MESH in the specified file.
220 void read (void) throw (MEDEXCEPTION);
223 GENDRIVER * copy(void) const ;
229 #endif /* TYPE_MESH_DRIVER_HXX */