Salome HOME
Little refactoring of progeny mechanism to avoid if.
authorAnthony Geay <anthony.geay@edf.fr>
Tue, 22 Jul 2014 08:33:45 +0000 (10:33 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Tue, 22 Jul 2014 08:33:45 +0000 (10:33 +0200)
59 files changed:
src/MEDCalculator/MEDCalculatorDBField.cxx
src/MEDCalculator/MEDCalculatorDBField.hxx
src/MEDCalculator/MEDCalculatorDBSliceField.cxx
src/MEDCalculator/MEDCalculatorDBSliceField.hxx
src/MEDCoupling/MEDCoupling1GTUMesh.cxx
src/MEDCoupling/MEDCoupling1GTUMesh.hxx
src/MEDCoupling/MEDCouplingAMRAttribute.cxx
src/MEDCoupling/MEDCouplingAMRAttribute.hxx
src/MEDCoupling/MEDCouplingCMesh.cxx
src/MEDCoupling/MEDCouplingCMesh.hxx
src/MEDCoupling/MEDCouplingCartesianAMRMesh.cxx
src/MEDCoupling/MEDCouplingCartesianAMRMesh.hxx
src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx
src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx
src/MEDCoupling/MEDCouplingDefinitionTime.cxx
src/MEDCoupling/MEDCouplingDefinitionTime.hxx
src/MEDCoupling/MEDCouplingExtrudedMesh.cxx
src/MEDCoupling/MEDCouplingExtrudedMesh.hxx
src/MEDCoupling/MEDCouplingField.cxx
src/MEDCoupling/MEDCouplingField.hxx
src/MEDCoupling/MEDCouplingFieldDiscretization.cxx
src/MEDCoupling/MEDCouplingFieldDiscretization.hxx
src/MEDCoupling/MEDCouplingFieldDouble.cxx
src/MEDCoupling/MEDCouplingFieldDouble.hxx
src/MEDCoupling/MEDCouplingIMesh.cxx
src/MEDCoupling/MEDCouplingIMesh.hxx
src/MEDCoupling/MEDCouplingMatrix.cxx
src/MEDCoupling/MEDCouplingMatrix.hxx
src/MEDCoupling/MEDCouplingMemArray.cxx
src/MEDCoupling/MEDCouplingMemArray.hxx
src/MEDCoupling/MEDCouplingMultiFields.cxx
src/MEDCoupling/MEDCouplingMultiFields.hxx
src/MEDCoupling/MEDCouplingPointSet.cxx
src/MEDCoupling/MEDCouplingPointSet.hxx
src/MEDCoupling/MEDCouplingRefCountObject.cxx
src/MEDCoupling/MEDCouplingRefCountObject.hxx
src/MEDCoupling/MEDCouplingTimeDiscretization.cxx
src/MEDCoupling/MEDCouplingTimeDiscretization.hxx
src/MEDCoupling/MEDCouplingUMesh.cxx
src/MEDCoupling/MEDCouplingUMesh.hxx
src/MEDLoader/MEDFileData.cxx
src/MEDLoader/MEDFileData.hxx
src/MEDLoader/MEDFileField.cxx
src/MEDLoader/MEDFileField.hxx
src/MEDLoader/MEDFileFieldOverView.cxx
src/MEDLoader/MEDFileFieldOverView.hxx
src/MEDLoader/MEDFileMesh.cxx
src/MEDLoader/MEDFileMesh.hxx
src/MEDLoader/MEDFileMeshElt.cxx
src/MEDLoader/MEDFileMeshElt.hxx
src/MEDLoader/MEDFileMeshLL.cxx
src/MEDLoader/MEDFileMeshLL.hxx
src/MEDLoader/MEDFileParameter.cxx
src/MEDLoader/MEDFileParameter.hxx
src/MEDLoader/SauvReader.cxx
src/MEDLoader/SauvReader.hxx
src/MEDLoader/SauvUtilities.hxx
src/MEDLoader/SauvWriter.cxx
src/MEDLoader/SauvWriter.hxx

index 0f848e7239ea668a851f9b8ad76a2f74ef53b5b0..32fa3210a71ca546a05304818fc4cf229f6d8924 100644 (file)
@@ -51,7 +51,7 @@ std::size_t MEDCalculatorDBField::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDCalculatorDBField::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCalculatorDBField::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
index f079c88c9c6a492323096d2a07a6681f1977c7d9..ca7dc78fe432affb4bd9dde3b96eab5df23fee00 100644 (file)
@@ -46,7 +46,7 @@ namespace ParaMEDMEM
     static MEDCalculatorDBFieldReal *New(const MEDCalculatorBrowserField& ls);
     static MEDCalculatorDBFieldCst *New(double val);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     virtual MEDCalculatorDBField *operator+(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0;
     MEDCalculatorDBField *operator+(double val) const throw(INTERP_KERNEL::Exception);
     virtual MEDCalculatorDBField *operator-(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0;
index 5311ac41442984fdbab7dce6fd1104680d9ab54d..1159e03fc8f92e4e885431e09cc155372d99b4f0 100644 (file)
@@ -41,7 +41,7 @@ std::size_t MEDCalculatorDBSliceField::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDCalculatorDBSliceField::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCalculatorDBSliceField::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
index 4dbbcd2db9eb8e5dd4b79c167297d884f7a9f601..02df8a548b0d5a4c156843ef5588183fe2623d76 100644 (file)
@@ -41,7 +41,7 @@ namespace ParaMEDMEM
     MEDCalculatorDBSliceField(int iter, int order);
     MEDCalculatorDBSliceField(MEDCouplingFieldDouble *f);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     bool isFetched() const { return _field!=0; }
     void getDtIt(int& it, int& order) const { it=_iteration;  order=_order; }
     void setField(MEDCouplingFieldDouble *f) const;
index d4bd0aadd590b67b9af92df56616918af66b0d89..ec244e6c427a7cb5163f8546e9c73f85ce35b48e 100644 (file)
@@ -583,12 +583,10 @@ std::size_t MEDCoupling1SGTUMesh::getHeapMemorySizeWithoutChildren() const
   return MEDCoupling1GTUMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCoupling1SGTUMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCoupling1SGTUMesh::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDCoupling1GTUMesh::getDirectChildren());
-  const DataArrayInt *c(_conn);
-  if(c)
-    ret.push_back(c);
+  std::vector<const BigMemoryObject *> ret(MEDCoupling1GTUMesh::getDirectChildrenWithNull());
+  ret.push_back((const DataArrayInt *)_conn);
   return ret;
 }
 
@@ -2131,15 +2129,11 @@ std::size_t MEDCoupling1DGTUMesh::getHeapMemorySizeWithoutChildren() const
   return MEDCoupling1GTUMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCoupling1DGTUMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCoupling1DGTUMesh::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDCoupling1GTUMesh::getDirectChildren());
-  const DataArrayInt *c(_conn);
-  if(c)
-    ret.push_back(c);
-  c=_conn_indx;
-  if(c)
-    ret.push_back(c);
+  std::vector<const BigMemoryObject *> ret(MEDCoupling1GTUMesh::getDirectChildrenWithNull());
+  ret.push_back((const DataArrayInt *)_conn);
+  ret.push_back((const DataArrayInt *)_conn_indx);
   return ret;
 }
 
index 674d9bcf49a9869c855b7b9e005c8d03d011bce0..4637c1146cb88650b86a10a6fe08d94631c34338 100644 (file)
@@ -96,7 +96,7 @@ namespace ParaMEDMEM
     // overload of TimeLabel and RefCountObject
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     // overload of MEDCouplingMesh
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED; }
     MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
@@ -186,7 +186,7 @@ namespace ParaMEDMEM
     // overload of TimeLabel and RefCountObject
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     // overload of MEDCouplingMesh
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED; }
     MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
index 7f8b5298f6cbcfbc11903e79643cd36631b8bf64..96ed62922bbbcb02663cfe9a5dd90595b6d8e180 100644 (file)
@@ -329,15 +329,11 @@ std::size_t DataArrayDoubleCollection::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> DataArrayDoubleCollection::getDirectChildren() const
+std::vector<const BigMemoryObject *> DataArrayDoubleCollection::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< std::pair< MEDCouplingAutoRefCountObjectPtr<DataArrayDouble>, NatureOfField > >::const_iterator it=_arrs.begin();it!=_arrs.end();it++)
-    {
-      const DataArrayDouble *pt((*it).first);
-      if(pt)
-        ret.push_back(pt);
-    }
+    ret.push_back((const DataArrayDouble *)(*it).first);
   return ret;
 }
 
