6 #include "MEDMEM_define.hxx"
9 /* Generic Read/Write Driver Class for Meshes & Fields */
12 using namespace MED_EN;
17 Virtual class GENDRIVER use by all driver.
22 /* Modify the following line to add a new driver type (step 1) */
23 typedef enum { MED_DRIVER = 0, GIBI_DRIVER = 1, PORFLOW_DRIVER = 2, VTK_DRIVER = 254, NO_DRIVER = 255 } driverTypes;
28 int _id; // MED_INVALID : if the driver hasn't been created by a MedMedDriver
29 // the MedMedDriver index of the driver vector in the MED object where it has been created
31 string _fileName; // The name of the file currently in use.
32 med_mode_acces _accessMode; // The file access mode set by the adequate construtor.
33 int _status; // The file status {MED_INVALID, MED_OPENED, MED_CLOSED }
34 driverTypes _driverType; // A FAIRE LE POSITIONNER DS TOUTES LES SS CLASSES !!
45 GENDRIVER(const string & fileName,med_mode_acces accessMode);
49 GENDRIVER(const GENDRIVER & genDriver);
57 Operator = : duplicate the given genDriver.
59 GENDRIVER & operator=(const GENDRIVER & genDriver);
62 Operator << : put GENDRIVER object information to the given stream
64 friend ostream & operator<<(ostream &os,const GENDRIVER &genDriver);
66 bool operator ==(const GENDRIVER &genDriver) const;
70 virtual void open ( void ) = 0;
72 Open file with the append option. This method is used especially
73 on ASCII drivers (e.g. VTK_DRIVER).
75 virtual void openAppend ( void );
79 virtual void close( void ) = 0;
81 Write object in opened file.
83 virtual void write( void ) const = 0;
85 Write object in opened file. This method is used especially
86 on ASCII drivers (e.g. VTK_DRIVER).
88 virtual void writeAppend( void ) const;
90 Read object in opened file.
92 virtual void read ( void ) = 0;
94 // needed to duplicate arrays
95 virtual GENDRIVER * copy ( void ) const = 0 ;
98 virtual void writeFrom ( void );
99 virtual void readFileStruct ( void );
101 virtual void setMeshName ( const string & meshName);
102 // FIELD related Part
103 virtual void setFieldName ( const string & fieldName);
105 void setId ( int id = MED_INVALID );
106 int getId ( void ) const ;
107 string getFileName () const;
108 void setFileName ( const string & fileName);
109 med_mode_acces getAccessMode() const;
114 #endif /* GENDRIVER_HXX */