1 // MED MEDMEM : MED files in memory
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : MEDMEM_GenDriver.hxx
32 #include "MEDMEM_define.hxx"
33 #include "utilities.h"
35 /* Generic Read/Write Driver Class for Meshes & Fields */
37 /* Modify the following line to add a new driver type (step 1) */
38 typedef enum { MED_DRIVER = 0, GIBI_DRIVER = 1, VTK_DRIVER = 254, NO_DRIVER = 255 } driverTypes;
40 using namespace MED_EN;
45 Virtual class GENDRIVER use by all driver.
53 int _id; // MED_INVALID : if the driver hasn't been created by a MedMedDriver
54 // the MedMedDriver index of the driver vector in the MED object where it has been created
56 string _fileName; // The name of the file currently in use.
57 med_mode_acces _accessMode; // The file access mode set by the adequate construtor.
58 int _status; // The file status {MED_INVALID, MED_OPENED, MED_CLOSED }
59 driverTypes _driverType; // A FAIRE LE POSITIONNER DS TOUTES LES SS CLASSES !!
69 GENDRIVER(const string & fileName,med_mode_acces accessMode);
73 GENDRIVER(const GENDRIVER & genDriver);
81 Operator = : duplicate the given genDriver.
83 GENDRIVER & operator=(const GENDRIVER & genDriver);
86 Operator << : put GENDRIVER object information to the given stream
88 friend ostream & operator<<(ostream &os,const GENDRIVER &genDriver);
90 bool operator ==(const GENDRIVER &genDriver) const;
94 virtual void open ( void ) = 0;
98 virtual void close( void ) = 0;
100 Write object in opened file.
102 virtual void write( void ) const = 0;
104 Read object in opened file.
106 virtual void read ( void ) = 0;
108 // needed to duplicate arrays
109 virtual GENDRIVER * copy ( void ) const = 0 ;
112 virtual void writeFrom ( void );
113 virtual void readFileStruct ( void );
115 virtual void setMeshName ( const string & meshName);
116 // FIELD related Part
117 virtual void setFieldName ( const string & fieldName);
119 void setId ( int id = MED_INVALID );
120 int getId ( void ) const ;
121 string getFileName () const;
122 void setFileName ( const string & fileName);
123 med_mode_acces getAccessMode() const;
128 #endif /* GENDRIVER_HXX */