@@ -710,15 +706,11 @@ std::size_t MEDCouplingGridCollection::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingGridCollection::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingGridCollection::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > >::const_iterator it=_map_of_dadc.begin();it!=_map_of_dadc.end();it++)
-    {
-      const DataArrayDoubleCollection *col((*it).second);
-      if(col)
-        ret.push_back(col);
-    }
+    ret.push_back((const DataArrayDoubleCollection *)(*it).second);
   return ret;
 }
 
@@ -1397,15 +1389,11 @@ std::size_t MEDCouplingAMRAttribute::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingAMRAttribute::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingAMRAttribute::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingGridCollection> >::const_iterator it=_levs.begin();it!=_levs.end();it++)
-    {
-      const MEDCouplingGridCollection *elt(*it);
-      if(elt)
-        ret.push_back(elt);
-    }
+    ret.push_back((const MEDCouplingGridCollection *)*it);
   return ret;
 }
 
index 37857698a75a4624f3c4751130c4647ae5324317..afdf2e63d0006cfd27d4998cf6e6da2b83ffc46b 100644 (file)
@@ -57,7 +57,7 @@ namespace ParaMEDMEM
     DataArrayDoubleCollection(const std::vector< std::pair<std::string,int> >& fieldNames);
     DataArrayDoubleCollection(const DataArrayDoubleCollection& other);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     void updateTime() const;
     static void CheckDiscriminantNames(const std::vector<std::string>& names);
     static bool IsConservativeNature(NatureOfField n);
@@ -93,7 +93,7 @@ namespace ParaMEDMEM
     MEDCouplingGridCollection(const std::vector<const MEDCouplingCartesianAMRMeshGen *>& ms, const std::vector< std::pair<std::string,int> >& fieldNames);
     MEDCouplingGridCollection(const MEDCouplingGridCollection& other, const MEDCouplingCartesianAMRMeshGen *newGf, const MEDCouplingCartesianAMRMeshGen *oldGf);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     void updateTime() const;
   private:
     std::vector< std::pair<const MEDCouplingCartesianAMRMeshGen *,MEDCouplingAutoRefCountObjectPtr<DataArrayDoubleCollection> > > _map_of_dadc;
@@ -162,7 +162,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT bool changeGodFather(MEDCouplingCartesianAMRMesh *gf);
     //
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void updateTime() const;
   private:
     MEDCouplingAMRAttribute(MEDCouplingCartesianAMRMesh *gf, const std::vector< std::pair<std::string,int> >& fieldNames, int ghostLev);
index 20343e55c67855acf03d4842d5b0eafb822145b8..5e7577bcef66deeee73b3071cb89bb780518cb98 100644 (file)
@@ -111,15 +111,12 @@ std::size_t MEDCouplingCMesh::getHeapMemorySizeWithoutChildren() const
   return MEDCouplingStructuredMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingCMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingCMesh::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if(_x_array)
-    ret.push_back(_x_array);
-  if(_y_array)
-    ret.push_back(_y_array);
-  if(_z_array)
-    ret.push_back(_z_array);
+  ret.push_back(_x_array);
+  ret.push_back(_y_array);
+  ret.push_back(_z_array);
   return ret;
 }
 
index ed587c3b252c224c4cb1eacac9c062465bc1d980..326b1835eaf3c4b8e3708278fa7267a850826a07 100644 (file)
@@ -35,7 +35,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT MEDCouplingCMesh *clone(bool recDeepCpy) const;
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return CARTESIAN; }
     MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
index 84a89c51699bfabd1e20b96d9db5fd566b7c4599..84042e03782b5102d534d309d500621bc7e33f76 100644 (file)
@@ -78,11 +78,10 @@ MEDCouplingCartesianAMRMeshGen *MEDCouplingCartesianAMRPatchGen::getMeshSafe()
     return mesh;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRPatchGen::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRPatchGen::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if((const MEDCouplingCartesianAMRMeshGen *)_mesh)
-    ret.push_back((const MEDCouplingCartesianAMRMeshGen *)_mesh);
+  ret.push_back((const MEDCouplingCartesianAMRMeshGen *)_mesh);
   return ret;
 }
 
@@ -1706,16 +1705,12 @@ std::size_t MEDCouplingCartesianAMRMeshGen::getHeapMemorySizeWithoutChildren() c
   return sizeof(MEDCouplingCartesianAMRMeshGen);
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRMeshGen::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRMeshGen::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if((const MEDCouplingIMesh *)_mesh)
-    ret.push_back((const MEDCouplingIMesh *)_mesh);
+  ret.push_back((const MEDCouplingIMesh *)_mesh);
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRPatch> >::const_iterator it=_patches.begin();it!=_patches.end();it++)
-    {
-      if((const MEDCouplingCartesianAMRPatch*)*it)
-        ret.push_back((const MEDCouplingCartesianAMRPatch*)*it);
-    }
+    ret.push_back((const MEDCouplingCartesianAMRPatch*)*it);
   return ret;
 }
 
@@ -1972,9 +1967,9 @@ MEDCouplingCartesianAMRMesh::MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh)
 {
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingCartesianAMRMesh::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDCouplingCartesianAMRMeshGen::getDirectChildren());
+  std::vector<const BigMemoryObject *> ret(MEDCouplingCartesianAMRMeshGen::getDirectChildrenWithNull());
   return ret;
 }
 
index bee12ea855b402899c0f3a4e211624dca307addb..52d1747e5cf914989c811f1a96465e34b3c34190 100644 (file)
@@ -60,7 +60,7 @@ namespace ParaMEDMEM
     const MEDCouplingCartesianAMRMeshGen *getMeshSafe() const;
     MEDCouplingCartesianAMRMeshGen *getMeshSafe();
   private:
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
   protected:
     MEDCouplingAutoRefCountObjectPtr<MEDCouplingCartesianAMRMeshGen> _mesh;
   };
@@ -202,7 +202,7 @@ namespace ParaMEDMEM
     virtual void getPositionRelativeToInternal(const MEDCouplingCartesianAMRMeshGen *ref, std::vector<int>& ret) const = 0;
   protected:
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void updateTime() const;
   protected:
     MEDCouplingAutoRefCountObjectPtr<MEDCouplingIMesh> _mesh;
@@ -249,7 +249,7 @@ namespace ParaMEDMEM
     MEDCouplingCartesianAMRMesh(const std::string& meshName, int spaceDim, const int *nodeStrctStart, const int *nodeStrctStop,
                                 const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop);
     MEDCouplingCartesianAMRMesh(MEDCouplingIMesh *mesh);
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     ~MEDCouplingCartesianAMRMesh();
   };
 }
index f54754b37199370f3e079fb5ceab5799b2c5fe37..60ab76f40d4f0af01563998040622c31a7b6a912 100644 (file)
@@ -87,11 +87,10 @@ std::size_t MEDCouplingCurveLinearMesh::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingCurveLinearMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingCurveLinearMesh::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if((const DataArrayDouble *)_coords)
-    ret.push_back((const DataArrayDouble *)_coords);
+  ret.push_back((const DataArrayDouble *)_coords);
   return ret;
 }
 
index 45f153bbacd51bb642d54eeea3104d5f0fa64eca..ad789fec68a8045cc843b5c16c0327c3e9f2e57e 100644 (file)
@@ -36,7 +36,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return CURVE_LINEAR; }
     MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
