1 // MED MEDMEM : MED files in memory
3 // Copyright (C) 2003 CEA/DEN, EDF R&D
7 // File : MEDMEM_GibiMeshDriver.hxx
10 #ifndef GIBI_MESH_DRIVER_HXX
11 #define GIBI_MESH_DRIVER_HXX
16 #include "MEDMEM_define.hxx"
17 #include "MEDMEM_GenDriver.hxx"
19 #include "MEDMEM_STRING.hxx"
20 #include "MEDMEM_Exception.hxx"
21 #include "utilities.h"
32 Generic part : implement the readopen and close methods.
37 class GIBI_MESH_DRIVER : public GENDRIVER
42 // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
54 GIBI_MESH_DRIVER(const string & fileName,
56 med_mode_acces accessMode) ;
60 GIBI_MESH_DRIVER(const GIBI_MESH_DRIVER & driver) ;
65 virtual ~GIBI_MESH_DRIVER() ;
67 void open() throw (MEDEXCEPTION);
68 void close() throw (MEDEXCEPTION);
70 virtual void write( void ) const = 0 ;
71 virtual void read ( void ) = 0 ;
74 Set the name of the MESH asked in file.
76 It could be different than the name of the MESH object.
78 void setMeshName(const string & meshName) ;
80 Get the name of the MESH asked in file.
82 string getMeshName() const ;
85 virtual GENDRIVER * copy ( void ) const = 0 ;
90 class GIBI_MESH_RDONLY_DRIVER : public virtual GIBI_MESH_DRIVER
98 GIBI_MESH_RDONLY_DRIVER() ;
102 GIBI_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
106 GIBI_MESH_RDONLY_DRIVER(const GIBI_MESH_RDONLY_DRIVER & driver) ;
111 virtual ~GIBI_MESH_RDONLY_DRIVER() ;
114 Return a MEDEXCEPTION : it is the read-only driver.
116 void write( void ) const throw (MEDEXCEPTION);
118 Read MESH in the specified file.
120 void read ( void ) throw (MEDEXCEPTION);
124 GENDRIVER * copy ( void ) const ;
130 Driver Med for MESH : Write only.
132 Implement write method.
136 class GIBI_MESH_WRONLY_DRIVER : public virtual GIBI_MESH_DRIVER {
143 GIBI_MESH_WRONLY_DRIVER() ;
147 GIBI_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
151 GIBI_MESH_WRONLY_DRIVER(const GIBI_MESH_WRONLY_DRIVER & driver) ;
156 virtual ~GIBI_MESH_WRONLY_DRIVER() ;
159 Write MESH in the specified file.
161 void write( void ) const throw (MEDEXCEPTION);
163 Return a MEDEXCEPTION : it is the write-only driver.
165 void read ( void ) throw (MEDEXCEPTION);
169 GENDRIVER * copy ( void ) const ;
175 Driver GIBI for MESH : Read write.
176 - Use read method from GIBI_MESH_RDONLY_DRIVER
177 - Use write method from GIBI_MESH_WRONLY_DRIVER
181 class GIBI_MESH_RDWR_DRIVER : public GIBI_MESH_RDONLY_DRIVER, public GIBI_MESH_WRONLY_DRIVER {
188 GIBI_MESH_RDWR_DRIVER() ;
192 GIBI_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
196 GIBI_MESH_RDWR_DRIVER(const GIBI_MESH_RDWR_DRIVER & driver) ;
201 ~GIBI_MESH_RDWR_DRIVER() ;
204 Write MESH in the specified file.
206 void write(void) const throw (MEDEXCEPTION);
208 Read MESH in the specified file.
210 void read (void) throw (MEDEXCEPTION);
213 GENDRIVER * copy(void) const ;
218 #endif /* GIBI_MESH_DRIVER_HXX */