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