index 3d3bf7cc1cae815178e7bb9709f513816fcef4b5..a7c73663355b7c157f1b69258297c727a5f6d610 100644 (file)
@@ -114,7 +114,7 @@ std::size_t MEDCouplingDefinitionTimeSlice::getHeapMemorySizeWithoutChildren() c
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingDefinitionTimeSlice::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingDefinitionTimeSlice::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -474,7 +474,7 @@ std::size_t MEDCouplingDefinitionTime::getHeapMemorySizeWithoutChildren() const
   return _slices.capacity()*(sizeof(MEDCouplingDefinitionTimeSlice)+sizeof(int));
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingDefinitionTime::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingDefinitionTime::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
index 638e1b26a673a1636f1833225924e83b7f99e630..93fa92c57c4a5367843ca1e18d967a628bb55261 100644 (file)
@@ -52,7 +52,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT virtual void getTinySerializationInformation(std::vector<int>& tiI, std::vector<double>& tiD) const = 0;
     MEDCOUPLING_EXPORT virtual TypeOfTimeDiscretization getTimeType() const = 0;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT bool isFullyIncludedInMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const;
     MEDCOUPLING_EXPORT bool isOverllapingWithMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const;
     MEDCOUPLING_EXPORT bool isAfterMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const;
@@ -145,7 +145,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT MEDCouplingDefinitionTime();
     MEDCOUPLING_EXPORT MEDCouplingDefinitionTime(const std::vector<const MEDCouplingFieldDouble *>& fs, const std::vector<int>& meshRefs, const std::vector<std::vector<int> >& arrRefs);
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void assign(const MEDCouplingDefinitionTime& other);
     MEDCOUPLING_EXPORT bool isEqual(const MEDCouplingDefinitionTime& other) const;
     MEDCOUPLING_EXPORT double getTimeResolution() const { return _eps; }
index c5de4848c2603986a131923c3e361e0774481080..fb36cb7c8ff3e9e2ac4508db0c6ae86d77c53767 100644 (file)
@@ -69,15 +69,12 @@ std::size_t MEDCouplingExtrudedMesh::getHeapMemorySizeWithoutChildren() const
   return MEDCouplingMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingExtrudedMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingExtrudedMesh::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if(_mesh2D)
-    ret.push_back(_mesh2D);
-  if(_mesh1D)
-    ret.push_back(_mesh1D);
-  if(_mesh3D_ids)
-    ret.push_back(_mesh3D_ids);
+  ret.push_back(_mesh2D);
+  ret.push_back(_mesh1D);
+  ret.push_back(_mesh3D_ids);
   return ret;
 }
 
index 18e4df3859e1d2a0b975d858bed603521e0bb869..ef6bb8f6a811159cea45786e0e4af4ccae4d57a7 100644 (file)
@@ -40,7 +40,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT static MEDCouplingExtrudedMesh *New();
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
     MEDCOUPLING_EXPORT int getNumberOfCells() const;
     MEDCOUPLING_EXPORT int getNumberOfNodes() const;
index 1c9ca16a391915284d051778106786f006afed11..bf5c05ac63ad8dfa3ce2fb600fe3cb906824ed99 100644 (file)
@@ -161,13 +161,11 @@ std::size_t MEDCouplingField::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingField::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingField::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if(_mesh)
-    ret.push_back(_mesh);
-  if((const MEDCouplingFieldDiscretization *)_type)
-    ret.push_back((const MEDCouplingFieldDiscretization *)_type);
+  ret.push_back(_mesh);
+  ret.push_back((const MEDCouplingFieldDiscretization *)_type);
   return ret;
 }
 
index 6d4625d702435c7a535105ca2f7fe73b72ff72d7..15f68183bbe827bec8edbc96109b5ec08e35e83e 100644 (file)
@@ -86,7 +86,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const;
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     // for MED file RW
     MEDCOUPLING_EXPORT int getNumberOfTuplesExpectedRegardingCode(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const;
     MEDCOUPLING_EXPORT virtual void reprQuickOverview(std::ostream& stream) const = 0;
index 76344523e13a62855fb58a21f731efcf256ddb80..22a30a28a1bd649a28ab19b49cc3a386a23f2d3e 100644 (file)
@@ -207,7 +207,7 @@ std::size_t MEDCouplingFieldDiscretization::getHeapMemorySizeWithoutChildren() c
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingFieldDiscretization::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingFieldDiscretization::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -1108,11 +1108,10 @@ std::size_t MEDCouplingFieldDiscretizationPerCell::getHeapMemorySizeWithoutChild
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingFieldDiscretizationPerCell::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingFieldDiscretizationPerCell::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDCouplingFieldDiscretization::getDirectChildren());
-  if(_discr_per_cell)
-    ret.push_back(_discr_per_cell);
+  std::vector<const BigMemoryObject *> ret(MEDCouplingFieldDiscretization::getDirectChildrenWithNull());
+  ret.push_back(_discr_per_cell);
   return ret;
 }
 
index 5bb752e0a9e2ea26a8c9bac545646ad4a8fca50c..17fb76c655df26d9a5ade9c26a34519ca67f861c 100644 (file)
@@ -48,7 +48,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void setPrecision(double val) { _precision=val; }
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT static TypeOfField GetTypeOfFieldFromStringRepr(const std::string& repr);
     MEDCOUPLING_EXPORT virtual TypeOfField getEnum() const = 0;
     MEDCOUPLING_EXPORT virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const;
@@ -210,7 +210,7 @@ namespace ParaMEDMEM
     ~MEDCouplingFieldDiscretizationPerCell();
     void updateTime() const;
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArray *da) const;
     bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
     bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
index ce42c398f6b2382325a8aa6a6f8f3773254802c1..f144ff7856e6c21dc2d2d2dda3f77ed7d3ac2785 100644 (file)
@@ -1939,12 +1939,12 @@ std::size_t MEDCouplingFieldDouble::getHeapMemorySizeWithoutChildren() const
   return MEDCouplingField::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingFieldDouble::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingFieldDouble::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDCouplingField::getDirectChildren());
+  std::vector<const BigMemoryObject *> ret(MEDCouplingField::getDirectChildrenWithNull());
   if(_time_discr)
     {
-      std::vector<const BigMemoryObject *> ret2(_time_discr->getDirectChildren());
+      std::vector<const BigMemoryObject *> ret2(_time_discr->getDirectChildrenWithNull());
       ret.insert(ret.end(),ret2.begin(),ret2.end());
     }
   return ret;
index 57e24b668a417691592729898fe88cd667736d0e..5ec1096a493ec9dfb26c90d7bb901811e998211a 100644 (file)
@@ -134,7 +134,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT int getNumberOfValues() const;
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     //
     MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
     MEDCOUPLING_EXPORT void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
index d01d4e95c6a1e4f8103ae70b8f5e53429abeb026..02e629e0f50316d36222ddd5cbef2f47e1bed13d 100644 (file)
@@ -821,7 +821,7 @@ std::size_t MEDCouplingIMesh::getHeapMemorySizeWithoutChildren() const
   return MEDCouplingStructuredMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingIMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingIMesh::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
index d638f738fe609cf643d060f6c490569b5bde22fb..166c611436ac438acf8f9ffc027026213eb6217d 100644 (file)
@@ -59,7 +59,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT MEDCouplingIMesh *buildWithGhost(int ghostLev) const;
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return IMAGE_GRID; }
     MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingMesh *other);
     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
index 7500d226efb4505528167de4693796088dc9df17..bdc26d1e4eff3eb610170d16163c342412e7aa9b 100644 (file)
@@ -52,12 +52,10 @@ std::size_t DenseMatrix::getHeapMemorySizeWithoutChildren() const
   return sizeof(DenseMatrix);
 }
 
-std::vector<const BigMemoryObject *> DenseMatrix::getDirectChildren() const
+std::vector<const BigMemoryObject *> DenseMatrix::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  const DataArrayDouble *pt(_data);
-  if(pt)
-    ret.push_back(pt);
+  ret.push_back((const DataArrayDouble *)_data);
   return ret;
 }
 
index 8f79784b60a4ecbb4dd42dd1b831da5f389dab3c..f0e86287c1c79188cc5bcd2ee874565a415595c8 100644 (file)
@@ -43,7 +43,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT DenseMatrix *deepCpy() const;
     MEDCOUPLING_EXPORT DenseMatrix *shallowCpy() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void updateTime() const;
     //
     MEDCOUPLING_EXPORT int getNumberOfRows() const { return _nb_rows; }
