Back to index

salome-med  6.5.0
MEDMEM_TypeMeshDriver.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #ifndef TYPE_MESH_DRIVER_HXX
00024 #define TYPE_MESH_DRIVER_HXX
00025 
00026 #include "MEDMEM.hxx"
00027 
00028 #include <string>
00029 #include <vector>
00030 
00031 #include "MEDMEM_define.hxx"
00032 #include "MEDMEM_GenDriver.hxx"
00033 
00034 #include "MEDMEM_STRING.hxx"
00035 #include "MEDMEM_Exception.hxx"
00036 #include "MEDMEM_Utilities.hxx"
00037 
00047 namespace MEDMEM {
00048 class MESH;
00049 class FAMILY;
00050 class GROUP;
00051 class CONNECTIVITY;
00052 class MEDMEM_EXPORT TYPE_MESH_DRIVER : public GENDRIVER
00053 {
00054 protected:
00055   
00056   MESH *          _ptrMesh;
00057   // A VOIR FILE DESCRIPTEUR ? MED_FR::med_idt _medIdt;
00058   string          _meshName;    
00059   
00060 public :
00061 
00065   TYPE_MESH_DRIVER() ;
00069   TYPE_MESH_DRIVER(const std::string & fileName,  
00070                   MESH * ptrMesh, 
00071                   med_mode_acces accessMode) ;
00075   TYPE_MESH_DRIVER(const TYPE_MESH_DRIVER & driver) ;
00076 
00080   virtual ~TYPE_MESH_DRIVER() ;
00081 
00082   void open() throw (MEDEXCEPTION);
00083   void close() throw (MEDEXCEPTION);
00084 
00085   virtual void write( void ) const = 0 ;
00086   virtual void read ( void ) = 0 ;
00087 
00093   void   setMeshName(const string & meshName) ;
00097   string getMeshName() const ;
00098 
00099 private:
00100   virtual GENDRIVER * copy ( void ) const = 0 ;
00101 
00102 };
00103 
00104 
00105 class MEDMEM_EXPORT TYPE_MESH_RDONLY_DRIVER : public virtual TYPE_MESH_DRIVER
00106 {
00107  
00108 public :
00109   
00113   TYPE_MESH_RDONLY_DRIVER() ;
00117   TYPE_MESH_RDONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
00121   TYPE_MESH_RDONLY_DRIVER(const TYPE_MESH_RDONLY_DRIVER & driver) ;
00122 
00126   virtual ~TYPE_MESH_RDONLY_DRIVER() ;
00127   
00131   void write( void ) const throw (MEDEXCEPTION);
00135   void read ( void ) throw (MEDEXCEPTION);
00136 
00137 private:
00138  
00139   GENDRIVER * copy ( void ) const ;
00140 
00141 };
00142 
00151 class MEDMEM_EXPORT TYPE_MESH_WRONLY_DRIVER : public virtual TYPE_MESH_DRIVER {
00152   
00153 public :
00154   
00158   TYPE_MESH_WRONLY_DRIVER() ;
00162   TYPE_MESH_WRONLY_DRIVER(const string & fileName, MESH * ptrMesh) ;
00166   TYPE_MESH_WRONLY_DRIVER(const TYPE_MESH_WRONLY_DRIVER & driver) ;
00167 
00171   virtual ~TYPE_MESH_WRONLY_DRIVER() ;
00172 
00176   void write( void ) const throw (MEDEXCEPTION);
00180   void read ( void ) throw (MEDEXCEPTION);
00181 
00182 private:
00183 
00184   GENDRIVER * copy ( void ) const ;
00185 };
00186 
00187 
00196 class MEDMEM_EXPORT TYPE_MESH_RDWR_DRIVER : public TYPE_MESH_RDONLY_DRIVER, public TYPE_MESH_WRONLY_DRIVER {
00197 
00198 public :
00199 
00203   TYPE_MESH_RDWR_DRIVER() ;
00207   TYPE_MESH_RDWR_DRIVER(const string & fileName, MESH * ptrMesh) ;
00211   TYPE_MESH_RDWR_DRIVER(const TYPE_MESH_RDWR_DRIVER & driver) ;
00212 
00216   ~TYPE_MESH_RDWR_DRIVER() ;
00217 
00221   void write(void) const throw (MEDEXCEPTION);
00225   void read (void) throw (MEDEXCEPTION);
00226 
00227 private:
00228   GENDRIVER * copy(void) const ;
00229 
00230 };
00231 };
00232 
00233 
00234 #endif /* TYPE_MESH_DRIVER_HXX */