Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / MEDWrapper / MED_Wrapper.hxx
index 159d4571492d39653f7585b783176976441b3263..4cb816e9a0bb7bdb3292f707e60411276a7ecee9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -32,8 +32,8 @@
 namespace MED
 {
   //----------------------------------------------------------------------------
-  class TFile;
-  typedef boost::shared_ptr<TFile> PFile;
+  class TFileInternal;
+  typedef std::shared_ptr<TFileInternal> PFileInternal;
 
   typedef enum {eLECTURE, eLECTURE_ECRITURE, eLECTURE_AJOUT, eCREATION} EModeAcces;
 
@@ -52,7 +52,7 @@ namespace MED
     TWrapper& operator=(const TWrapper&);
 
   public:
-    TWrapper(const std::string& theFileName, TInt theVersion=-1);
+    TWrapper(const std::string& theFileName, bool write, TFileInternal *tfileInst = nullptr, TInt theMajor=-1, TInt theVersion=-1);
 
     virtual
     ~TWrapper();
@@ -279,7 +279,7 @@ namespace MED
                EModeSwitch theMode = eFULL_INTERLACE,
                ERepere theSystem = eCART,
                EBooleen theIsElemNum = eVRAI,
-               EBooleen theIsElemNames = eVRAI);
+               EBooleen theIsElemNames = eFAUX);
 
     //! Create a MEDWrapper MED Nodes representation
     virtual
@@ -521,7 +521,7 @@ namespace MED
                TInt theNbElem,
                EConnectivite theConnMode = eNOD,
                EBooleen theIsElemNum = eVRAI,
-               EBooleen theIsElemNames = eVRAI,
+               EBooleen theIsElemNames = eFAUX,
                EModeSwitch theMode = eFULL_INTERLACE);
 
     //! Create a MEDWrapper MED Cells representation
@@ -938,7 +938,8 @@ namespace MED
                     TErr* theErr = NULL);
 
   protected:
-    PFile myFile;
+    PFileInternal myFile;
+    TInt myMajor;
     TInt myMinor;
   };
 
@@ -962,23 +963,23 @@ namespace MED
   //----------------------------------------------------------------------------
   //! Specialization of SharedPtr for TWrapper
   template<>
-  class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public boost::shared_ptr<TWrapper>
+  class MEDWRAPPER_EXPORT SharedPtr<TWrapper>: public std::shared_ptr<TWrapper>
   {
   public:
     SharedPtr() {}
 
     SharedPtr(TWrapper* p):
-      boost::shared_ptr<TWrapper>(p)
+      std::shared_ptr<TWrapper>(p)
     {}
 
     template<class Y>
     explicit SharedPtr(Y* p):
-      boost::shared_ptr<TWrapper>(p)
+      std::shared_ptr<TWrapper>(p)
     {}
 
     template<class Y>
     SharedPtr(const SharedPtr<Y>& r):
-      boost::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
+      std::shared_ptr<TWrapper>(boost::dynamic_pointer_cast<TWrapper,Y>(r))
     {}
 
     template<class Y>
@@ -1020,7 +1021,7 @@ namespace MED
     TWrapper*
     get() const // never throws
     {
-      return boost::shared_ptr<TWrapper>::get();
+      return std::shared_ptr<TWrapper>::get();
     }
   };
 }