index affee929302656e61b307d1240e9c1368ffbc468..9ce46ad0fb5156a3c4430bcf4411a3028ebcb39d 100644 (file)
@@ -120,7 +120,7 @@ std::size_t DataArray::getHeapMemorySizeWithoutChildren() const
   return sz1+sz2+sz3;
 }
 
-std::vector<const BigMemoryObject *> DataArray::getDirectChildren() const
+std::vector<const BigMemoryObject *> DataArray::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
index e4b99ca15fa4b5e899350d0777f08df86e6eb8c3..56b93b3f85f782647cd9bda21c296ad41a1c3dec 100644 (file)
@@ -116,7 +116,7 @@ namespace ParaMEDMEM
   {
   public:
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void setName(const std::string& name);
     MEDCOUPLING_EXPORT void copyStringInfoFrom(const DataArray& other);
     MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds);
index 35bea1a29ecbf6754e0cf5037b641aae532b8b17..fea49d8a34f45622a781ee1df37227e111c6445b 100644 (file)
@@ -195,15 +195,11 @@ std::size_t MEDCouplingMultiFields::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingMultiFields::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingMultiFields::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
-    {
-      const MEDCouplingFieldDouble *curF(*it);
-      if(curF)
-        ret.push_back(curF);
-    }
+    ret.push_back((const MEDCouplingFieldDouble *)*it);
   return ret;
 }
 
index 3cf018017ceeaf9fc2efbc723b1382a2ce170c6a..d22a5f9df2edfae45a06189d7b72c751c41f7f8b 100644 (file)
@@ -60,7 +60,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT virtual std::vector<DataArrayDouble *> getDifferentArrays(std::vector< std::vector<int> >& refs) const;
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<double>& tinyInfo2, int& nbOfDiffMeshes, int& nbOfDiffArr) const;
     MEDCOUPLING_EXPORT void finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD,
                                                   const std::vector<MEDCouplingFieldTemplate *>& ft, const std::vector<MEDCouplingMesh *>& ms,
index 5b221e9d47fabefaef5a8f4f449fea62da980c61..92870db593529baf53ffc1b5dbf45841c6da7fad 100644 (file)
@@ -80,11 +80,10 @@ std::size_t MEDCouplingPointSet::getHeapMemorySizeWithoutChildren() const
   return MEDCouplingMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingPointSet::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingPointSet::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if(_coords)
-    ret.push_back(_coords);
+  ret.push_back(_coords);
   return ret;
 }
 
index 77fe735810126c612791e3936e1004fa31d89a16..c9bdc4e5588caf245e15ef5e6fc0005177adfb8d 100644 (file)
@@ -53,7 +53,7 @@ namespace ParaMEDMEM
   public:
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT int getNumberOfNodes() const;
     MEDCOUPLING_EXPORT int getSpaceDimension() const;
     MEDCOUPLING_EXPORT void setCoords(const DataArrayDouble *coords);
index 5284c02bd358fd097d8f28e0bb4ddcdb79e66cd3..62d0f7f4bcd37f2a3b7da4f7e0558875cf4cddb9 100644 (file)
@@ -205,6 +205,16 @@ std::string BigMemoryObject::getHeapMemorySizeStr() const
   return oss.str();
 }
 
+std::vector<const BigMemoryObject *> BigMemoryObject::getDirectChildren() const
+{
+  std::vector<const BigMemoryObject *> ret;
+  std::vector<const BigMemoryObject *> retWithNull(getDirectChildrenWithNull());
+  for(std::vector<const BigMemoryObject *>::const_iterator it=retWithNull.begin();it!=retWithNull.end();it++)
+    if(*it)
+      ret.push_back(*it);
+  return ret;
+}
+
 BigMemoryObject::~BigMemoryObject()
 {
 }
index 31a23be0a8f87c6fe6112c9b39882bb6e7e47f01..2c1e1640069331255f1aaea5189876c53e3f9759 100644 (file)
@@ -67,11 +67,12 @@ namespace ParaMEDMEM
   public:
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
     MEDCOUPLING_EXPORT std::string getHeapMemorySizeStr() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
     MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getAllTheProgeny() const;
     MEDCOUPLING_EXPORT bool isObjectInTheProgeny(const BigMemoryObject *obj) const;
     MEDCOUPLING_EXPORT static std::size_t GetHeapMemorySizeOfObjs(const std::vector<const BigMemoryObject *>& objs);
     MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0;
-    MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildren() const = 0;
+    MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const = 0;
     MEDCOUPLING_EXPORT virtual ~BigMemoryObject();
   private:
     static std::size_t GetHeapMemoryOfSet(std::set<const BigMemoryObject *>& s1, std::set<const BigMemoryObject *>& s2);
index 718507f271465df960397920669f42db7b1530c8..e8f299a12dd4a37af9f631d6f57e8cfb6eb0f4c1 100644 (file)
@@ -99,11 +99,10 @@ std::size_t MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren() co
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingTimeDiscretization::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingTimeDiscretization::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if(_array)
-    ret.push_back(_array);
+  ret.push_back(_array);
   return ret;
 }
 
@@ -2230,11 +2229,10 @@ std::size_t MEDCouplingTwoTimeSteps::getHeapMemorySizeWithoutChildren() const
   return MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingTwoTimeSteps::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingTwoTimeSteps::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDCouplingTimeDiscretization::getDirectChildren());
-  if(_end_array)
-    ret.push_back(_end_array);
+  std::vector<const BigMemoryObject *> ret(MEDCouplingTimeDiscretization::getDirectChildrenWithNull());
+  ret.push_back(_end_array);
   return ret;
 }
 
index 4996c472d72ba2321382c026ed4d92be95e4992f..43f2696f27e63909573eabb06fd72081c92cf7ff 100644 (file)
@@ -42,7 +42,7 @@ namespace ParaMEDMEM
   public:
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT virtual std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT static MEDCouplingTimeDiscretization *New(TypeOfTimeDiscretization type);
     MEDCOUPLING_EXPORT void setTimeUnit(const std::string& unit) { _time_unit=unit; }
     MEDCOUPLING_EXPORT std::string getTimeUnit() const { return _time_unit; }
@@ -370,7 +370,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT void synchronizeTimeWith(const MEDCouplingMesh *mesh);
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other);
     MEDCOUPLING_EXPORT void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other);
     MEDCOUPLING_EXPORT const DataArrayDouble *getEndArray() const;
index 0b6f047282d0c0cfcd77b1dfa229f38f2b189457..d8ba414535e787e130d6a99626f70354f4cb6d31 100644 (file)
@@ -122,13 +122,11 @@ std::size_t MEDCouplingUMesh::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDCouplingUMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDCouplingUMesh::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDCouplingPointSet::getDirectChildren());
-  if(_nodal_connec)
-    ret.push_back(_nodal_connec);
-  if(_nodal_connec_index)
-    ret.push_back(_nodal_connec_index);
+  std::vector<const BigMemoryObject *> ret(MEDCouplingPointSet::getDirectChildrenWithNull());
+  ret.push_back(_nodal_connec);
+  ret.push_back(_nodal_connec_index);
   return ret;
 }
 
index f43c356bf1b116f4146e562cdbb4fd8fbeca4ded..7f3aa5d7b0876bbcc69f474540dfebb327fab06a 100644 (file)
@@ -47,7 +47,7 @@ namespace ParaMEDMEM
     MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other);
     MEDCOUPLING_EXPORT void updateTime() const;
     MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDCOUPLING_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED; }
     MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const;
     MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
index ffac18050287b8f4c3e38a2ce9fa851e089f98cb..7c920b4d11544a56347a2f215d62093a98f3babe 100644 (file)
@@ -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;
 
 }
index a41825031b74c14132954c669a7518643a0032e4..38e3a5b765d700dfa7d77c0e1b3bb9d2c22922aa 100644 (file)
@@ -38,7 +38,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileData *New();
     MEDLOADER_EXPORT MEDFileData *deepCpy() const;
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT MEDFileFields *getFields() const;
     MEDLOADER_EXPORT MEDFileMeshes *getMeshes() const;
     MEDLOADER_EXPORT MEDFileParameters *getParams() const;
