Salome HOME
Modification of the getHeapMemorySize computation.
[modules/med.git] / src / MEDCoupling / MEDCouplingMultiFields.cxx
index 5aab55dd399e3fadd375cdcf11649b5f68e80fde..436ab8d20c53ff213b8c9e5f7062cdfbd0141b88 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013  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
@@ -128,7 +128,7 @@ std::string MEDCouplingMultiFields::simpleRepr() const
       ms=getDifferentMeshes(refms);
       ret << ms.size() << "\n";
     }
-  catch(INTERP_KERNEL::Exception& e)
+  catch(INTERP_KERNEL::Exception& /*e*/)
     { ret << "Current instance is INVALID !\n"; }
   return ret.str();
 }
@@ -190,19 +190,20 @@ void MEDCouplingMultiFields::updateTime() const
       updateTimeWith(*(*it));
 }
 
-std::size_t MEDCouplingMultiFields::getHeapMemorySize() const
+std::size_t MEDCouplingMultiFields::getHeapMemorySizeWithoutChildren() const
 {
-  std::vector<int> tmp;
-  std::vector< std::vector<int> > tmp2;
-  std::vector<MEDCouplingMesh *> ms=getDifferentMeshes(tmp);
-  std::vector<DataArrayDouble *> arrs=getDifferentArrays(tmp2);
-  std::size_t ret=0;
-  for(std::vector<MEDCouplingMesh *>::const_iterator it=ms.begin();it!=ms.end();it++)
-    if(*it)
-      ret+=(*it)->getHeapMemorySize();
-  for(std::vector<DataArrayDouble *>::const_iterator it=arrs.begin();it!=arrs.end();it++)
-    if(*it)
-      ret+=(*it)->getHeapMemorySize();
+  return 0;
+}
+
+std::vector<RefCountObject *> MEDCouplingMultiFields::getDirectChildren() const
+{
+  std::vector<RefCountObject *> ret;
+  for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
+    {
+      const MEDCouplingFieldDouble *curF(*it);
+      if(curF)
+        ret.push_back(const_cast<MEDCouplingFieldDouble *>(curF));
+    }
   return ret;
 }