1 // Copyright (C) 2007-2012 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
23 #ifndef TYPE_MESH_DRIVER_HXX
24 #define TYPE_MESH_DRIVER_HXX
31 #include "MEDMEM_define.hxx"
32 #include "MEDMEM_GenDriver.hxx"
34 #include "MEDMEM_STRING.hxx"
35 #include "MEDMEM_Exception.hxx"
36 #include "MEDMEM_Utilities.hxx"
42 Generic part : implement the readopen and close methods.
52 class MEDMEM_EXPORT TYPE_MESH_DRIVER : public GENDRIVER
57 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
69 TYPE_MESH_DRIVER(const std::string & fileName,
71 med_mode_acces accessMode) ;
75 TYPE_MESH_DRIVER(const TYPE_MESH_DRIVER & driver) ;
80 virtual ~TYPE_MESH_DRIVER() ;
82 void open() throw (MEDEXCEPTION);
83 void close() throw (MEDEXCEPTION);
85 virtual void write( void ) const = 0 ;
86 virtual void read ( void ) = 0 ;
89 Set the name of the MESH asked in file.
91 It could be different than the name of the MESH object.
93 void setMeshName(const string & meshName) ;
95 Get the name of the MESH asked in file.
97 string getMeshName() const ;
100 virtual GENDRIVER * copy ( void ) const = 0 ;
105 class MEDMEM_EXPORT TYPE_MESH_RDONLY_DRIVER : public virtual TYPE_MESH_DRIVER
113 TYPE_MESH_RDONLY_DRIVER() ;
117 TYPE_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
121 TYPE_MESH_RDONLY_DRIVER(const TYPE_MESH_RDONLY_DRIVER & driver) ;
126 virtual ~TYPE_MESH_RDONLY_DRIVER() ;
129 Return a MEDEXCEPTION : it is the read-only driver.
131 void write( void ) const throw (MEDEXCEPTION);
133 Read MESH in the specified file.
135 void read ( void ) throw (MEDEXCEPTION);
139 GENDRIVER * copy ( void ) const ;
145 Driver Med for MESH : Write only.
147 Implement write method.
151 class MEDMEM_EXPORT TYPE_MESH_WRONLY_DRIVER : public virtual TYPE_MESH_DRIVER {
158 TYPE_MESH_WRONLY_DRIVER() ;
162 TYPE_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
166 TYPE_MESH_WRONLY_DRIVER(const TYPE_MESH_WRONLY_DRIVER & driver) ;
171 virtual ~TYPE_MESH_WRONLY_DRIVER() ;
174 Write MESH in the specified file.
176 void write( void ) const throw (MEDEXCEPTION);
178 Return a MEDEXCEPTION : it is the write-only driver.
180 void read ( void ) throw (MEDEXCEPTION);
184 GENDRIVER * copy ( void ) const ;
190 Driver TYPE for MESH : Read write.
191 - Use read method from TYPE_MESH_RDONLY_DRIVER
192 - Use write method from TYPE_MESH_WRONLY_DRIVER
196 class MEDMEM_EXPORT TYPE_MESH_RDWR_DRIVER : public TYPE_MESH_RDONLY_DRIVER, public TYPE_MESH_WRONLY_DRIVER {
203 TYPE_MESH_RDWR_DRIVER() ;
207 TYPE_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
211 TYPE_MESH_RDWR_DRIVER(const TYPE_MESH_RDWR_DRIVER & driver) ;
216 ~TYPE_MESH_RDWR_DRIVER() ;
219 Write MESH in the specified file.
221 void write(void) const throw (MEDEXCEPTION);
223 Read MESH in the specified file.
225 void read (void) throw (MEDEXCEPTION);
228 GENDRIVER * copy(void) const ;
234 #endif /* TYPE_MESH_DRIVER_HXX */