1 #ifndef MED_MED_DRIVER_HXX
2 #define MED_MED_DRIVER_HXX
5 #include "MEDMEM_STRING.hxx"
7 #include "MEDMEM_Exception.hxx"
9 #include "MEDMEM_GenDriver.hxx"
11 #include "MEDMEM_define.hxx"
13 //using namaspace MED_FR ;
23 Generic part : implement open and close methods.
27 // This driver pilots within a MED class read/write accesses of fields/meshes
28 class MED_MED_DRIVER : public GENDRIVER
32 MED * const _ptrMed; // Store 'MED_DRIVER (0..n)----(1) MED' associations
33 med_idt _medIdt; // The _medIdt used to write/read Meshes to ::_filename
46 MED_MED_DRIVER(const string & fileName, MED * const ptrMed);
50 MED_MED_DRIVER(const string & fileName, MED * const ptrMed,
51 MED_EN::med_mode_acces accessMode);
53 // OPERATEUR DE RECOPIE AVEC _medIdt ??
57 MED_MED_DRIVER(const MED_MED_DRIVER & driver);
62 virtual ~MED_MED_DRIVER() ;
64 void open() throw (MEDEXCEPTION) ;
67 //virtual void write ( void ) const = 0 ;
68 virtual void write ( void ) const ;
69 //virtual void writeFrom ( void ) const = 0 ;
70 virtual void writeFrom ( void ) const ;
71 //virtual void read ( void ) = 0 ;
72 virtual void read ( void ) ;
73 //virtual void readFileStruct ( void ) = 0 ;
74 virtual void readFileStruct ( void ) ;
77 //virtual GENDRIVER * copy ( void ) const = 0 ;
78 virtual GENDRIVER * copy ( void ) const ;
84 Driver Med for MED : Read only.
86 Implement read method.
90 class MED_MED_RDONLY_DRIVER : public virtual MED_MED_DRIVER
96 MED_MED_RDONLY_DRIVER();
100 MED_MED_RDONLY_DRIVER(const string & fileName, MED * const ptrMed);
104 MED_MED_RDONLY_DRIVER(const MED_MED_RDONLY_DRIVER & driver);
109 virtual ~MED_MED_RDONLY_DRIVER();
112 Return a MEDEXCEPTION : it is the read-only driver.
114 void write ( void ) const throw (MEDEXCEPTION) ;
116 Return a MEDEXCEPTION : it is the read-only driver.
118 void writeFrom ( void ) const throw (MEDEXCEPTION) ;
120 Read all from the file.
122 void read ( void ) throw (MEDEXCEPTION);
124 Read only table of contents of the file.
126 All objects are created but there values are not read.
128 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
131 virtual GENDRIVER * copy ( void ) const ;
137 Driver Med for MED : Write only.
139 Implement write method.
143 class MED_MED_WRONLY_DRIVER : public virtual MED_MED_DRIVER
150 MED_MED_WRONLY_DRIVER();
154 MED_MED_WRONLY_DRIVER(const string & fileName, MED * const ptrMed);
158 MED_MED_WRONLY_DRIVER(const MED_MED_WRONLY_DRIVER & driver);
163 virtual ~MED_MED_WRONLY_DRIVER();
168 void write ( void ) const throw (MEDEXCEPTION);
170 Write only objects created from this MED driver in file.
172 void writeFrom ( void ) const throw (MEDEXCEPTION);
174 Return a MEDEXCEPTION : it is the write-only driver.
176 void read ( void ) throw (MEDEXCEPTION) ;
178 Return a MEDEXCEPTION : it is the write-only driver.
180 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
183 virtual GENDRIVER * copy ( void ) const ;
189 Driver Med for MED : Read write.
190 - Use read method from MED_MED_RDONLY_DRIVER
191 - Use write method from MED_MED_WDONLY_DRIVER
195 class MED_MED_RDWR_DRIVER : public virtual MED_MED_RDONLY_DRIVER,
196 public virtual MED_MED_WRONLY_DRIVER
203 MED_MED_RDWR_DRIVER();
207 MED_MED_RDWR_DRIVER(const string & fileName, MED * const ptrMed);
211 MED_MED_RDWR_DRIVER(const MED_MED_RDWR_DRIVER & driver);
216 ~MED_MED_RDWR_DRIVER();
221 void write ( void ) const throw (MEDEXCEPTION);
223 Write only objects created from this MED driver in file.
225 void writeFrom ( void ) const throw (MEDEXCEPTION);
227 Read all from the file.
229 void read ( void ) throw (MEDEXCEPTION);
231 Read only table of contents of the file.
233 All objects are created but there values are not read.
235 void readFileStruct ( void ) throw (MEDEXCEPTION);
238 virtual GENDRIVER * copy ( void ) const ;
242 #endif /* MED_MED_DRIVER_HXX */