1 #ifndef MED_MED_DRIVER_HXX
2 #define MED_MED_DRIVER_HXX
5 #include "MEDMEM_STRING.hxx"
7 #include "MEDMEM_Exception.hxx"
8 #include "MEDMEM_GenDriver.hxx"
9 #include "MEDMEM_define.hxx"
15 Generic part : implement open and close methods.
19 // This driver pilots within a MED class read/write accesses of fields/meshes
25 class MED_MED_DRIVER : public GENDRIVER
29 MED * const _ptrMed; // Store 'MED_DRIVER (0..n)----(1) MED' associations
30 med_idt _medIdt; // The _medIdt used to write/read Meshes to ::_filename
43 MED_MED_DRIVER(const string & fileName, MED * const ptrMed);
47 MED_MED_DRIVER(const string & fileName, MED * const ptrMed,
48 MED_EN::med_mode_acces accessMode);
50 // OPERATEUR DE RECOPIE AVEC _medIdt ??
54 MED_MED_DRIVER(const MED_MED_DRIVER & driver);
59 virtual ~MED_MED_DRIVER() ;
61 void open() throw (MEDEXCEPTION) ;
64 //virtual void write ( void ) const = 0 ;
65 virtual void write ( void ) const ;
66 //virtual void writeFrom ( void ) const = 0 ;
67 virtual void writeFrom ( void ) const ;
68 //virtual void read ( void ) = 0 ;
69 virtual void read ( void ) ;
70 //virtual void readFileStruct ( void ) = 0 ;
71 virtual void readFileStruct ( void ) ;
74 //virtual GENDRIVER * copy ( void ) const = 0 ;
75 virtual GENDRIVER * copy ( void ) const ;
81 Driver Med for MED : Read only.
83 Implement read method.
87 class MED_MED_RDONLY_DRIVER : public virtual MED_MED_DRIVER
93 MED_MED_RDONLY_DRIVER();
97 MED_MED_RDONLY_DRIVER(const string & fileName, MED * const ptrMed);
101 MED_MED_RDONLY_DRIVER(const MED_MED_RDONLY_DRIVER & driver);
106 virtual ~MED_MED_RDONLY_DRIVER();
109 Return a MEDEXCEPTION : it is the read-only driver.
111 void write ( void ) const throw (MEDEXCEPTION) ;
113 Return a MEDEXCEPTION : it is the read-only driver.
115 void writeFrom ( void ) const throw (MEDEXCEPTION) ;
117 Read all from the file.
119 void read ( void ) throw (MEDEXCEPTION);
121 Read only table of contents of the file.
123 All objects are created but there values are not read.
125 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
128 virtual GENDRIVER * copy ( void ) const ;
134 Driver Med for MED : Write only.
136 Implement write method.
140 class MED_MED_WRONLY_DRIVER : public virtual MED_MED_DRIVER
147 MED_MED_WRONLY_DRIVER();
151 MED_MED_WRONLY_DRIVER(const string & fileName, MED * const ptrMed);
155 MED_MED_WRONLY_DRIVER(const MED_MED_WRONLY_DRIVER & driver);
160 virtual ~MED_MED_WRONLY_DRIVER();
165 void write ( void ) const throw (MEDEXCEPTION);
167 Write only objects created from this MED driver in file.
169 void writeFrom ( void ) const throw (MEDEXCEPTION);
171 Return a MEDEXCEPTION : it is the write-only driver.
173 void read ( void ) throw (MEDEXCEPTION) ;
175 Return a MEDEXCEPTION : it is the write-only driver.
177 void readFileStruct ( void ) throw (MEDEXCEPTION) ;
180 virtual GENDRIVER * copy ( void ) const ;
186 Driver Med for MED : Read write.
187 - Use read method from MED_MED_RDONLY_DRIVER
188 - Use write method from MED_MED_WDONLY_DRIVER
192 class MED_MED_RDWR_DRIVER : public virtual MED_MED_RDONLY_DRIVER,
193 public virtual MED_MED_WRONLY_DRIVER
200 MED_MED_RDWR_DRIVER();
204 MED_MED_RDWR_DRIVER(const string & fileName, MED * const ptrMed);
208 MED_MED_RDWR_DRIVER(const MED_MED_RDWR_DRIVER & driver);
213 ~MED_MED_RDWR_DRIVER();
218 void write ( void ) const throw (MEDEXCEPTION);
220 Write only objects created from this MED driver in file.
222 void writeFrom ( void ) const throw (MEDEXCEPTION);
224 Read all from the file.
226 void read ( void ) throw (MEDEXCEPTION);
228 Read only table of contents of the file.
230 All objects are created but there values are not read.
232 void readFileStruct ( void ) throw (MEDEXCEPTION);
235 virtual GENDRIVER * copy ( void ) const ;
240 #endif /* MED_MED_DRIVER_HXX */