index e7ef086c98c0b3ef32a63b3e70b8883157002403..702929cfd4b0ad4310cfc2cd45667f1c66373da1 100644 (file)
@@ -114,7 +114,7 @@ std::size_t MEDFileFieldLoc::getHeapMemorySizeWithoutChildren() const
   return (_ref_coo.capacity()+_gs_coo.capacity()+_w.capacity())*sizeof(double)+_name.capacity();
 }
 
-std::vector<const BigMemoryObject *> MEDFileFieldLoc::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFieldLoc::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -418,7 +418,7 @@ std::size_t MEDFileFieldPerMeshPerTypePerDisc::getHeapMemorySizeWithoutChildren(
   return _profile.capacity()+_localization.capacity()+5*sizeof(int);
 }
 
-std::vector<const BigMemoryObject *> MEDFileFieldPerMeshPerTypePerDisc::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFieldPerMeshPerTypePerDisc::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -989,15 +989,11 @@ std::size_t MEDFileFieldPerMeshPerType::getHeapMemorySizeWithoutChildren() const
   return _field_pm_pt_pd.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc>);
 }
 
-std::vector<const BigMemoryObject *> MEDFileFieldPerMeshPerType::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFieldPerMeshPerType::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
-    {
-      const MEDFileFieldPerMeshPerTypePerDisc *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileFieldPerMeshPerTypePerDisc *)*it);
   return ret;
 }
 
@@ -1551,15 +1547,11 @@ std::size_t MEDFileFieldPerMesh::getHeapMemorySizeWithoutChildren() const
   return _mesh_name.capacity()+_field_pm_pt.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType >);
 }
 
-std::vector<const BigMemoryObject *> MEDFileFieldPerMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFieldPerMesh::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
-    {
-      const MEDFileFieldPerMeshPerType *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileFieldPerMeshPerType *)*it);
   return ret;
 }
 
@@ -2540,21 +2532,13 @@ std::size_t MEDFileFieldGlobs::getHeapMemorySizeWithoutChildren() const
   return _file_name.capacity()+_pfls.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>)+_locs.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc>);
 }
 
-std::vector<const BigMemoryObject *> MEDFileFieldGlobs::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFieldGlobs::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr< DataArrayInt > >::const_iterator it=_pfls.begin();it!=_pfls.end();it++)
-    {
-      const DataArrayInt *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const DataArrayInt *)*it);
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++)
-    {
-      const MEDFileFieldLoc *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileFieldLoc *)*it);
   return ret;
 }
 
@@ -3009,11 +2993,10 @@ std::size_t MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDFileFieldGlobsReal::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFieldGlobsReal::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if((const MEDFileFieldGlobs *)_globals)
-    ret.push_back((const MEDFileFieldGlobs *)_globals);
+  ret.push_back((const MEDFileFieldGlobs *)_globals);
   return ret;
 }
 
@@ -4248,17 +4231,13 @@ std::size_t MEDFileAnyTypeField1TSWithoutSDA::getHeapMemorySizeWithoutChildren()
   return _dt_unit.capacity()+_field_per_mesh.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh >);
 }
 
-std::vector<const BigMemoryObject *> MEDFileAnyTypeField1TSWithoutSDA::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileAnyTypeField1TSWithoutSDA::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   if(getUndergroundDataArray())
     ret.push_back(getUndergroundDataArray());
   for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
-    {
-      const MEDFileFieldPerMesh *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileFieldPerMesh *)*it);
   return ret;
 }
 
@@ -5647,11 +5626,10 @@ std::size_t MEDFileAnyTypeField1TS::getHeapMemorySizeWithoutChildren() const
   return MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDFileAnyTypeField1TS::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileAnyTypeField1TS::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDFileFieldGlobsReal::getDirectChildren());
-  if((const MEDFileAnyTypeField1TSWithoutSDA *)_content)
-    ret.push_back((const MEDFileAnyTypeField1TSWithoutSDA *)_content);
+  std::vector<const BigMemoryObject *> ret(MEDFileFieldGlobsReal::getDirectChildrenWithNull());
+  ret.push_back((const MEDFileAnyTypeField1TSWithoutSDA *)_content);
   return ret;
 }
 
@@ -6754,15 +6732,11 @@ std::size_t MEDFileAnyTypeFieldMultiTSWithoutSDA::getHeapMemorySizeWithoutChildr
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileAnyTypeFieldMultiTSWithoutSDA::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileAnyTypeFieldMultiTSWithoutSDA::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
-    {
-      const MEDFileAnyTypeField1TSWithoutSDA *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileAnyTypeField1TSWithoutSDA *)*it);
   return ret;
 }
 
@@ -8232,11 +8206,10 @@ std::size_t MEDFileAnyTypeFieldMultiTS::getHeapMemorySizeWithoutChildren() const
   return MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDFileAnyTypeFieldMultiTS::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileAnyTypeFieldMultiTS::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDFileFieldGlobsReal::getDirectChildren());
-  if((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content)
-    ret.push_back((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content);
+  std::vector<const BigMemoryObject *> ret(MEDFileFieldGlobsReal::getDirectChildrenWithNull());
+  ret.push_back((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content);
   return ret;
 }
 
@@ -9411,15 +9384,11 @@ std::size_t MEDFileFields::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileFields::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFields::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
-    {
-      const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)*it);
   return ret;
 }
 
index f912ccee7c202628edd17454830a89f010dc82e9..e7539a889a80e798cb7d3c7415a21bd9410daeb2 100644 (file)
@@ -57,7 +57,7 @@ namespace ParaMEDMEM
     static MEDFileFieldLoc *New(med_idt fid, int id);
     static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDFileFieldLoc *deepCpy() const;
     MEDLOADER_EXPORT int getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
@@ -101,7 +101,7 @@ namespace ParaMEDMEM
     static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId);
     static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDFileFieldPerMeshPerTypePerDisc *deepCpy(MEDFileFieldPerMeshPerType *father) const;
     void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
     void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
@@ -177,7 +177,7 @@ namespace ParaMEDMEM
     static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType);
     static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDFileFieldPerMeshPerType *deepCpy(MEDFileFieldPerMesh *father) const;
     void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
     void assignFieldProfile(bool isPflAlone, int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
@@ -233,7 +233,7 @@ namespace ParaMEDMEM
     static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh);
     static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const;
     void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
     void copyTinyInfoFrom(const MEDCouplingMesh *mesh);
@@ -307,7 +307,7 @@ namespace ParaMEDMEM
     static MEDFileFieldGlobs *New(const std::string& fname);
     static MEDFileFieldGlobs *New();
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDFileFieldGlobs *deepCpy() const;
     MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
     MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const;
@@ -367,7 +367,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT MEDFileFieldGlobsReal(const std::string& fname);
     MEDLOADER_EXPORT MEDFileFieldGlobsReal();
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT void simpleReprGlobs(std::ostream& oss) const;
     MEDLOADER_EXPORT void resetContent();
     MEDLOADER_EXPORT void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
@@ -489,7 +489,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT std::vector<std::string>& getInfo();
     MEDLOADER_EXPORT void setInfo(const std::vector<std::string>& infos);
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr);
     MEDLOADER_EXPORT void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
     MEDLOADER_EXPORT void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc);
@@ -675,7 +675,7 @@ namespace ParaMEDMEM
     //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
     MEDLOADER_EXPORT void setLocNameOnLeaf(const std::string& mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const std::string& newLocName, bool forceRenameOnGlob=false);
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsed() const;
     MEDLOADER_EXPORT std::vector<std::string> getLocsReallyUsed() const;
     MEDLOADER_EXPORT std::vector<std::string> getPflsReallyUsedMulti() const;
@@ -784,7 +784,7 @@ namespace ParaMEDMEM
     MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll);
   public:
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const;
     MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const;
     MEDLOADER_EXPORT virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const;
@@ -916,7 +916,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
     MEDLOADER_EXPORT void writeLL(med_idt fid) const;
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const;
     MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const;
     MEDLOADER_EXPORT std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const;
@@ -1077,7 +1077,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileFields *New();
     MEDLOADER_EXPORT static MEDFileFields *New(const std::string& fileName, bool loadAll=true);
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT MEDFileFields *deepCpy() const;
     MEDLOADER_EXPORT MEDFileFields *shallowCpy() const;
     MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
