6 #include "MEDMEM_define.hxx"
9 /* Generic Read/Write Driver Class for Meshes & Fields */
11 /* Modify the following line to add a new driver type (step 1) */
12 typedef enum { MED_DRIVER = 0, GIBI_DRIVER = 1, VTK_DRIVER = 254, NO_DRIVER = 255 } driverTypes;
14 using namespace MED_EN;
19 Virtual class GENDRIVER use by all driver.
27 int _id; // MED_INVALID : if the driver hasn't been created by a MedMedDriver
28 // the MedMedDriver index of the driver vector in the MED object where it has been created
30 string _fileName; // The name of the file currently in use.
31 med_mode_acces _accessMode; // The file access mode set by the adequate construtor.
32 int _status; // The file status {MED_INVALID, MED_OPENED, MED_CLOSED }
33 driverTypes _driverType; // A FAIRE LE POSITIONNER DS TOUTES LES SS CLASSES !!
44 GENDRIVER(const string & fileName,med_mode_acces accessMode);
48 GENDRIVER(const GENDRIVER & genDriver);
56 Operator = : duplicate the given genDriver.
58 GENDRIVER & operator=(const GENDRIVER & genDriver);
61 Operator << : put GENDRIVER object information to the given stream
63 friend ostream & operator<<(ostream &os,const GENDRIVER &genDriver);
65 bool operator ==(const GENDRIVER &genDriver) const;
69 virtual void open ( void ) = 0;
71 Open file with the append option. This method is used especially
72 on ASCII drivers (e.g. VTK_DRIVER).
74 virtual void openAppend ( void );
78 virtual void close( void ) = 0;
80 Write object in opened file.
82 virtual void write( void ) const = 0;
84 Write object in opened file. This method is used especially
85 on ASCII drivers (e.g. VTK_DRIVER).
87 virtual void writeAppend( void ) const;
89 Read object in opened file.
91 virtual void read ( void ) = 0;
93 // needed to duplicate arrays
94 virtual GENDRIVER * copy ( void ) const = 0 ;
97 virtual void writeFrom ( void );
98 virtual void readFileStruct ( void );
100 virtual void setMeshName ( const string & meshName);
101 // FIELD related Part
102 virtual void setFieldName ( const string & fieldName);
104 void setId ( int id = MED_INVALID );
105 int getId ( void ) const ;
106 string getFileName () const;
107 void setFileName ( const string & fileName);
108 med_mode_acces getAccessMode() const;
112 #endif /* GENDRIVER_HXX */