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/ or email : webmaster.salome@opencascade.com
20 #ifndef TYPE_MESH_DRIVER_HXX
21 #define TYPE_MESH_DRIVER_HXX
28 #include "MEDMEM_define.hxx"
29 #include "MEDMEM_GenDriver.hxx"
31 #include "MEDMEM_STRING.hxx"
32 #include "MEDMEM_Exception.hxx"
33 #include "MEDMEM_Utilities.hxx"
39 Generic part : implement the readopen and close methods.
49 class MEDMEM_EXPORT TYPE_MESH_DRIVER : public GENDRIVER
54 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
66 TYPE_MESH_DRIVER(const std::string & fileName,
68 med_mode_acces accessMode) ;
72 TYPE_MESH_DRIVER(const TYPE_MESH_DRIVER & driver) ;
77 virtual ~TYPE_MESH_DRIVER() ;
79 void open() throw (MEDEXCEPTION);
80 void close() throw (MEDEXCEPTION);
82 virtual void write( void ) const = 0 ;
83 virtual void read ( void ) = 0 ;
86 Set the name of the MESH asked in file.
88 It could be different than the name of the MESH object.
90 void setMeshName(const string & meshName) ;
92 Get the name of the MESH asked in file.
94 string getMeshName() const ;
97 virtual GENDRIVER * copy ( void ) const = 0 ;
102 class MEDMEM_EXPORT TYPE_MESH_RDONLY_DRIVER : public virtual TYPE_MESH_DRIVER
110 TYPE_MESH_RDONLY_DRIVER() ;
114 TYPE_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
118 TYPE_MESH_RDONLY_DRIVER(const TYPE_MESH_RDONLY_DRIVER & driver) ;
123 virtual ~TYPE_MESH_RDONLY_DRIVER() ;
126 Return a MEDEXCEPTION : it is the read-only driver.
128 void write( void ) const throw (MEDEXCEPTION);
130 Read MESH in the specified file.
132 void read ( void ) throw (MEDEXCEPTION);
136 GENDRIVER * copy ( void ) const ;
142 Driver Med for MESH : Write only.
144 Implement write method.
148 class MEDMEM_EXPORT TYPE_MESH_WRONLY_DRIVER : public virtual TYPE_MESH_DRIVER {
155 TYPE_MESH_WRONLY_DRIVER() ;
159 TYPE_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
163 TYPE_MESH_WRONLY_DRIVER(const TYPE_MESH_WRONLY_DRIVER & driver) ;
168 virtual ~TYPE_MESH_WRONLY_DRIVER() ;
171 Write MESH in the specified file.
173 void write( void ) const throw (MEDEXCEPTION);
175 Return a MEDEXCEPTION : it is the write-only driver.
177 void read ( void ) throw (MEDEXCEPTION);
181 GENDRIVER * copy ( void ) const ;
187 Driver TYPE for MESH : Read write.
188 - Use read method from TYPE_MESH_RDONLY_DRIVER
189 - Use write method from TYPE_MESH_WRONLY_DRIVER
193 class MEDMEM_EXPORT TYPE_MESH_RDWR_DRIVER : public TYPE_MESH_RDONLY_DRIVER, public TYPE_MESH_WRONLY_DRIVER {
200 TYPE_MESH_RDWR_DRIVER() ;
204 TYPE_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
208 TYPE_MESH_RDWR_DRIVER(const TYPE_MESH_RDWR_DRIVER & driver) ;
213 ~TYPE_MESH_RDWR_DRIVER() ;
216 Write MESH in the specified file.
218 void write(void) const throw (MEDEXCEPTION);
220 Read MESH in the specified file.
222 void read (void) throw (MEDEXCEPTION);
225 GENDRIVER * copy(void) const ;
231 #endif /* TYPE_MESH_DRIVER_HXX */