index b6b8ca5dca558ac430cddf024b1a571c3f02d8cb..c3317e2954eb633f3da6e115d2324aa694ed6e81 100644 (file)
@@ -47,7 +47,7 @@ std::size_t MEDFileMeshStruct::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileMeshStruct::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileMeshStruct::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -158,7 +158,7 @@ std::size_t MEDMeshMultiLev::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDMeshMultiLev::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDMeshMultiLev::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -1772,12 +1772,10 @@ std::size_t MEDFileField1TSStructItem2::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileField1TSStructItem2::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileField1TSStructItem2::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  const DataArrayInt *pfl(_pfl);
-  if(pfl)
-    ret.push_back(pfl);
+  ret.push_back((const DataArrayInt *)_pfl);
   return ret;
 }
 
@@ -1988,7 +1986,7 @@ std::size_t MEDFileField1TSStructItem::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileField1TSStructItem::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileField1TSStructItem::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDFileField1TSStructItem2 >::const_iterator it=_items.begin();it!=_items.end();it++)
@@ -2171,7 +2169,7 @@ std::size_t MEDFileField1TSStruct::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileField1TSStruct::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileField1TSStruct::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector<MEDFileField1TSStructItem>::const_iterator it=_already_checked.begin();it!=_already_checked.end();it++)
@@ -2313,18 +2311,14 @@ std::size_t MEDFileFastCellSupportComparator::getHeapMemorySizeWithoutChildren()
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileFastCellSupportComparator::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileFastCellSupportComparator::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   const MEDFileMeshStruct *mst(_mesh_comp);
   if(mst)
     ret.push_back(mst);
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct> >::const_iterator it=_f1ts_cmps.begin();it!=_f1ts_cmps.end();it++)
-    {
-      const MEDFileField1TSStruct *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileField1TSStruct *)*it);
   return ret;
 }
 
index f273cdab599783df594043eb22cbad1c75679064..7674889beec3cd922d8337bf0a6179674089c5a4 100644 (file)
@@ -51,7 +51,7 @@ namespace ParaMEDMEM
   public:
     MEDLOADER_EXPORT static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     const MEDFileMesh *getTheMesh() const { return _mesh; }
     int getNumberOfNodes() const { return _nb_nodes; }
     bool doesManageGeoType(INTERP_KERNEL::NormalizedCellType t) const;
@@ -76,7 +76,7 @@ namespace ParaMEDMEM
   {
   public:
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
   public:
     static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector<INTERP_KERNEL::NormalizedCellType>& gts, const std::vector<const DataArrayInt *>& pfls, const std::vector<int>& nbEntities);
     static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector<int>& levs);
@@ -213,7 +213,7 @@ namespace ParaMEDMEM
     void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs);
     //
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     //
     const DataArrayInt *getPfl(const MEDFileFieldGlobsReal *globs) const;
     INTERP_KERNEL::NormalizedCellType getGeo() const { return _geo_type; }
@@ -246,7 +246,7 @@ namespace ParaMEDMEM
     void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs);
     bool operator==(const MEDFileField1TSStructItem& other) const;
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     bool isEntityCell() const;
     bool isComputed() const { return _computed; }
     TypeOfField getType() const { return _type; }
@@ -273,7 +273,7 @@ namespace ParaMEDMEM
     static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst);
     void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *mst) const;
     bool isSupportSameAs(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt);
     bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt);
@@ -299,7 +299,7 @@ namespace ParaMEDMEM
     bool isEqual(const MEDFileAnyTypeFieldMultiTS *other);
     bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeFieldMultiTS *other);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
   private:
     MEDFileFastCellSupportComparator(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
   private:
index 90375565ad85666a92bd45a143b6840813e3dbde..95a94758522fa26a4d14c9e4c1c047fe3fb424d9 100644 (file)
@@ -56,7 +56,7 @@ std::size_t MEDFileMesh::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileMesh::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -1990,22 +1990,16 @@ std::size_t MEDFileUMesh::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileUMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileUMesh::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDFileMesh::getDirectChildren());
-  if((const DataArrayDouble*)_coords)
-    ret.push_back((const DataArrayDouble*)_coords);
-  if((const DataArrayInt *)_fam_coords)
-    ret.push_back((const DataArrayInt *)_fam_coords);
-  if((const DataArrayInt *)_num_coords)
-    ret.push_back((const DataArrayInt *)_num_coords);
-  if((const DataArrayInt *)_rev_num_coords)
-    ret.push_back((const DataArrayInt *)_rev_num_coords);
-  if((const DataArrayAsciiChar *)_name_coords)
-    ret.push_back((const DataArrayAsciiChar *)_name_coords);
+  std::vector<const BigMemoryObject *> ret(MEDFileMesh::getDirectChildrenWithNull());
+  ret.push_back((const DataArrayDouble*)_coords);
+  ret.push_back((const DataArrayInt *)_fam_coords);
+  ret.push_back((const DataArrayInt *)_num_coords);
+  ret.push_back((const DataArrayInt *)_rev_num_coords);
+  ret.push_back((const DataArrayAsciiChar *)_name_coords);
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
-    if((const MEDFileUMeshSplitL1*) *it)
-      ret.push_back((const MEDFileUMeshSplitL1*) *it);
+    ret.push_back((const MEDFileUMeshSplitL1*) *it);
   return ret;
 }
 
@@ -3976,33 +3970,21 @@ std::size_t MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren() const
   return MEDFileMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDFileStructuredMesh::getDirectChildren() const
-{
-  std::vector<const BigMemoryObject *> ret(MEDFileMesh::getDirectChildren());
-  if((const DataArrayInt *)_fam_nodes)
-    ret.push_back((const DataArrayInt *)_fam_nodes);
-  if((const DataArrayInt *)_num_nodes)
-    ret.push_back((const DataArrayInt *)_num_nodes);
-  if((const DataArrayAsciiChar *)_names_nodes)
-    ret.push_back((const DataArrayAsciiChar *)_names_nodes);
-  if((const DataArrayInt *)_fam_cells)
-    ret.push_back((const DataArrayInt *)_fam_cells);
-  if((const DataArrayInt *)_num_cells)
-    ret.push_back((const DataArrayInt *)_num_cells);
-  if((const DataArrayAsciiChar *)_names_cells)
-    ret.push_back((const DataArrayAsciiChar *)_names_cells);
-  if((const DataArrayInt *)_fam_faces)
-    ret.push_back((const DataArrayInt *)_fam_faces);
-  if((const DataArrayInt *)_num_faces)
-    ret.push_back((const DataArrayInt *)_num_faces);
-  if((const DataArrayInt *)_rev_num_nodes)
-    ret.push_back((const DataArrayInt *)_rev_num_nodes);
-  if((const DataArrayAsciiChar *)_names_faces)
-    ret.push_back((const DataArrayAsciiChar *)_names_faces);
-  if((const DataArrayInt *)_rev_num_cells)
-    ret.push_back((const DataArrayInt *)_rev_num_cells);
-  if((const MEDCoupling1SGTUMesh*)_faces_if_necessary)
-    ret.push_back((const MEDCoupling1SGTUMesh*)_faces_if_necessary);
+std::vector<const BigMemoryObject *> MEDFileStructuredMesh::getDirectChildrenWithNull() const
+{
+  std::vector<const BigMemoryObject *> ret(MEDFileMesh::getDirectChildrenWithNull());
+  ret.push_back((const DataArrayInt *)_fam_nodes);
+  ret.push_back((const DataArrayInt *)_num_nodes);
+  ret.push_back((const DataArrayAsciiChar *)_names_nodes);
+  ret.push_back((const DataArrayInt *)_fam_cells);
+  ret.push_back((const DataArrayInt *)_num_cells);
+  ret.push_back((const DataArrayAsciiChar *)_names_cells);
+  ret.push_back((const DataArrayInt *)_fam_faces);
+  ret.push_back((const DataArrayInt *)_num_faces);
+  ret.push_back((const DataArrayInt *)_rev_num_nodes);
+  ret.push_back((const DataArrayAsciiChar *)_names_faces);
+  ret.push_back((const DataArrayInt *)_rev_num_cells);
+  ret.push_back((const MEDCoupling1SGTUMesh*)_faces_if_necessary);
   return ret;
 }
 
@@ -5067,11 +5049,10 @@ std::size_t MEDFileCMesh::getHeapMemorySizeWithoutChildren() const
   return MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDFileCMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileCMesh::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDFileStructuredMesh::getDirectChildren());
