Salome HOME
Version ok de MED avec MEDGUI.
[modules/med.git] / src / MEDMEM / MEDMEM_MedMedDriver.cxx
1 # include <string>
2
3 # include "MEDMEM_MedMedDriver.hxx"
4
5 # include "MEDMEM_DriversDef.hxx"
6
7 # include "MEDMEM_Mesh.hxx"
8 # include "MEDMEM_Field.hxx"
9 // EN ATTENDANT L'utilisation de MedFieldDriver.hxx ds Field.hxx
10 # include "MEDMEM_MedFieldDriver.hxx"
11 # include "MEDMEM_Med.hxx"
12
13 # include "MEDMEM_define.hxx"
14
15 using namespace MED_FR;
16
17 MED_MED_DRIVER::MED_MED_DRIVER(): GENDRIVER(), 
18   _ptrMed((MED * const)MED_NULL), 
19   _medIdt(MED_INVALID) 
20 {}
21
22 MED_MED_DRIVER::MED_MED_DRIVER(const string & fileName,  MED * const ptrMed):
23   GENDRIVER(fileName,MED_EN::MED_RDWR), _ptrMed(ptrMed), _medIdt(MED_INVALID)
24 {}
25
26 MED_MED_DRIVER::MED_MED_DRIVER(const string & fileName,
27                                MED * const ptrMed,
28                                MED_EN::med_mode_acces accessMode):
29   GENDRIVER(fileName,accessMode), _ptrMed(ptrMed), _medIdt(MED_INVALID)
30 {}
31
32 //REM :  As t'on besoin du champ _status :  _medIdt <-> _status  ?  Oui
33
34
35 void MED_MED_DRIVER::open() {
36
37   const char * LOC ="MED_MED_DRIVER::open() : ";
38   BEGIN_OF(LOC);
39
40   // REFLECHIR SUR CE TEST PAR RAPPORT A L'OUVERTURE/FERMETURE
41   if ( _medIdt != MED_INVALID ) 
42     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) 
43                                      << "_medIdt is already in use, please close the file |" 
44                                      << _fileName << "| before calling open()"
45                                      )
46                           );   
47   
48   if ( _status != MED_CLOSED ) 
49     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) 
50                                      << "_status is closed, please close the file |"
51                                      << _fileName << "| before calling open()"
52                                      )
53                           );
54   
55   if ( _fileName == "" )
56     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) 
57                                      << "_fileName is |\"\"|, please set a correct fileName before calling open()"
58                                      )
59                           );
60   
61   _medIdt = MEDouvrir( (const_cast <char *> (_fileName.c_str())), (MED_FR::med_mode_acces) _accessMode);
62   
63   if (_medIdt > 0) _status=MED_OPENED; 
64   else {
65     _status = MED_CLOSED;
66     _medIdt = MED_INVALID;
67     throw MED_EXCEPTION (LOCALIZED( STRING(LOC) 
68                                     << "Can't open |"  << _fileName 
69                                     << "|, _medIdt : " << _medIdt
70                                     )
71                          );
72   }
73   
74   END_OF(LOC);
75 }
76
77
78 void MED_MED_DRIVER::close() {
79   MED_FR::med_int err = 0;
80   const char * LOC = "MED_MED_DRIVER::close() : ";
81   
82   
83   if ( _status == MED_CLOSED)
84     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << ": the file |" 
85                                      << _fileName << "| is already closed"
86                                      )
87                           );
88    
89   if ( _medIdt == MED_INVALID ) 
90     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << "_medIdt invalid, but the file |" 
91                                      << _fileName << "| seems to be openned !"
92                                      )
93                           );   
94   
95   err=MEDfermer(_medIdt);
96   
97   _status = MED_CLOSED;
98   _medIdt = MED_INVALID;
99
100   if (err != MED_VALID) 
101     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << "the file |" 
102                                      << _fileName << "| couldn't be closed"
103                                      )
104                           );   
105   
106   END_OF(LOC);
107 }
108
109
110
111 void MED_MED_DRIVER::readFileStruct( void ) 
112 {
113   const char * LOC = "MED_MED_DRIVER::readFileStruct() : ";
114   int          err,i,j;
115       
116   BEGIN_OF(LOC);
117
118   if ( _medIdt == MED_INVALID ) 
119     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) 
120                                      << "_medIdt is invalid, please open the file |" 
121                                      << _fileName << "| before calling readFileStruct()"
122                                      )
123                           );   
124   // Read number of meshes and their associated name
125   {
126     int          numberOfMeshes;
127     char         meshName[MED_TAILLE_NOM+1]="";
128     int          meshDim;
129     MESH *       ptrMesh;
130     MED_MESH_RDWR_DRIVER * ptrDriver;
131     
132     numberOfMeshes = MEDnMaa(_medIdt) ;
133     if ( numberOfMeshes <= 0 ) 
134       MESSAGE(LOC << "Be careful there is no mesh in file |"<<_fileName<<"| !");
135
136     MESH_ENTITIES::const_iterator currentEntity; 
137     for (i=1;i<=numberOfMeshes;i++) {
138       err = MEDmaaInfo(_medIdt, i ,meshName, &meshDim) ;
139       if (err != MED_VALID) 
140         throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) << ": can't get information about the mesh n°"
141                                          << i <<" of the file |" << _fileName << "| !"
142                                          )
143                               );   
144       MESSAGE(LOC<<": Mesh n°"<<i<<" nammed "<<meshName);
145
146       ptrMesh = new MESH();
147       // NO : create a  MED_MESH_RDWR_DRIVER with the currently used 
148       // _medIdt which remains VALID as long as _fileName is openned
149       // NO: then as long as the MED driver remains open 
150       MED_MESH_RDWR_DRIVER * _ptrDriver = new MED_MESH_RDWR_DRIVER(_fileName, ptrMesh);
151       _ptrDriver->setMeshName(meshName);
152       ptrMesh->addDriver(*_ptrDriver);
153       _ptrMed->_meshes[meshName] = ptrMesh;
154       // we create all global support (for each entity type :
155       for (currentEntity=meshEntities.begin();currentEntity != meshEntities.end(); currentEntity++) {
156         string supportName="SupportOnAll_" ;
157         supportName+=entNames[(MED_FR::med_entite_maillage)(*currentEntity).first] ;
158         (_ptrMed->_support)[meshName][(MED_FR::med_entite_maillage)(*currentEntity).first]=new SUPPORT(ptrMesh,supportName,(MED_EN::medEntityMesh) (*currentEntity).first) ;
159       }
160     }
161   }
162   
163   
164   // Read number of fields, their associated name and their list of (timeStepNumber,iterationNumber)
165   {
166     int                           numberOfFields              = 0;      //MED_INVALID
167     //    char                          fieldName[MED_TAILLE_NOM+1] = "";
168     char                          fieldName[MED_TAILLE_NOM+1] ;
169     int                           numberOfComponents           = 0;
170     char                          * componentName              = (char *) MED_NULL;
171     char                          * unitName                   =  (char *) MED_NULL;
172     //    char                          meshName[MED_TAILLE_NOM+1]  = "";
173     char                          meshName[MED_TAILLE_NOM+1]  ;
174     MED_FR::med_type_champ        type;
175     MESH                          * ptrMesh                        = (MESH  *) MED_NULL;
176     FIELD_                        * ptrField                       = (FIELD_ *) MED_NULL;
177     //MED_FIELD_RDWR_DRIVER         * ptrDriver                      = (MED_FIELD_RDWR_DRIVER * ) MED_NULL;
178     GENDRIVER                     * ptrDriver                      = (GENDRIVER * ) MED_NULL;
179     SUPPORT                       * ptrSupport                     = (SUPPORT *   ) MED_NULL;
180     MESH_ENTITIES::const_iterator currentEntity; 
181     list<MED_FR::med_geometrie_element>::const_iterator currentGeometry;
182     int                           NbOfGaussPts                 =  0;
183     int                           numberOfTimeSteps            =  -1;
184     int                           timeStepNumber               =  -1;
185     //    char                          timeStepUnit[MED_TAILLE_PNOM]= "";
186     char                          timeStepUnit[MED_TAILLE_PNOM+1] ;
187     double                        timeStep                     = 0.0;
188     int                           orderNumber                  =  -1;                           //???init?????
189     map<MESH_NAME_,MESH*>      & _meshes   =  _ptrMed->_meshes; 
190     map<FIELD_NAME_,MAP_DT_IT_> & _fields   =  _ptrMed->_fields; 
191     map<FIELD_ *, MESH_NAME_>  & _meshName =  _ptrMed->_meshName; 
192     map<MESH_NAME_, map<MED_FR::med_entite_maillage,SUPPORT *> > & _support = _ptrMed->_support;
193
194     
195     numberOfFields = MEDnChamp(_medIdt,0) ;
196     if ( numberOfFields <= 0 ) 
197       MESSAGE(LOC << "Be careful there is no field in file |"<<_fileName<<"| !");
198   
199     for (i=1;i<=numberOfFields;i++) {
200
201       numberOfComponents = MEDnChamp(_medIdt,i) ;
202       if ( numberOfComponents <= 0 ) 
203         if (err != MED_VALID) 
204           throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) <<  "Be careful there is no compound for field n°" 
205                                            << i << "in file |"<<_fileName<<"| !"));
206       
207       componentName = new char[numberOfComponents*MED_TAILLE_PNOM+1] ;
208       unitName      = new char[numberOfComponents*MED_TAILLE_PNOM+1] ;   
209       
210       err = MEDchampInfo(_medIdt, i, fieldName, &type, componentName, 
211                          unitName, numberOfComponents) ;
212
213       if (err != MED_VALID) 
214         throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) 
215                                          << ": can't get information about the field n°"
216                                          << i <<" of the file |" << _fileName << "| !")); 
217       
218       MESSAGE(LOC << "Field n°"<<i<<" nammed "<< fieldName 
219               << " ,component(s)  : " << componentName 
220               <<" ,unit(s) : "        << unitName);
221       
222
223       // Loop on all (entity type,geometry type) until you find an existing one then
224       // get the (n°dt,n°it) pairs list for the current (field,entity type,geometry type)
225       // We suppose there is the same list whatever the existing (entity type,geometry type) pair  
226       // support map :
227       for (currentEntity=meshEntities.begin();currentEntity != meshEntities.end(); currentEntity++) { 
228         //         numberOfTimeSteps  MUST be given by MEDchampInfo !!!!!
229         for (currentGeometry  = (*currentEntity).second.begin();currentGeometry != (*currentEntity).second.end(); currentGeometry++) {
230           MESSAGE("Field information with Entity,Geom = "<<(*currentEntity).first<<","<<(*currentGeometry));
231           numberOfTimeSteps = MEDnPasdetemps(_medIdt, fieldName,
232                                              (MED_FR::med_entite_maillage)(*currentEntity).first,
233                                              (MED_FR::med_geometrie_element) (*currentGeometry) );
234           MESSAGE("Field information 2 : NumberOfTimeStep :"<<numberOfTimeSteps);
235           if ( numberOfTimeSteps > MED_VALID ) 
236             break ; // There are value for some med_geometrie_element of this med_entite_maillage.
237         }
238         if (numberOfTimeSteps>0) // we have at least one
239           
240           for (currentGeometry  = (*currentEntity).second.begin();currentGeometry != (*currentEntity).second.end(); currentGeometry++) {            
241             
242             MESSAGE("Field information 3 : Geom : "<<(*currentGeometry));
243             for (j=1;j <= numberOfTimeSteps; j++) {
244               
245               MESSAGE("Field information 4 : time step j = "<<j);
246               err = MEDpasdetempsInfo( _medIdt, fieldName,
247                                        (MED_FR::med_entite_maillage) (*currentEntity).first, 
248                                        (*currentGeometry),j, 
249                                        meshName, &NbOfGaussPts,
250                                        &timeStepNumber, timeStepUnit, &timeStep,
251                                        &orderNumber);
252               if (err == MED_VALID) { // we have found for (*currentEntity).first and (*currentGeometry)
253                 
254                 MESSAGE("Field information 5 ;: NumberOfGaussPoint : "<<NbOfGaussPts<<", timeStepNumber : "<<timeStepNumber);
255                 // CORRECT a bug in MEDpasdetempsInfo :
256                 // we get a value n'importe quoi in NbOfGaussPts !!!!
257                 
258                 if (NbOfGaussPts>100)
259                   NbOfGaussPts=1 ;
260                 if (timeStepNumber<0)
261                   timeStepNumber=-1 ;
262                 
263                 
264                 // ATTENTION TRAITER L'EXCEPTION !!!!!!!!!!!!
265                 
266                 // Il faudra traiter le cas d'un champ qui utilise +sieurs (entity,geom) voir le travail de patrick
267                 // Il faudra traiter le cas des profils...
268                 //             ptrField = new FIELD();
269                 //             _ptrDriver = new MED_FIELD_RDWR_DRIVER(_fileName, ptrField);
270                 //             ptrField->addDriver(_ptrDriver);
271                 //             _fields[fieldName]=ptrField;
272                 
273                 // Verify meshName is already known
274                 
275                 map<MESH_NAME_,MESH*>::iterator _meshesIt = _meshes.find(meshName);
276                 if ( _meshesIt == _meshes.end() ) {
277                   MESSAGE(LOC << "There is no mesh |"
278                           << meshName                            <<"| in the file |"
279                           << _fileName <<"|, but  |" << meshName <<"| is referenced by field |"
280                           << fieldName                           <<"|, entity : |"
281                           << entNames [ (MED_FR::med_entite_maillage)   (*currentEntity).first] <<"|, geometric element of type |" 
282                           << geoNames [ (MED_FR::med_geometrie_element) (*currentGeometry)]     <<"|" 
283                           ); 
284                 }  // POURQUOI SI JE NE MET PAS DE BLOCK J'AI UN PARSE ERROR : PG : c'est la macro MESSAGE qui fait ca !
285                 else 
286                   ptrMesh = _meshes[meshName];
287                 
288                 ptrSupport     =  _support[meshName][(MED_FR::med_entite_maillage) (*currentEntity).first];
289                 if (NbOfGaussPts != 1)
290                   throw MEDEXCEPTION(LOCALIZED( STRING(LOC) <<"Number of Gauss Point must be equal to 1 for instance")) ;
291                 
292                 // init to null to prevent some error if not correctly allocated !
293                 ptrField = (FIELD_*)NULL ;
294                 ptrDriver = (GENDRIVER*)NULL ;
295
296                 switch ( type) {
297                 case MED_FR::MED_INT64 :
298                   if ( sizeof(MED_FR::med_int) != 8 )
299                     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) <<
300                                                      " The Field type of |"
301                                                      << fieldName                         <<"|, entity : |"
302                                                      << entNames [(MED_FR::med_entite_maillage)   (*currentEntity).first] <<"|, geometric element of type |" 
303                                                      << geoNames [(MED_FR::med_geometrie_element) (*currentGeometry) ]    <<
304                                                      "| is  MED_INT64 but size of med_int is not equal to 8 bytes !" 
305                                                      ) 
306                                           );
307                   break;
308                 case MED_FR::MED_INT32 : {
309 //                throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) <<
310 //                                                 "NOT IMPLEMENTED : BUG IN STL !")
311 //                                      ) ;
312                   // ptrField       =  new FIELD<MED_FR::med_int>   ( ptrSupport,numberOfComponents );   // Les valeurs du champ ne doivent pas être lue pour l'instant
313
314                   ptrField       =  new FIELD<MED_FR::med_int> ( );   // Les valeurs du champ ne doivent pas être lue pour l'instant
315                   ((FIELD<MED_FR::med_int>*) ptrField)->setSupport(ptrSupport);
316                   ((FIELD<MED_FR::med_int>*) ptrField)->setNumberOfComponents(numberOfComponents);
317                   ((FIELD<MED_FR::med_int>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
318                   MESSAGE("#### SET NAME in FIELD : "<<fieldName);
319                   ptrDriver      =  new MED_FIELD_RDWR_DRIVER<MED_FR::med_int> (_fileName, (FIELD<MED_FR::med_int> *) ptrField);
320                   break;
321                 }
322                 case MED_FR::MED_REEL64 : {
323                   //              ptrField       =  new FIELD<MED_FR::med_float> ( ptrSupport,numberOfComponents );   // Les valeurs du champ ne doivent pas être lue pour l'instant
324                   ptrField       =  new FIELD<MED_FR::med_float> ( );   // Les valeurs du champ ne doivent pas être lue pour l'instant
325                   ((FIELD<MED_FR::med_float>*) ptrField)->setSupport(ptrSupport);
326                   ((FIELD<MED_FR::med_float>*) ptrField)->setNumberOfComponents(numberOfComponents);
327                   ((FIELD<MED_FR::med_float>*) ptrField)->setName(fieldName) ; //provisoire, pour debug
328                   MESSAGE("#### SET NAME in FIELD : "<<fieldName);
329
330                   ptrDriver      =  new MED_FIELD_RDWR_DRIVER<MED_FR::med_float>(_fileName, (FIELD<MED_FR::med_float> *) ptrField);
331                   break;
332                 }
333                 default : {
334                   if ( numberOfTimeSteps > 1) 
335                     throw MED_EXCEPTION ( LOCALIZED( STRING(LOC) <<
336                                                      " The Field type of |"
337                                                      << fieldName                         <<"|, entity : |"
338                                                      << entNames [(MED_FR::med_entite_maillage)   (*currentEntity).first] 
339                                                      <<"|, geometric element of type |" 
340                                                      << geoNames [(MED_FR::med_geometrie_element) (*currentGeometry)]     
341                                                      <<"| is neither MED_INT, MED_INT32, MED_INT64 nor MED_REEL64 !" 
342                                                      ) 
343                                           );
344                   break ;
345                 }
346                 }
347                 ptrField->setValueType((MED_EN::med_type_champ) type) ; // need to write field !
348                 
349                 MESSAGE("timeStepNumber :"<<timeStepNumber<<",orderNumber :"<<orderNumber);
350                 ptrField->setIterationNumber ( timeStepNumber);      // A ajouter dans la classe FIELD
351                 ptrField->setOrderNumber     ( orderNumber); 
352                 ptrField->setTime     ( timeStep); 
353                 
354                 // Create a driver for this (field n°dt,n°it)
355
356                 MESSAGE("###### ptrDriver->setFieldName : #"<<fieldName<<"#");
357                 ptrDriver->setFieldName(fieldName);
358
359                 ptrField->addDriver(*ptrDriver);
360                 
361                 DT_IT_ dtIt;
362                 dtIt.dt  = timeStepNumber;
363                 dtIt.it  = orderNumber;
364                 
365                 (_fields  [fieldName])[dtIt] = ptrField;
366                 _meshName[ptrField ]       = meshName;
367               }
368             }
369           }
370       }
371       delete[] componentName ;
372       delete[] unitName ;
373     }
374   }
375   
376   // read profil count and their names
377   int support_count_= 0 ;
378   // il faut lire les champs pour avoir les profils stockes !!!
379   // il faudrait implémenter la lecture des profils dans med !!!
380   
381   END_OF(LOC);
382   
383 }
384
385 void MED_MED_DRIVER::read( void ) {
386
387   const char * LOC = "MED_MED_DRIVER::read() : ";
388  
389   BEGIN_OF(LOC);
390   MESSAGE("METHODE PAS ENCORE IMPLEMENTEE !!! ");
391   END_OF(LOC);
392 }
393
394 void MED_MED_DRIVER::writeFrom( void) const {
395   
396   const char * LOC = "MED_MED_DRIVER::writeFrom() : ";
397
398   BEGIN_OF(LOC);
399
400   const map<MESH_NAME_, MESH*> & _meshes = const_cast<const map<MESH_NAME_, MESH*>& > (_ptrMed->_meshes); 
401   map<MESH_NAME_,MESH*>::const_iterator  currentMesh;
402
403   const map<FIELD_ *, MESH_NAME_> & _meshName = const_cast<const map<FIELD_ *, MESH_NAME_>& > (_ptrMed->_meshName);
404   map<FIELD_ *, MESH_NAME_>::const_iterator currentField;
405   
406   for ( currentMesh=_meshes.begin();currentMesh != _meshes.end(); currentMesh++ ) {
407     try {
408       (*currentMesh).second->write(*this); 
409       // A CREER pour les objects MESH ET FIELD le write(GENDRIVER *) et le == ds GENDRIVER avec eventuellement 1 id 
410     }
411     catch ( const MED_DRIVER_NOT_FOUND_EXCEPTION & ex ) {
412       continue;
413     }
414     //     catch (const MED_EXCEPTION & ex) {
415     //       throw ex; // DOIT-ON CREER UNE NOUVELLE EXCEPTION AVEC UN MESSAGE INDIQUANT LA PILE 
416     //     }
417   }
418
419   for ( currentField=_meshName.begin();currentField != _meshName.end(); currentField++ ) {
420     try {
421       (*currentField).first->write(*this);
422     }
423     catch ( const MED_DRIVER_NOT_FOUND_EXCEPTION & ex ) {
424       continue;
425     }
426   }
427
428   END_OF(LOC);
429
430 }
431
432 void MED_MED_DRIVER::write(void ) const {
433   
434   const char * LOC = "MED_MED_DRIVER::write() : ";
435
436   BEGIN_OF(LOC);
437
438   // BCLE SUR LES DRIVERS AVEC APPELS WriteFrom
439   END_OF(LOC);
440
441 }
442
443 MED_MED_RDONLY_DRIVER::MED_MED_RDONLY_DRIVER(const string & fileName,  MED * const ptrMed):
444   MED_MED_DRIVER(fileName,ptrMed,MED_EN::MED_RDONLY)
445 {
446   MESSAGE("MED_MED_RDONLY_DRIVER::MED_MED_RDONLY_DRIVER(const string & fileName,  MED * const ptrMed) Constructeur read only");
447 }
448
449 void MED_MED_RDONLY_DRIVER::open() {
450   BEGIN_OF("MED_MED_RDONLY_DRIVER::open()");
451   MED_MED_DRIVER::open();
452   END_OF("MED_MED_RDONLY_DRIVER::open()");
453 }
454
455 void MED_MED_RDONLY_DRIVER::close() {
456   BEGIN_OF("MED_MED_RDONLY_DRIVER::close()");
457   MED_MED_DRIVER::close();
458   END_OF("MED_MED_RDONLY_DRIVER::clode()");
459 }
460
461 void MED_MED_RDONLY_DRIVER::read(void) {
462   BEGIN_OF("MED_MED_RDONLY_DRIVER::read(void)");
463   MED_MED_DRIVER::read();
464   END_OF("MED_MED_RDONLY_DRIVER::read(void)");
465 }
466
467 void MED_MED_RDONLY_DRIVER::readFileStruct(void)  {
468   BEGIN_OF("MED_MED_RDONLY_DRIVER::readFileStruct(void)");
469   MED_MED_DRIVER::readFileStruct();
470   END_OF("MED_MED_RDONLY_DRIVER::readFileStruct(void)");
471 }
472
473 MED_MED_WRONLY_DRIVER::MED_MED_WRONLY_DRIVER(const string & fileName,  MED * const ptrMed):
474   MED_MED_DRIVER(fileName,ptrMed)
475 {}
476
477 void MED_MED_WRONLY_DRIVER::open() {
478   BEGIN_OF("MED_MED_WRONLY_DRIVER::open()");
479   MED_MED_DRIVER::open();
480   END_OF("MED_MED_WRONLY_DRIVER::open()");
481 }
482
483 void MED_MED_WRONLY_DRIVER::close() {
484   BEGIN_OF("MED_MED_WRONLY_DRIVER::close()");
485   MED_MED_DRIVER::close();
486   END_OF("MED_MED_WRONLY_DRIVER::clode()");
487 }
488
489 void MED_MED_WRONLY_DRIVER::write(void) const {
490   BEGIN_OF("MED_MED_WRONLY_DRIVER::write(void) const");
491   MED_MED_DRIVER::write();
492   END_OF("MED_MED_WRONLY_DRIVER::write(void) const");
493 }
494
495 void MED_MED_WRONLY_DRIVER::writeFrom(void) const {
496   BEGIN_OF("MED_MED_WRONLY_DRIVER::writeFrom(void) const");
497   MED_MED_DRIVER::writeFrom();
498   END_OF("MED_MED_WRONLY_DRIVER::writeFrom(void) const");
499 }
500
501 MED_MED_RDWR_DRIVER::MED_MED_RDWR_DRIVER(const string & fileName,  MED * const ptrMed):
502   MED_MED_DRIVER(fileName,ptrMed)
503 {}
504
505 void MED_MED_RDWR_DRIVER::open() {
506   BEGIN_OF("MED_MED_RDWR_DRIVER::open()");
507   MED_MED_DRIVER::open();
508   END_OF("MED_MED_RDWR_DRIVER::open()");
509 }
510
511 void MED_MED_RDWR_DRIVER::close() {
512   BEGIN_OF("MED_MED_RDWR_DRIVER::close()");
513   MED_MED_DRIVER::close();
514   END_OF("MED_MED_RDWR_DRIVER::clode()");
515 }
516
517 void MED_MED_RDWR_DRIVER::read(void) {
518   BEGIN_OF("MED_MED_RDWR_DRIVER::read(void)");
519   MED_MED_RDONLY_DRIVER::read();
520   END_OF("MED_MED_RDWR_DRIVER::read(void)");
521 }
522
523 void MED_MED_RDWR_DRIVER::readFileStruct(void) {
524   BEGIN_OF("MED_MED_RDWR_DRIVER::readFileStruct(void)");
525   MED_MED_RDONLY_DRIVER::readFileStruct();
526   END_OF("MED_MED_RDWR_DRIVER::readFileStruct(void)");
527 }
528
529 void MED_MED_RDWR_DRIVER::write(void) const {
530   BEGIN_OF("MED_MED_RDWR_DRIVER::write(void) const");
531   MED_MED_WRONLY_DRIVER::write();
532   END_OF("MED_MED_RDWR_DRIVER::write(void) const");
533 }
534
535 void MED_MED_RDWR_DRIVER::writeFrom(void) const {
536   BEGIN_OF("MED_MED_RDWR_DRIVER::writeFrom(void) const");
537   MED_MED_WRONLY_DRIVER::writeFrom();
538   END_OF("MED_MED_RDWR_DRIVER::writeFrom(void) const");
539 }