Salome HOME
useful methods again
[tools/medcoupling.git] / src / MEDLoader / MEDFileData.cxx
index ffac18050287b8f4c3e38a2ce9fa851e089f98cb..96e77a72cd4b1b49f3b4a8383cdd0d7b34719c88 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,7 @@
 
 #include "MEDFileData.hxx"
 
-using namespace ParaMEDMEM;
+using namespace MEDCoupling;
 
 MEDFileData *MEDFileData::New(const std::string& fileName)
 {
@@ -32,18 +32,18 @@ MEDFileData *MEDFileData::New()
   return new MEDFileData;
 }
 
-MEDFileData *MEDFileData::deepCpy() const
+MEDFileData *MEDFileData::deepCopy() const
 {
-  MEDCouplingAutoRefCountObjectPtr<MEDFileFields> fields;
+  MCAuto<MEDFileFields> fields;
   if((const MEDFileFields *)_fields)
-    fields=_fields->deepCpy();
-  MEDCouplingAutoRefCountObjectPtr<MEDFileMeshes> meshes;
+    fields=_fields->deepCopy();
+  MCAuto<MEDFileMeshes> meshes;
   if((const MEDFileMeshes *)_meshes)
-    meshes=_meshes->deepCpy();
-  MEDCouplingAutoRefCountObjectPtr<MEDFileParameters> params;
+    meshes=_meshes->deepCopy();
+  MCAuto<MEDFileParameters> params;
   if((const MEDFileParameters *)_params)
-    params=_params->deepCpy();
-  MEDCouplingAutoRefCountObjectPtr<MEDFileData> ret=MEDFileData::New();
+    params=_params->deepCopy();
+  MCAuto<MEDFileData> ret(MEDFileData::New());
   ret->_fields=fields; ret->_meshes=meshes; ret->_params=params;
   return ret.retn();
 }
@@ -53,15 +53,12 @@ std::size_t MEDFileData::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDFileData::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileData::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if((const MEDFileFields *)_fields)
-    ret.push_back((const MEDFileFields *)_fields);
-  if((const MEDFileMeshes *)_meshes)
-    ret.push_back((const MEDFileMeshes *)_meshes);
-  if((const MEDFileParameters *)_params)
-    ret.push_back((const MEDFileParameters *)_params);
+  ret.push_back((const MEDFileFields *)_fields);
+  ret.push_back((const MEDFileMeshes *)_meshes);
+  ret.push_back((const MEDFileParameters *)_params);
   return ret;
 
 }
@@ -195,7 +192,7 @@ bool MEDFileData::unPolyzeMeshes()
   std::vector< MEDFileMesh * > meshesImpacted;
   std::vector< DataArrayInt * > renumParamsOfMeshImpacted;//same size as meshesImpacted
   std::vector< std::vector<int> > oldCodeOfMeshImpacted,newCodeOfMeshImpacted;//same size as meshesImpacted
-  std::vector<MEDCouplingAutoRefCountObjectPtr<DataArrayInt> > memSaverIfThrow;//same size as meshesImpacted
+  std::vector<MCAuto<DataArrayInt> > memSaverIfThrow;//same size as meshesImpacted
   for(int i=0;i<ms->getNumberOfMeshes();i++)
     {
       MEDFileMesh *m=ms->getMeshAtPos(i);