-  if((const MEDCouplingCMesh *)_cmesh)
-    ret.push_back((const MEDCouplingCMesh *)_cmesh);
+  std::vector<const BigMemoryObject *> ret(MEDFileStructuredMesh::getDirectChildrenWithNull());
+  ret.push_back((const MEDCouplingCMesh *)_cmesh);
   return ret;
 }
 
@@ -5324,11 +5305,10 @@ std::size_t MEDFileCurveLinearMesh::getHeapMemorySizeWithoutChildren() const
   return MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren();
 }
 
-std::vector<const BigMemoryObject *> MEDFileCurveLinearMesh::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileCurveLinearMesh::getDirectChildrenWithNull() const
 {
-  std::vector<const BigMemoryObject *> ret(MEDFileStructuredMesh::getDirectChildren());
-  if((const MEDCouplingCurveLinearMesh *)_clmesh)
-    ret.push_back((const MEDCouplingCurveLinearMesh *)_clmesh);
+  std::vector<const BigMemoryObject *> ret(MEDFileStructuredMesh::getDirectChildrenWithNull());
+  ret.push_back((const MEDCouplingCurveLinearMesh *)_clmesh);
   return ret;
 }
 
@@ -5537,15 +5517,11 @@ std::size_t MEDFileMeshMultiTS::getHeapMemorySizeWithoutChildren() const
   return _mesh_one_ts.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMesh>);
 }
 
-std::vector<const BigMemoryObject *> MEDFileMeshMultiTS::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileMeshMultiTS::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
-    {
-      const MEDFileMesh *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileMesh *)*it);
   return ret;
 }
 
@@ -5824,15 +5800,11 @@ std::size_t MEDFileMeshes::getHeapMemorySizeWithoutChildren() const
   return _meshes.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS>));
 }
 
-std::vector<const BigMemoryObject *> MEDFileMeshes::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileMeshes::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++)
-    {
-      const MEDFileMeshMultiTS *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
+    ret.push_back((const MEDFileMeshMultiTS *)*it);
   return ret;
 }
 
index ca36d3f870ea5a29849b0d894a46ca7927de6a1a..c2a0eeab706632334c0e606b345ad9297dc75aa6 100644 (file)
@@ -40,7 +40,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
     MEDLOADER_EXPORT static MEDFileMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT virtual MEDFileMesh *createNewEmpty() const = 0;
     MEDLOADER_EXPORT virtual MEDFileMesh *deepCpy() const = 0;
     MEDLOADER_EXPORT virtual MEDFileMesh *shallowCpy() const = 0;
@@ -201,7 +201,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileUMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
     MEDLOADER_EXPORT static MEDFileUMesh *New();
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
     MEDLOADER_EXPORT MEDFileMesh *deepCpy() const;
     MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const;
@@ -309,7 +309,7 @@ namespace ParaMEDMEM
     friend class MEDFileMesh;
   public:
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT int getMaxAbsFamilyIdInArrays() const;
     MEDLOADER_EXPORT int getMaxFamilyIdInArrays() const;
     MEDLOADER_EXPORT int getMinFamilyIdInArrays() const;
@@ -374,7 +374,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
     MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
     MEDLOADER_EXPORT MEDFileMesh *deepCpy() const;
     MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const;
@@ -405,7 +405,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, MEDFileMeshReadSelector *mrs=0);
     MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0);
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const;
     MEDLOADER_EXPORT MEDFileMesh *deepCpy() const;
     MEDLOADER_EXPORT MEDFileMesh *shallowCpy() const;
@@ -435,7 +435,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName);
     MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCpy() const;
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT std::string getName() const;
     MEDLOADER_EXPORT void setName(const std::string& newMeshName);
     MEDLOADER_EXPORT bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab);
@@ -461,7 +461,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileMeshes *New(const std::string& fileName);
     MEDLOADER_EXPORT MEDFileMeshes *deepCpy() const;
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT std::string simpleRepr() const;
     MEDLOADER_EXPORT void simpleReprWithoutHeader(std::ostream& oss) const;
     MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
index 7d30a60a19e7929b639cc03e4e9825c4ecdbd712..00980e5b13f8f33db74b2ebf06bccebd5702a753 100644 (file)
@@ -45,17 +45,13 @@ std::size_t MEDFileUMeshPerType::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDFileUMeshPerType::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileUMeshPerType::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  if((const MEDCoupling1GTUMesh *)_m)
-    ret.push_back((const MEDCoupling1GTUMesh *)_m);
-  if((const DataArrayInt *)_num)
-    ret.push_back((const DataArrayInt *)_num);
-  if((const DataArrayInt *)_fam)
-    ret.push_back((const DataArrayInt *)_fam);
-  if((const DataArrayAsciiChar *)_names)
-    ret.push_back((const DataArrayAsciiChar *)_names);
+  ret.push_back((const MEDCoupling1GTUMesh *)_m);
+  ret.push_back((const DataArrayInt *)_num);
+  ret.push_back((const DataArrayInt *)_fam);
+  ret.push_back((const DataArrayAsciiChar *)_names);
   return ret;
 }
 
index 5b497a8a2154e403e25b454182fdd002de475ca2..93be1e33865fc4b3934175a9777732736bf7fa09 100644 (file)
@@ -40,7 +40,7 @@ namespace ParaMEDMEM
     static MEDFileUMeshPerType *New(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType geoElt2, MEDFileMeshReadSelector *mrs);
     static bool isExisting(med_idt fid, const char *mName, int dt, int it, med_geometry_type geoElt, med_entity_type& whichEntity);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     int getDim() const;
     MEDCoupling1GTUMesh *getMesh() const { return const_cast<MEDCoupling1GTUMesh *>((const MEDCoupling1GTUMesh *)_m); }
     const DataArrayInt *getFam() const { return _fam; }
index 79493967fea2520802268a096562614363d8e528..bd8aff2c43787e62328672ba2703859bb02c38f4 100644 (file)
@@ -45,7 +45,7 @@ std::size_t MEDFileMeshL2::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDFileMeshL2::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileMeshL2::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -512,12 +512,10 @@ void MEDFileUMeshPermCompute::updateTime() const
   _num_time=_st->_num->getTimeOfThis();
 }
 
-std::vector<const BigMemoryObject *> MEDFileUMeshPermCompute::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileUMeshPermCompute::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
-  const MEDCouplingUMesh *elt(_m);
-  if(elt)
-    ret.push_back(elt);
+  ret.push_back((const MEDCouplingUMesh *)_m);
   return ret;
 }
 
@@ -607,19 +605,15 @@ std::size_t MEDFileUMeshSplitL1::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> MEDFileUMeshSplitL1::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileUMeshSplitL1::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   ret.push_back(&_m_by_types);
   ret.push_back(&_m);
-  if((const DataArrayInt*)_fam)
-    ret.push_back((const DataArrayInt*)_fam);
-  if((const DataArrayInt*)_num)
-    ret.push_back((const DataArrayInt*)_num);
-  if((const DataArrayInt*)_rev_num)
-    ret.push_back((const DataArrayInt*)_rev_num);
-  if((const DataArrayAsciiChar*)_names)
-    ret.push_back((const DataArrayAsciiChar*)_names);
+  ret.push_back((const DataArrayInt*)_fam);
+  ret.push_back((const DataArrayInt*)_num);
+  ret.push_back((const DataArrayInt*)_rev_num);
+  ret.push_back((const DataArrayAsciiChar*)_names);
   return ret;
 }
 
@@ -1214,18 +1208,12 @@ std::size_t MEDFileUMeshAggregateCompute::getHeapMemorySizeWithoutChildren() con
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileUMeshAggregateCompute::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileUMeshAggregateCompute::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
-    {
-      const MEDCoupling1GTUMesh *cur(*it);
-      if(cur)
-        ret.push_back(cur);
-    }
-  const MEDCouplingUMesh *m(_m);
-  if(m)
-    ret.push_back(m);
+    ret.push_back((const MEDCoupling1GTUMesh *)*it);
+  ret.push_back((const MEDCouplingUMesh *)_m);
   return ret;
 }
 
index f353a7b7525cf469a16dc745d95dbedaee3338b2..ffb34e35adbb41099fdab47473124cc2c788fa0a 100644 (file)
@@ -43,7 +43,7 @@ namespace ParaMEDMEM
   public:
     MEDFileMeshL2();
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     const char *getName() const { return _name.getReprForWrite(); }
     const char *getDescription() const { return _description.getReprForWrite(); }
     const char *getUnivName() const { return _univ_name.getReprForWrite(); }
@@ -130,7 +130,7 @@ namespace ParaMEDMEM
     operator MEDCouplingUMesh *() const;
     void operator=(MEDCouplingUMesh *m);
     void updateTime() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     std::size_t getHeapMemorySizeWithoutChildren() const;
   private:
     const MEDFileUMeshSplitL1 *_st;
@@ -154,7 +154,7 @@ namespace ParaMEDMEM
     void getStartStopOfGeoTypeWithoutComputation(INTERP_KERNEL::NormalizedCellType gt, int& start, int& stop) const;
     std::size_t getTimeOfThis() const;
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDFileUMeshAggregateCompute deepCpy(DataArrayDouble *coords) const;
     bool isEqual(const MEDFileUMeshAggregateCompute& other, double eps, std::string& what) const;
     void clearNonDiscrAttributes() const;
@@ -186,7 +186,7 @@ namespace ParaMEDMEM
     MEDFileUMeshSplitL1(MEDCouplingUMesh *m, bool newOrOld);
     void setName(const std::string& name);
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDFileUMeshSplitL1 *deepCpy(DataArrayDouble *coords) const;
     void setCoords(DataArrayDouble *coords);
     bool isEqual(const MEDFileUMeshSplitL1 *other, double eps, std::string& what) const;
index 3f1bc8a77e64a489f6e73e07647360c91d559149..e50d32600846f862de7ea89cd14ae161e67e6022 100644 (file)
@@ -72,7 +72,7 @@ std::size_t MEDFileParameterDouble1TSWTI::getHeapMemorySizeWithoutChildren() con
   return sizeof(MEDFileParameterDouble1TSWTI);
 }
 
-std::vector<const BigMemoryObject *> MEDFileParameterDouble1TSWTI::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileParameterDouble1TSWTI::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -350,7 +350,7 @@ std::size_t MEDFileParameterDouble1TS::getHeapMemorySizeWithoutChildren() const
   return getHeapMemSizeOfStrings()+sizeof(MEDFileParameterDouble1TS);
 }
 
-std::vector<const BigMemoryObject *> MEDFileParameterDouble1TS::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileParameterDouble1TS::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
@@ -486,15 +486,11 @@ std::size_t MEDFileParameterMultiTS::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileParameterMultiTS::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileParameterMultiTS::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
-    {
-      const MEDFileParameter1TS *elt(*it);
-      if(elt)
-        ret.push_back(elt);
-    }
+    ret.push_back((const MEDFileParameter1TS *)*it);
   return ret;
 }
 
@@ -742,15 +738,11 @@ std::size_t MEDFileParameters::getHeapMemorySizeWithoutChildren() const
   return ret;
 }
 
-std::vector<const BigMemoryObject *> MEDFileParameters::getDirectChildren() const
+std::vector<const BigMemoryObject *> MEDFileParameters::getDirectChildrenWithNull() const
 {
   std::vector<const BigMemoryObject *> ret;
   for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
-    {
-      const MEDFileParameterMultiTS *elt(*it);
-      if(elt)
-        ret.push_back(elt);
-    }
+    ret.push_back((const MEDFileParameterMultiTS *)*it);
   return ret;
 }
 
index c95432deae22b54e29e949ff7af8d8e738be6002..c7a2b96d11f5edcd61cafa802f8da6f22116d074 100644 (file)
@@ -63,7 +63,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT double getValue() const { return _arr; }
     MEDLOADER_EXPORT bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT void readValue(med_idt fid, const std::string& name);
     MEDLOADER_EXPORT std::string simpleRepr() const;
   protected:
@@ -106,7 +106,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT virtual bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
     MEDLOADER_EXPORT virtual std::string simpleRepr() const;
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT void setName(const std::string& name) { _name=name; }
     MEDLOADER_EXPORT std::string getName() const { return _name; }
     MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
@@ -126,7 +126,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT std::string getName() const { return _name; }
     MEDLOADER_EXPORT void setName(const std::string& name) { _name=name; }
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT MEDFileParameterMultiTS *deepCpy() const;
     MEDLOADER_EXPORT bool isEqual(const MEDFileParameterMultiTS *other, double eps, std::string& what) const;
     MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
@@ -158,7 +158,7 @@ namespace ParaMEDMEM
     MEDLOADER_EXPORT static MEDFileParameters *New();
     MEDLOADER_EXPORT static MEDFileParameters *New(const std::string& fileName);
     MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
-    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildren() const;
+    MEDLOADER_EXPORT std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     MEDLOADER_EXPORT MEDFileParameters *deepCpy() const;
     MEDLOADER_EXPORT bool isEqual(const MEDFileParameters *other, double eps, std::string& what) const;
     MEDLOADER_EXPORT void write(const std::string& fileName, int mode) const;
index 9b0fce3b8693f17e86cef8f31260ffeb2db73f52..f530d1f2d1b7169e0981f3092796873e4024c96e 100644 (file)
@@ -86,7 +86,7 @@ std::size_t SauvReader::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> SauvReader::getDirectChildren() const
+std::vector<const BigMemoryObject *> SauvReader::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
index 533ae0ba451f801456050f6054fd36b1689a63f2..e937cbf92d5f1457521633be070b4c07c006c7da 100644 (file)
@@ -52,7 +52,7 @@ class SauvReader : public ParaMEDMEM::RefCountObject
 
  private:
   std::size_t getHeapMemorySizeWithoutChildren() const;
-  std::vector<const BigMemoryObject *> getDirectChildren() const;
+  std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
   void readRecord2();
   void readRecord4();
   void readRecord7();
index 261d529df9b190ad9735ed5d5834a2afb71c3145..6bb27e88f3b2e37b9013c82e4293e2eecd5afc63 100644 (file)
@@ -111,7 +111,7 @@ namespace SauvUtilities
     virtual std::string getName() const = 0;
   protected:
     std::size_t getHeapMemorySizeWithoutChildren() const { return 0; }
-    std::vector<const BigMemoryObject *> getDirectChildren() const { return std::vector<const BigMemoryObject *>(); }
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const { return std::vector<const BigMemoryObject *>(); }
   protected:
     std::string _fileName, _curLocale;
     int _iRead, _nbToRead;
index 815b946463cde87c59ad96525079ed5d10d3ce97..eef47c9f45c07bee5ce62ca55ca86b692109f03d 100644 (file)
@@ -226,7 +226,7 @@ std::size_t SauvWriter::getHeapMemorySizeWithoutChildren() const
   return 0;
 }
 
-std::vector<const BigMemoryObject *> SauvWriter::getDirectChildren() const
+std::vector<const BigMemoryObject *> SauvWriter::getDirectChildrenWithNull() const
 {
   return std::vector<const BigMemoryObject *>();
 }
index b489e001560c6324f0d3ab8e067e0b07a139a6b8..c810a7f134ee6782ee402df82c3903f51bf4b968 100644 (file)
@@ -54,7 +54,7 @@ namespace ParaMEDMEM
   private:
     SauvWriter();
     std::size_t getHeapMemorySizeWithoutChildren() const;
-    std::vector<const BigMemoryObject *> getDirectChildren() const;
+    std::vector<const BigMemoryObject *> getDirectChildrenWithNull() const;
     /*!
      * \brief Class representing a GIBI sub-mesh (described in the pile 1 of the SAUVE file).
      * It stands for a named med sub-mesh (family, etc) and contains either cell IDs or other sub-meshes.