return new MEDCalculatorDBFieldCst(val);
}
+std::size_t MEDCalculatorDBField::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDCalculatorDBField::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
MEDCalculatorDBField *MEDCalculatorDBField::operator+(double val) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDCalculatorDBFieldCst> par2=new MEDCalculatorDBFieldCst(val);
public:
static MEDCalculatorDBFieldReal *New(const MEDCalculatorBrowserField& ls);
static MEDCalculatorDBFieldCst *New(double val);
- std::size_t getHeapMemorySize() const { return 0; }
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() 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;
{
}
+std::size_t MEDCalculatorDBSliceField::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDCalculatorDBSliceField::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
void MEDCalculatorDBSliceField::setField(MEDCouplingFieldDouble *f) const
{
if(_field!=f)
public:
MEDCalculatorDBSliceField(int iter, int order);
MEDCalculatorDBSliceField(MEDCouplingFieldDouble *f);
- std::size_t getHeapMemorySize() const { return 0; }
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
bool isFetched() const { return _field!=0; }
void getDtIt(int& it, int& order) const { it=_iteration; order=_order; }
void setField(MEDCouplingFieldDouble *f) const;
return std::string("UnstructuredGrid");
}
-std::size_t MEDCoupling1GTUMesh::getHeapMemorySize() const
+std::size_t MEDCoupling1GTUMesh::getHeapMemorySizeWithoutChildren() const
{
- return MEDCouplingPointSet::getHeapMemorySize();
+ return MEDCouplingPointSet::getHeapMemorySizeWithoutChildren();
}
bool MEDCoupling1GTUMesh::isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception)
updateTimeWith(*c);
}
-std::size_t MEDCoupling1SGTUMesh::getHeapMemorySize() const
+std::size_t MEDCoupling1SGTUMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ return MEDCoupling1GTUMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDCoupling1SGTUMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDCoupling1GTUMesh::getDirectChildren());
const DataArrayInt *c(_conn);
if(c)
- ret+=c->getHeapMemorySize();
- return MEDCoupling1GTUMesh::getHeapMemorySize()+ret;
+ ret.push_back(const_cast<DataArrayInt *>(c));
+ return ret;
}
MEDCouplingMesh *MEDCoupling1SGTUMesh::deepCpy() const
updateTimeWith(*c);
}
-std::size_t MEDCoupling1DGTUMesh::getHeapMemorySize() const
+std::size_t MEDCoupling1DGTUMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ return MEDCoupling1GTUMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDCoupling1DGTUMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDCoupling1GTUMesh::getDirectChildren());
const DataArrayInt *c(_conn);
if(c)
- ret+=c->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt *>(c));
c=_conn_indx;
if(c)
- ret+=c->getHeapMemorySize();
- return MEDCoupling1GTUMesh::getHeapMemorySize()+ret;
+ ret.push_back(const_cast<DataArrayInt *>(c));
+ return ret;
}
MEDCouplingMesh *MEDCoupling1DGTUMesh::deepCpy() const
MEDCOUPLING_EXPORT void writeVTKLL(std::ostream& ofs, const std::string& cellData, const std::string& pointData, DataArrayByte *byteData) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT std::string getVTKDataSetType() const throw(INTERP_KERNEL::Exception);
//
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT int getNodalConnectivityLength() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
// overload of TimeLabel and RefCountObject
MEDCOUPLING_EXPORT void updateTime() const;
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+ MEDCOUPLING_EXPORT std::vector<RefCountObject *> getDirectChildren() const;
// overload of MEDCouplingMesh
MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED; }
MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
// overload of TimeLabel and RefCountObject
MEDCOUPLING_EXPORT void updateTime() const;
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+ MEDCOUPLING_EXPORT std::vector<RefCountObject *> getDirectChildren() const;
// overload of MEDCouplingMesh
MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED; }
MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const;
updateTimeWith(*_z_array);
}
-std::size_t MEDCouplingCMesh::getHeapMemorySize() const
-{
- std::size_t ret=0;
- std::set<DataArrayDouble *> s;
- s.insert(_x_array); s.insert(_y_array); s.insert(_z_array);
- s.erase(NULL);
- for(std::set<DataArrayDouble *>::const_iterator it=s.begin();it!=s.end();it++)
- if(*it)
- ret+=(*it)->getHeapMemorySize();
- return MEDCouplingStructuredMesh::getHeapMemorySize()+ret;
+std::size_t MEDCouplingCMesh::getHeapMemorySizeWithoutChildren() const
+{
+ return MEDCouplingStructuredMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDCouplingCMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ if(_x_array)
+ ret.push_back(const_cast<DataArrayDouble *>(_x_array));
+ if(_y_array)
+ ret.push_back(const_cast<DataArrayDouble *>(_y_array));
+ if(_z_array)
+ ret.push_back(const_cast<DataArrayDouble *>(_z_array));
+ return ret;
}
/*!
MEDCouplingMesh *deepCpy() const;
MEDCouplingCMesh *clone(bool recDeepCpy) const;
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDCouplingMeshType getType() const { return CARTESIAN; }
void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
updateTimeWith(*_coords);
}
-std::size_t MEDCouplingCurveLinearMesh::getHeapMemorySize() const
+std::size_t MEDCouplingCurveLinearMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ std::size_t ret(MEDCouplingStructuredMesh::getHeapMemorySizeWithoutChildren());
ret+=_structure.capacity()*sizeof(int);
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDCouplingCurveLinearMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
if((const DataArrayDouble *)_coords)
- ret+=_coords->getHeapMemorySize();
- return MEDCouplingStructuredMesh::getHeapMemorySize()+ret;
+ ret.push_back(const_cast<DataArrayDouble *>((const DataArrayDouble *)_coords));
+ return ret;
}
/*!
MEDCouplingMesh *deepCpy() const;
MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const;
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDCouplingMeshType getType() const { return CURVE_LINEAR; }
void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
throw INTERP_KERNEL::Exception("MEDCouplingDefinitionTimeSlice : End time strictly before Start time ...");
}
-std::size_t MEDCouplingDefinitionTimeSlice::getHeapMemorySize() const
+std::size_t MEDCouplingDefinitionTimeSlice::getHeapMemorySizeWithoutChildren() const
{
return 0;
}
+std::vector<RefCountObject *> MEDCouplingDefinitionTimeSlice::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
bool MEDCouplingDefinitionTimeSlice::isFullyIncludedInMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const
{
double t1=getStartTime();
}
}
-std::size_t MEDCouplingDefinitionTime::getHeapMemorySize() const
+std::size_t MEDCouplingDefinitionTime::getHeapMemorySizeWithoutChildren() const
{
return _slices.capacity()*(sizeof(MEDCouplingDefinitionTimeSlice)+sizeof(int));
}
+std::vector<RefCountObject *> MEDCouplingDefinitionTime::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
void MEDCouplingDefinitionTime::assign(const MEDCouplingDefinitionTime& other)
{
std::size_t sz=other._slices.size();
virtual double getEndTime() const = 0;
virtual void getTinySerializationInformation(std::vector<int>& tiI, std::vector<double>& tiD) const = 0;
virtual TypeOfTimeDiscretization getTimeType() const = 0;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
bool isFullyIncludedInMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const;
bool isOverllapingWithMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const;
bool isAfterMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const;
public:
MEDCouplingDefinitionTime();
MEDCouplingDefinitionTime(const std::vector<const MEDCouplingFieldDouble *>& fs, const std::vector<int>& meshRefs, const std::vector<std::vector<int> >& arrRefs) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void assign(const MEDCouplingDefinitionTime& other);
bool isEqual(const MEDCouplingDefinitionTime& other) const;
double getTimeResolution() const { return _eps; }
return EXTRUDED;
}
-std::size_t MEDCouplingExtrudedMesh::getHeapMemorySize() const
+std::size_t MEDCouplingExtrudedMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ return MEDCouplingMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDCouplingExtrudedMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
if(_mesh2D)
- ret+=_mesh2D->getHeapMemorySize();
+ ret.push_back(const_cast<MEDCouplingUMesh *>(_mesh2D));
if(_mesh1D)
- ret+=_mesh1D->getHeapMemorySize();
+ ret.push_back(const_cast<MEDCouplingUMesh *>(_mesh1D));
if(_mesh3D_ids)
- ret+=_mesh3D_ids->getHeapMemorySize();
- return MEDCouplingMesh::getHeapMemorySize()+ret;
+ ret.push_back(const_cast<DataArrayInt *>(_mesh3D_ids));
+ return ret;
}
/*!
static MEDCouplingExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, int cell2DId) throw(INTERP_KERNEL::Exception);
static MEDCouplingExtrudedMesh *New();
MEDCouplingMeshType getType() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
int getNumberOfCells() const;
int getNumberOfNodes() const;
updateTimeWith(*_type);
}
-std::size_t MEDCouplingField::getHeapMemorySize() const
+std::size_t MEDCouplingField::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret=0;
ret+=_name.capacity();
ret+=_desc.capacity();
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDCouplingField::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
if(_mesh)
- ret+=_mesh->getHeapMemorySize();
+ ret.push_back(const_cast<MEDCouplingMesh *>(_mesh));
if((const MEDCouplingFieldDiscretization *)_type)
- ret+=_type->getHeapMemorySize();
+ ret.push_back(const_cast<MEDCouplingFieldDiscretization *>((const MEDCouplingFieldDiscretization *)_type));
return ret;
}
void getCellIdsHavingGaussLocalization(int locId, std::vector<int>& cellIds) const throw(INTERP_KERNEL::Exception);
const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception);
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
// for MED file RW
int getNumberOfTuplesExpectedRegardingCode(const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
virtual void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) = 0;
{
}
-std::size_t MEDCouplingFieldDiscretization::getHeapMemorySize() const
+std::size_t MEDCouplingFieldDiscretization::getHeapMemorySizeWithoutChildren() const
{
return 0;
}
+std::vector<RefCountObject *> MEDCouplingFieldDiscretization::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
/*!
* Computes normL1 of DataArrayDouble instance arr.
* @param res output parameter expected to be of size arr->getNumberOfComponents();
updateTimeWith(*_discr_per_cell);
}
-std::size_t MEDCouplingFieldDiscretizationPerCell::getHeapMemorySize() const
+std::size_t MEDCouplingFieldDiscretizationPerCell::getHeapMemorySizeWithoutChildren() const
+{
+ std::size_t ret(MEDCouplingFieldDiscretization::getHeapMemorySizeWithoutChildren());
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDCouplingFieldDiscretizationPerCell::getDirectChildren() const
{
- std::size_t ret=0;
+ std::vector<RefCountObject *> ret(MEDCouplingFieldDiscretization::getDirectChildren());
if(_discr_per_cell)
- ret+=_discr_per_cell->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt *>(_discr_per_cell));
return ret;
}
return oss.str();
}
-std::size_t MEDCouplingFieldDiscretizationGauss::getHeapMemorySize() const
+std::size_t MEDCouplingFieldDiscretizationGauss::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=_loc.capacity()*sizeof(MEDCouplingGaussLocalization);
+ std::size_t ret(MEDCouplingFieldDiscretizationPerCell::getHeapMemorySizeWithoutChildren());
+ ret+=_loc.capacity()*sizeof(MEDCouplingGaussLocalization);
for(std::vector<MEDCouplingGaussLocalization>::const_iterator it=_loc.begin();it!=_loc.end();it++)
ret+=(*it).getHeapMemorySize();
- return MEDCouplingFieldDiscretizationPerCell::getHeapMemorySize()+ret;
+ return ret;
}
const char *MEDCouplingFieldDiscretizationGauss::getRepr() const
double getPrecision() const { return _precision; }
void setPrecision(double val) { _precision=val; }
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
static TypeOfField GetTypeOfFieldFromStringRepr(const char *repr) throw(INTERP_KERNEL::Exception);
virtual TypeOfField getEnum() const = 0;
virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const;
MEDCouplingFieldDiscretizationPerCell(const MEDCouplingFieldDiscretizationPerCell& other, int beginCellIds, int endCellIds, int stepCellIds);
~MEDCouplingFieldDiscretizationPerCell();
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArray *da) const throw(INTERP_KERNEL::Exception);
bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const;
bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const;
MEDCouplingFieldDiscretization *clonePartRange(int beginCellIds, int endCellIds, int stepCellIds) const;
std::string getStringRepr() const;
const char *getRepr() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
int getNumberOfTuplesExpectedRegardingCode(const MEDCouplingMesh *mesh, const std::vector<int>& code, const std::vector<const DataArrayInt *>& idsPerType) const throw(INTERP_KERNEL::Exception);
int getNumberOfTuples(const MEDCouplingMesh *mesh) const throw(INTERP_KERNEL::Exception);
int getNumberOfMeshPlaces(const MEDCouplingMesh *mesh) const;
updateTimeWith(*_time_discr);
}
-std::size_t MEDCouplingFieldDouble::getHeapMemorySize() const
+std::size_t MEDCouplingFieldDouble::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ return MEDCouplingField::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDCouplingFieldDouble::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDCouplingField::getDirectChildren());
if(_time_discr)
- ret+=_time_discr->getHeapMemorySize();
- return MEDCouplingField::getHeapMemorySize()+ret;
+ {
+ std::vector<RefCountObject *> ret2(_time_discr->getDirectChildren());
+ ret.insert(ret.end(),ret2.begin(),ret2.end());
+ }
+ return ret;
}
/*!
int getNumberOfTuples() const throw(INTERP_KERNEL::Exception);
int getNumberOfValues() const throw(INTERP_KERNEL::Exception);
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
//
void getTinySerializationIntInformation(std::vector<int>& tinyInfo) const;
void getTinySerializationDbleInformation(std::vector<double>& tinyInfo) const;
}
}
-std::size_t DataArray::getHeapMemorySize() const
+std::size_t DataArray::getHeapMemorySizeWithoutChildren() const
{
std::size_t sz1=_name.capacity();
std::size_t sz2=_info_on_compo.capacity();
return sz1+sz2+sz3;
}
+std::vector<RefCountObject *> DataArray::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
/*!
* Sets the attribute \a _name of \a this array.
* See \ref MEDCouplingArrayBasicsName "DataArrays infos" for more information.
_mem.destroy();
}
-std::size_t DataArrayDouble::getHeapMemorySize() const
+std::size_t DataArrayDouble::getHeapMemorySizeWithoutChildren() const
{
- std::size_t sz=_mem.getNbOfElemAllocated();
+ std::size_t sz(_mem.getNbOfElemAllocated());
sz*=sizeof(double);
- return DataArray::getHeapMemorySize()+sz;
+ return DataArray::getHeapMemorySizeWithoutChildren()+sz;
}
/*!
/*!
* This method \b do \b not modify content of \a this. It only modify its memory footprint if the allocated memory is to high regarding real data to store.
*
- * \sa DataArrayDouble::getHeapMemorySize, DataArrayDouble::reserve
+ * \sa DataArrayDouble::getHeapMemorySizeWithoutChildren, DataArrayDouble::reserve
*/
void DataArrayDouble::pack() const throw(INTERP_KERNEL::Exception)
{
_mem.destroy();
}
-std::size_t DataArrayInt::getHeapMemorySize() const
+std::size_t DataArrayInt::getHeapMemorySizeWithoutChildren() const
{
- std::size_t sz=_mem.getNbOfElemAllocated();
+ std::size_t sz(_mem.getNbOfElemAllocated());
sz*=sizeof(int);
- return DataArray::getHeapMemorySize()+sz;
+ return DataArray::getHeapMemorySizeWithoutChildren()+sz;
}
/*!
/*!
* This method \b do \b not modify content of \a this. It only modify its memory footprint if the allocated memory is to high regarding real data to store.
*
- * \sa DataArrayInt::getHeapMemorySize, DataArrayInt::reserve
+ * \sa DataArrayInt::getHeapMemorySizeWithoutChildren, DataArrayInt::reserve
*/
void DataArrayInt::pack() const throw(INTERP_KERNEL::Exception)
{
class DataArray : public RefCountObject, public TimeLabel
{
public:
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+ MEDCOUPLING_EXPORT std::vector<RefCountObject *> getDirectChildren() const;
MEDCOUPLING_EXPORT void setName(const char *name);
MEDCOUPLING_EXPORT void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom(const DataArray& other, const std::vector<int>& compoIds) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void desallocate() throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT int getNumberOfTuples() const throw(INTERP_KERNEL::Exception) { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); }
MEDCOUPLING_EXPORT std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception) { return _mem.getNbOfElem(); }
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT double doubleValue() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool empty() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT DataArrayDouble *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void desallocate() throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT int getNumberOfTuples() const throw(INTERP_KERNEL::Exception) { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); }
MEDCOUPLING_EXPORT std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception) { return _mem.getNbOfElem(); }
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT int intValue() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT int getHashCode() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool empty() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void desallocate() throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT int getNumberOfTuples() const throw(INTERP_KERNEL::Exception) { return _info_on_compo.empty()?0:_mem.getNbOfElem()/getNumberOfComponents(); }
MEDCOUPLING_EXPORT std::size_t getNbOfElems() const throw(INTERP_KERNEL::Exception) { return _mem.getNbOfElem(); }
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
MEDCOUPLING_EXPORT int getHashCode() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool empty() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void cpyFrom(const DataArrayChar& other) throw(INTERP_KERNEL::Exception);
_mem.destroy();
}
-std::size_t DataArrayChar::getHeapMemorySize() const
+std::size_t DataArrayChar::getHeapMemorySizeWithoutChildren() const
{
- std::size_t sz=_mem.getNbOfElemAllocated();
- return DataArray::getHeapMemorySize()+sz;
+ std::size_t sz(_mem.getNbOfElemAllocated());
+ return DataArray::getHeapMemorySizeWithoutChildren()+sz;
}
/*!
{
}
-std::size_t MEDCouplingMesh::getHeapMemorySize() const
+std::size_t MEDCouplingMesh::getHeapMemorySizeWithoutChildren() const
{
return _name.capacity()+_description.capacity()+_time_unit.capacity();
}
class MEDCOUPLING_EXPORT MEDCouplingMesh : public RefCountObject, public TimeLabel
{
public:
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
void setName(const char *name) { _name=name; }
std::string getName() const { return _name; }
void setDescription(const char *descr) { _description=descr; }
updateTimeWith(*(*it));
}
-std::size_t MEDCouplingMultiFields::getHeapMemorySize() const
+std::size_t MEDCouplingMultiFields::getHeapMemorySizeWithoutChildren() const
{
- std::vector<int> tmp;
- std::vector< std::vector<int> > tmp2;
- std::vector<MEDCouplingMesh *> ms=getDifferentMeshes(tmp);
- std::vector<DataArrayDouble *> arrs=getDifferentArrays(tmp2);
- std::size_t ret=0;
- for(std::vector<MEDCouplingMesh *>::const_iterator it=ms.begin();it!=ms.end();it++)
- if(*it)
- ret+=(*it)->getHeapMemorySize();
- for(std::vector<DataArrayDouble *>::const_iterator it=arrs.begin();it!=arrs.end();it++)
- if(*it)
- ret+=(*it)->getHeapMemorySize();
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDCouplingMultiFields::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> >::const_iterator it=_fs.begin();it!=_fs.end();it++)
+ {
+ const MEDCouplingFieldDouble *curF(*it);
+ if(curF)
+ ret.push_back(const_cast<MEDCouplingFieldDouble *>(curF));
+ }
return ret;
}
virtual std::vector<DataArrayDouble *> getArrays() const throw(INTERP_KERNEL::Exception);
virtual std::vector<DataArrayDouble *> getDifferentArrays(std::vector< std::vector<int> >& refs) const throw(INTERP_KERNEL::Exception);
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<double>& tinyInfo2, int& nbOfDiffMeshes, int& nbOfDiffArr) const;
void finishUnserialization(const std::vector<int>& tinyInfoI, const std::vector<double>& tinyInfoD,
const std::vector<MEDCouplingFieldTemplate *>& ft, const std::vector<MEDCouplingMesh *>& ms,
}
}
-std::size_t MEDCouplingPointSet::getHeapMemorySize() const
+std::size_t MEDCouplingPointSet::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ return MEDCouplingMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDCouplingPointSet::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
if(_coords)
- ret+=_coords->getHeapMemorySize();
- return MEDCouplingMesh::getHeapMemorySize()+ret;
+ ret.push_back(const_cast<DataArrayDouble *>(_coords));
+ return ret;
}
void MEDCouplingPointSet::setCoords(const DataArrayDouble *coords)
~MEDCouplingPointSet();
public:
void updateTime() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
int getNumberOfNodes() const;
int getSpaceDimension() const;
void setCoords(const DataArrayDouble *coords);
#include "MEDCouplingRefCountObject.hxx"
#include "MED_version.h"
+#include <set>
+
using namespace ParaMEDMEM;
const char *ParaMEDMEM::MEDCouplingVersionStr()
return *this;
}
+std::size_t RefCountObject::getHeapMemorySize() const
+{
+ std::size_t ret(getHeapMemorySizeWithoutChildren());
+ std::vector<RefCountObject *> v(getDirectChildren());
+ std::set<RefCountObject *> s1,s2(v.begin(),v.end());
+ while(!s2.empty())
+ {
+ std::set<RefCountObject *> s3;
+ for(std::set<RefCountObject *>::const_iterator it=s2.begin();it!=s2.end();it++)
+ {
+ if(s1.find(*it)==s1.end())
+ {
+ ret+=(*it)->getHeapMemorySizeWithoutChildren();
+ s1.insert(*it);
+ std::vector<RefCountObject *> v2((*it)->getDirectChildren());
+ for(std::vector<RefCountObject *>::const_iterator it2=v2.begin();it2!=v2.end();it2++)
+ if(s1.find(*it2)==s1.end())
+ s3.insert(*it2);
+ }
+ }
+ s2=s3;
+ }
+ return ret;
+}
+
bool RefCountObject::decrRef() const
{
bool ret=((--_cnt)==0);
#include "MEDCoupling.hxx"
+#include <vector>
#include <cstddef>
namespace ParaMEDMEM
MEDCOUPLING_EXPORT bool MEDCouplingByteOrder();
MEDCOUPLING_EXPORT const char *MEDCouplingByteOrderStr();
- class MEDCOUPLING_EXPORT RefCountObject
+ class RefCountObject
{
protected:
RefCountObject();
RefCountObject(const RefCountObject& other);
public:
- bool decrRef() const;
- void incrRef() const;
- virtual std::size_t getHeapMemorySize() const = 0;
- int getRCValue() const;
- RefCountObject& operator=(const RefCountObject& other);
+ MEDCOUPLING_EXPORT bool decrRef() const;
+ MEDCOUPLING_EXPORT void incrRef() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0;
+ MEDCOUPLING_EXPORT virtual std::vector<RefCountObject *> getDirectChildren() const = 0;
+ MEDCOUPLING_EXPORT int getRCValue() const;
+ MEDCOUPLING_EXPORT RefCountObject& operator=(const RefCountObject& other);
protected:
virtual ~RefCountObject();
private:
{
}
-std::size_t MEDCouplingStructuredMesh::getHeapMemorySize() const
+std::size_t MEDCouplingStructuredMesh::getHeapMemorySizeWithoutChildren() const
{
- return MEDCouplingMesh::getHeapMemorySize();
+ return MEDCouplingMesh::getHeapMemorySizeWithoutChildren();
}
void MEDCouplingStructuredMesh::copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception)
static void GetPosFromId(int nodeId, int meshDim, const int *split, int *res);
static INTERP_KERNEL::NormalizedCellType GetGeoTypeGivenMeshDimension(int meshDim) throw(INTERP_KERNEL::Exception);
void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception);
bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
//tools
updateTimeWith(*_array);
}
-std::size_t MEDCouplingTimeDiscretization::getHeapMemorySize() const
+std::size_t MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=_time_unit.capacity();
+ std::size_t ret(_time_unit.capacity());
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDCouplingTimeDiscretization::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
if(_array)
- ret+=_array->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayDouble *>(_array));
return ret;
}
_time_unit=tUnit;
}
-std::size_t MEDCouplingTwoTimeSteps::getHeapMemorySize() const
+std::size_t MEDCouplingTwoTimeSteps::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ return MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDCouplingTwoTimeSteps::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDCouplingTimeDiscretization::getDirectChildren());
if(_end_array)
- ret+=_end_array->getHeapMemorySize();
- return MEDCouplingTimeDiscretization::getHeapMemorySize()+ret;
+ ret.push_back(const_cast<DataArrayDouble *>(_end_array));
+ return ret;
}
void MEDCouplingTwoTimeSteps::copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception)
MEDCouplingTimeDiscretization(const MEDCouplingTimeDiscretization& other, bool deepCpy);
public:
void updateTime() const;
- virtual std::size_t getHeapMemorySize() const;
+ virtual std::size_t getHeapMemorySizeWithoutChildren() const;
+ virtual std::vector<RefCountObject *> getDirectChildren() const;
static MEDCouplingTimeDiscretization *New(TypeOfTimeDiscretization type) throw(INTERP_KERNEL::Exception);
void setTimeUnit(const char *unit) { _time_unit=unit; }
const char *getTimeUnit() const { return _time_unit.c_str(); }
public:
void updateTime() const;
void synchronizeTimeWith(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception);
const DataArrayDouble *getEndArray() const throw(INTERP_KERNEL::Exception);
setConnectivity(otherC2->getNodalConnectivity(),otherC2->getNodalConnectivityIndex(),true);
}
-std::size_t MEDCouplingUMesh::getHeapMemorySize() const
+std::size_t MEDCouplingUMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ std::size_t ret(MEDCouplingPointSet::getHeapMemorySizeWithoutChildren());
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDCouplingUMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDCouplingPointSet::getDirectChildren());
if(_nodal_connec)
- ret+=_nodal_connec->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt *>(_nodal_connec));
if(_nodal_connec_index)
- ret+=_nodal_connec_index->getHeapMemorySize();
- return MEDCouplingPointSet::getHeapMemorySize()+ret;
+ ret.push_back(const_cast<DataArrayInt *>(_nodal_connec_index));
+ return ret;
}
void MEDCouplingUMesh::updateTime() const
MEDCOUPLING_EXPORT MEDCouplingPointSet *deepCpyConnectivityOnly() const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT void updateTime() const;
- MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const;
+ MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+ MEDCOUPLING_EXPORT std::vector<RefCountObject *> getDirectChildren() const;
MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED; }
MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception);
MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const;
return ret.retn();
}
-std::size_t MEDFileData::getHeapMemorySize() const
+std::size_t MEDFileData::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDFileData::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
if((const MEDFileFields *)_fields)
- ret+=_fields->getHeapMemorySize();
+ ret.push_back(const_cast<MEDFileFields *>((const MEDFileFields *)_fields));
if((const MEDFileMeshes *)_meshes)
- ret+=_meshes->getHeapMemorySize();
+ ret.push_back(const_cast<MEDFileMeshes *>((const MEDFileMeshes *)_meshes));
if((const MEDFileParameters *)_params)
- ret+=_params->getHeapMemorySize();
+ ret.push_back(const_cast<MEDFileParameters *>((const MEDFileParameters *)_params));
return ret;
+
}
MEDFileFields *MEDFileData::getFields() const
static MEDFileData *New(const char *fileName) throw(INTERP_KERNEL::Exception);
static MEDFileData *New();
MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileFields *getFields() const;
MEDFileMeshes *getMeshes() const;
MEDFileParameters *getParams() const;
return new MEDFileFieldLoc(*this);
}
-std::size_t MEDFileFieldLoc::getHeapMemorySize() const
+std::size_t MEDFileFieldLoc::getHeapMemorySizeWithoutChildren() const
{
return (_ref_coo.capacity()+_gs_coo.capacity()+_w.capacity())*sizeof(double)+_name.capacity();
}
+std::vector<RefCountObject *> MEDFileFieldLoc::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
void MEDFileFieldLoc::simpleRepr(std::ostream& oss) const
{
static const char OFF7[]="\n ";
return new MEDFileFieldPerMeshPerTypePerDisc(other);
}
-std::size_t MEDFileFieldPerMeshPerTypePerDisc::getHeapMemorySize() const
+std::size_t MEDFileFieldPerMeshPerTypePerDisc::getHeapMemorySizeWithoutChildren() const
{
return _profile.capacity()+_localization.capacity()+5*sizeof(int);
}
+std::vector<RefCountObject *> MEDFileFieldPerMeshPerTypePerDisc::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
MEDFileFieldPerMeshPerTypePerDisc *MEDFileFieldPerMeshPerTypePerDisc::deepCpy(MEDFileFieldPerMeshPerType *father) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> ret=new MEDFileFieldPerMeshPerTypePerDisc(*this);
return new MEDFileFieldPerMeshPerType(fath,geoType);
}
-std::size_t MEDFileFieldPerMeshPerType::getHeapMemorySize() const
+std::size_t MEDFileFieldPerMeshPerType::getHeapMemorySizeWithoutChildren() const
+{
+ return _field_pm_pt_pd.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc>);
+}
+
+std::vector<RefCountObject *> MEDFileFieldPerMeshPerType::getDirectChildren() const
{
- std::size_t ret=_field_pm_pt_pd.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc>);
+ std::vector<RefCountObject *> ret;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldPerMeshPerTypePerDisc> >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++)
- ret+=(*it)->getHeapMemorySize();
+ {
+ const MEDFileFieldPerMeshPerTypePerDisc *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileFieldPerMeshPerTypePerDisc *>(cur));
+ }
return ret;
}
return new MEDFileFieldPerMesh(fath,mesh);
}
-std::size_t MEDFileFieldPerMesh::getHeapMemorySize() const
+std::size_t MEDFileFieldPerMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=_mesh_name.capacity()+_field_pm_pt.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType >);
+ return _mesh_name.capacity()+_field_pm_pt.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType >);
+}
+
+std::vector<RefCountObject *> MEDFileFieldPerMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++)
- if((const MEDFileFieldPerMeshPerType *)*it)
- ret+=(*it)->getHeapMemorySize();
+ {
+ const MEDFileFieldPerMeshPerType *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileFieldPerMeshPerType *>(cur));
+ }
return ret;
}
return new MEDFileFieldGlobs;
}
-std::size_t MEDFileFieldGlobs::getHeapMemorySize() const
+std::size_t MEDFileFieldGlobs::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=_file_name.capacity()+_pfls.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>)+_locs.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc>);
- for(std::vector< MEDCouplingAutoRefCountObjectPtr<DataArrayInt> >::const_iterator it=_pfls.begin();it!=_pfls.end();it++)
- ret+=(*it)->getHeapMemorySize();
+ return _file_name.capacity()+_pfls.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<DataArrayInt>)+_locs.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc>);
+}
+
+std::vector<RefCountObject *> MEDFileFieldGlobs::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr< DataArrayInt > >::const_iterator it=_pfls.begin();it!=_pfls.end();it++)
+ {
+ const DataArrayInt *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<DataArrayInt *>(cur));
+ }
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileFieldLoc> >::const_iterator it=_locs.begin();it!=_locs.end();it++)
- ret+=(*it)->getHeapMemorySize();
+ {
+ const MEDFileFieldLoc *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileFieldLoc *>(cur));
+ }
return ret;
}
{
}
-std::size_t MEDFileFieldGlobsReal::getHeapMemorySize() const
+std::size_t MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDFileFieldGlobsReal::getDirectChildren() const
{
- std::size_t ret=0;
+ std::vector<RefCountObject *> ret;
if((const MEDFileFieldGlobs *)_globals)
- ret+=_globals->getHeapMemorySize();
+ ret.push_back(const_cast<MEDFileFieldGlobs *>((const MEDFileFieldGlobs *)_globals));
return ret;
}
}
}
-std::size_t MEDFileAnyTypeField1TSWithoutSDA::getHeapMemorySize() const
+std::size_t MEDFileAnyTypeField1TSWithoutSDA::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=_dt_unit.capacity()+_field_per_mesh.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh >);
+ return _dt_unit.capacity()+_field_per_mesh.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh >);
+}
+
+std::vector<RefCountObject *> MEDFileAnyTypeField1TSWithoutSDA::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
if(getUndergroundDataArray())
- ret+=getUndergroundDataArray()->getHeapMemorySize();
+ ret.push_back(const_cast<DataArray *>(getUndergroundDataArray()));
for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++)
- ret+=(*it)->getHeapMemorySize();
+ {
+ const MEDFileFieldPerMesh *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileFieldPerMesh *>(cur));
+ }
return ret;
}
contentNotNullBase()->writeLL(fid,*this,*contentNotNullBase());
}
-std::size_t MEDFileAnyTypeField1TS::getHeapMemorySize() const
+std::size_t MEDFileAnyTypeField1TS::getHeapMemorySizeWithoutChildren() const
+{
+ return MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDFileAnyTypeField1TS::getDirectChildren() const
{
- std::size_t ret=0;
+ std::vector<RefCountObject *> ret(MEDFileFieldGlobsReal::getDirectChildren());
if((const MEDFileAnyTypeField1TSWithoutSDA *)_content)
- ret+=_content->getHeapMemorySize();
- return ret+MEDFileFieldGlobsReal::getHeapMemorySize();
+ ret.push_back(const_cast<MEDFileAnyTypeField1TSWithoutSDA *>((const MEDFileAnyTypeField1TSWithoutSDA *)_content));
+ return ret;
}
/*!
throw e;
}
-std::size_t MEDFileAnyTypeFieldMultiTSWithoutSDA::getHeapMemorySize() const
+std::size_t MEDFileAnyTypeFieldMultiTSWithoutSDA::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=_name.capacity()+_infos.capacity()*sizeof(std::string)+_time_steps.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutSDA>);
+ std::size_t ret(_name.capacity()+_infos.capacity()*sizeof(std::string)+_time_steps.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSWithoutSDA>));
for(std::vector<std::string>::const_iterator it=_infos.begin();it!=_infos.end();it++)
ret+=(*it).capacity();
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileAnyTypeFieldMultiTSWithoutSDA::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeField1TSWithoutSDA> >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++)
- if((const MEDFileAnyTypeField1TSWithoutSDA *)(*it))
- ret+=(*it)->getHeapMemorySize();
+ {
+ const MEDFileAnyTypeField1TSWithoutSDA *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileAnyTypeField1TSWithoutSDA *>(cur));
+ }
return ret;
}
return oss.str();
}
-std::size_t MEDFileAnyTypeFieldMultiTS::getHeapMemorySize() const
+std::size_t MEDFileAnyTypeFieldMultiTS::getHeapMemorySizeWithoutChildren() const
+{
+ return MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDFileAnyTypeFieldMultiTS::getDirectChildren() const
{
- std::size_t ret=0;
- if((const MEDFileAnyTypeFieldMultiTSWithoutSDA*)_content)
- ret+=_content->getHeapMemorySize();
- return ret+MEDFileFieldGlobsReal::getHeapMemorySize();
+ std::vector<RefCountObject *> ret(MEDFileFieldGlobsReal::getDirectChildren());
+ if((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content)
+ ret.push_back(const_cast<MEDFileAnyTypeFieldMultiTSWithoutSDA *>((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content));
+ return ret;
}
/*!
return new MEDFileFields(fileName,loadAll);
}
-std::size_t MEDFileFields::getHeapMemorySize() const
+std::size_t MEDFileFields::getHeapMemorySizeWithoutChildren() const
+{
+ std::size_t ret(MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren());
+ ret+=_fields.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA>);
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileFields::getDirectChildren() const
{
- std::size_t ret=_fields.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA>);
+ std::vector<RefCountObject *> ret;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> >::const_iterator it=_fields.begin();it!=_fields.end();it++)
- if((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)*it)
- ret+=(*it)->getHeapMemorySize();
- return ret+MEDFileFieldGlobsReal::getHeapMemorySize();
+ {
+ const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileAnyTypeFieldMultiTSWithoutSDA *>(cur));
+ }
+ return ret;
}
MEDFileFields *MEDFileFields::deepCpy() const throw(INTERP_KERNEL::Exception)
static MEDFileFieldLoc *New(med_idt fid, const char *locName);
static MEDFileFieldLoc *New(med_idt fid, int id);
static MEDFileFieldLoc *New(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector<double>& refCoo, const std::vector<double>& gsCoo, const std::vector<double>& w);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileFieldLoc *deepCpy() const;
int MEDLOADER_EXPORT getNbOfGaussPtPerCell() const { return _nb_gauss_pt; }
void MEDLOADER_EXPORT writeLL(med_idt fid) const;
static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int profileIt) throw(INTERP_KERNEL::Exception);
static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId);
static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileFieldPerMeshPerTypePerDisc *deepCpy(MEDFileFieldPerMeshPerType *father) const throw(INTERP_KERNEL::Exception);
void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
void assignFieldProfile(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) throw(INTERP_KERNEL::Exception);
public:
static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception);
static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileFieldPerMeshPerType *deepCpy(MEDFileFieldPerMesh *father) const throw(INTERP_KERNEL::Exception);
void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
void assignFieldProfile(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) throw(INTERP_KERNEL::Exception);
public:
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) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const throw(INTERP_KERNEL::Exception);
void simpleRepr(int bkOffset,std::ostream& oss, int id) const;
void copyTinyInfoFrom(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception);
public:
static MEDFileFieldGlobs *New(const char *fname);
static MEDFileFieldGlobs *New();
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileFieldGlobs *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDFileFieldGlobs *shallowCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const throw(INTERP_KERNEL::Exception);
MEDFileFieldGlobs *deepCpyPart(const std::vector<std::string>& pfls, const std::vector<std::string>& locs) const throw(INTERP_KERNEL::Exception);
public:
MEDFileFieldGlobsReal(const char *fname);
MEDFileFieldGlobsReal();
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void simpleReprGlobs(std::ostream& oss) const;
void resetContent();
void shallowCpyGlobs(const MEDFileFieldGlobsReal& other);
const std::vector<std::string>& getInfo() const;
std::vector<std::string>& getInfo();
void setInfo(const std::vector<std::string>& infos) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr) throw(INTERP_KERNEL::Exception);
void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception);
void setProfileNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newPflName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
//! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf
void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
std::vector<std::string> getPflsReallyUsed() const;
std::vector<std::string> getLocsReallyUsed() const;
std::vector<std::string> getPflsReallyUsedMulti() const;
MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll) throw(INTERP_KERNEL::Exception);
MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector<std::string>& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception);
public:
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const throw(INTERP_KERNEL::Exception);
virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitComponents() const throw(INTERP_KERNEL::Exception);
virtual std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileAnyTypeFieldMultiTSWithoutSDA> > splitDiscretizations() const throw(INTERP_KERNEL::Exception);
void unloadArrays() throw(INTERP_KERNEL::Exception);
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const throw(INTERP_KERNEL::Exception);
std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const throw(INTERP_KERNEL::Exception);
public:
static MEDFileFields *New();
static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception);
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
return new MEDFileMeshStruct(mesh);
}
-std::size_t MEDFileMeshStruct::getHeapMemorySize() const
+std::size_t MEDFileMeshStruct::getHeapMemorySizeWithoutChildren() const
{
std::size_t ret(0);
for(std::vector< std::vector<int> >::const_iterator it0=_geo_types_distrib.begin();it0!=_geo_types_distrib.end();it0++)
return ret;
}
+std::vector<RefCountObject *> MEDFileMeshStruct::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
MEDFileMeshStruct::MEDFileMeshStruct(const MEDFileMesh *mesh):_mesh(mesh)
{
std::vector<int> levs=mesh->getNonEmptyLevels();
//=
-std::size_t MEDMeshMultiLev::getHeapMemorySize() const
+std::size_t MEDMeshMultiLev::getHeapMemorySizeWithoutChildren() const
{
return 0;
}
+std::vector<RefCountObject *> MEDMeshMultiLev::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
MEDMeshMultiLev *MEDMeshMultiLev::New(const MEDFileMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception)
{
if(!m)
}
}
-std::size_t MEDFileField1TSStructItem2::getHeapMemorySize() const
+std::size_t MEDFileField1TSStructItem2::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret(0);
+ std::size_t ret(_loc.capacity());
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileField1TSStructItem2::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
const DataArrayInt *pfl(_pfl);
if(pfl)
- ret+=pfl->getHeapMemorySize();
- ret+=_loc.capacity();
+ ret.push_back(const_cast<DataArrayInt *>(pfl));
return ret;
}
return _items[i];
}
-std::size_t MEDFileField1TSStructItem::getHeapMemorySize() const
+std::size_t MEDFileField1TSStructItem::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret(0);
+ std::size_t ret(_items.size()*sizeof(MEDFileField1TSStructItem2));
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileField1TSStructItem::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
for(std::vector< MEDFileField1TSStructItem2 >::const_iterator it=_items.begin();it!=_items.end();it++)
- ret+=(*it).getHeapMemorySize();
- ret+=_items.size()*sizeof(MEDFileField1TSStructItem2);
+ ret.push_back(const_cast<MEDFileField1TSStructItem2 *>(&(*it)));
return ret;
}
return _already_checked[0].isNodeSupportEqual(other1,other);
}
-std::size_t MEDFileField1TSStruct::getHeapMemorySize() const
+std::size_t MEDFileField1TSStruct::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret(0);
+ std::size_t ret(_already_checked.capacity()*sizeof(MEDFileField1TSStructItem));
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileField1TSStruct::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
for(std::vector<MEDFileField1TSStructItem>::const_iterator it=_already_checked.begin();it!=_already_checked.end();it++)
- ret+=(*it).getHeapMemorySize();
- ret+=_already_checked.capacity()*sizeof(MEDFileField1TSStructItem);
+ ret.push_back(const_cast<MEDFileField1TSStructItem *>(&(*it)));
return ret;
}
}
}
-std::size_t MEDFileFastCellSupportComparator::getHeapMemorySize() const
+std::size_t MEDFileFastCellSupportComparator::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret(0);
+ std::size_t ret(_f1ts_cmps.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct>));
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileFastCellSupportComparator::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
const MEDFileMeshStruct *mst(_mesh_comp);
if(mst)
- ret+=mst->getHeapMemorySize();
+ ret.push_back(const_cast<MEDFileMeshStruct *>(mst));
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct> >::const_iterator it=_f1ts_cmps.begin();it!=_f1ts_cmps.end();it++)
{
const MEDFileField1TSStruct *cur(*it);
if(cur)
- ret+=cur->getHeapMemorySize()+sizeof(MEDFileField1TSStruct);
+ ret.push_back(const_cast<MEDFileField1TSStruct *>(cur));
}
- ret+=_f1ts_cmps.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileField1TSStruct>);
return ret;
}
{
public:
MEDLOADER_EXPORT static MEDFileMeshStruct *New(const MEDFileMesh *mesh);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
const MEDFileMesh *getTheMesh() const { return _mesh; }
int getNumberOfNodes() const { return _nb_nodes; }
int getNumberOfElemsOfGeoType(INTERP_KERNEL::NormalizedCellType t) const throw(INTERP_KERNEL::Exception);
class MEDMeshMultiLev : public RefCountObject
{
public:
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() 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) throw(INTERP_KERNEL::Exception);
static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector<int>& levs) throw(INTERP_KERNEL::Exception);
void checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception);
void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception);
//
- MEDLOADER_EXPORT std::size_t getHeapMemorySize() const;
+ MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+ MEDLOADER_EXPORT std::vector<RefCountObject *> getDirectChildren() const;
//
const DataArrayInt *getPfl(const MEDFileFieldGlobsReal *globs) const;
INTERP_KERNEL::NormalizedCellType getGeo() const { return _geo_type; }
MEDFileField1TSStructItem(TypeOfField a, const std::vector< MEDFileField1TSStructItem2 >& b);
void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception);
bool operator==(const MEDFileField1TSStructItem& other) const throw(INTERP_KERNEL::Exception);
- MEDLOADER_EXPORT std::size_t getHeapMemorySize() const;
+ MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const;
+ MEDLOADER_EXPORT std::vector<RefCountObject *> getDirectChildren() const;
bool isEntityCell() const;
bool isComputed() const { return _computed; }
TypeOfField getType() const { return _type; }
public:
static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst) throw(INTERP_KERNEL::Exception);
void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *mst) const throw(INTERP_KERNEL::Exception);
bool isSupportSameAs(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception);
MEDLOADER_EXPORT bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const throw(INTERP_KERNEL::Exception);
bool isEqual(const MEDFileAnyTypeFieldMultiTS *other) throw(INTERP_KERNEL::Exception);
bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeFieldMultiTS *other) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
private:
MEDFileFastCellSupportComparator(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref);
private:
{
}
-std::size_t MEDFileMesh::getHeapMemorySize() const
+std::size_t MEDFileMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=_dt_unit.capacity()+_name.capacity()+_univ_name.capacity()+_desc_name.capacity();
+ std::size_t ret(_dt_unit.capacity()+_name.capacity()+_univ_name.capacity()+_desc_name.capacity());
for(std::map<std::string, std::vector<std::string> >::const_iterator it=_groups.begin();it!=_groups.end();it++)
{
ret+=(*it).first.capacity()+(*it).second.capacity()*sizeof(std::string);
return ret;
}
+std::vector<RefCountObject *> MEDFileMesh::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
/*!
* Returns a new MEDFileMesh holding the mesh data that has been read from a given MED
* file. The first mesh in the file is loaded.
return new MEDFileUMesh;
}
-std::size_t MEDFileUMesh::getHeapMemorySize() const
+std::size_t MEDFileUMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=MEDFileMesh::getHeapMemorySize();
+ std::size_t ret(MEDFileMesh::getHeapMemorySizeWithoutChildren());
+ ret+=_ms.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1>));
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileUMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDFileMesh::getDirectChildren());
if((const DataArrayDouble*)_coords)
- ret+=_coords->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayDouble *>((const DataArrayDouble*)_coords));
if((const DataArrayInt *)_fam_coords)
- ret+=_fam_coords->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_fam_coords));
if((const DataArrayInt *)_num_coords)
- ret+=_num_coords->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_num_coords));
if((const DataArrayInt *)_rev_num_coords)
- ret+=_rev_num_coords->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_rev_num_coords));
if((const DataArrayAsciiChar *)_name_coords)
- ret+=_name_coords->getHeapMemorySize();
- ret+=_ms.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1>));
+ ret.push_back(const_cast<DataArrayAsciiChar *>((const DataArrayAsciiChar *)_name_coords));
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileUMeshSplitL1> >::const_iterator it=_ms.begin();it!=_ms.end();it++)
if((const MEDFileUMeshSplitL1*) *it)
- ret+=(*it)->getHeapMemorySize();
+ ret.push_back(const_cast<MEDFileUMeshSplitL1 *>((const MEDFileUMeshSplitL1*) *it));
return ret;
}
}
}
-std::size_t MEDFileStructuredMesh::getHeapMemorySize() const
+std::size_t MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=MEDFileMesh::getHeapMemorySize();
- if((const DataArrayInt*)_fam_nodes)
- ret+=_fam_nodes->getHeapMemorySize();
- if((const DataArrayInt*)_num_nodes)
- ret+=_num_nodes->getHeapMemorySize();
- if((const DataArrayInt*)_fam_cells)
- ret+=_fam_cells->getHeapMemorySize();
- if((const DataArrayInt*)_num_cells)
- ret+=_num_cells->getHeapMemorySize();
- if((const DataArrayInt*)_rev_num_nodes)
- ret+=_rev_num_nodes->getHeapMemorySize();
- if((const DataArrayInt*)_rev_num_cells)
- ret+=_rev_num_cells->getHeapMemorySize();
+ return MEDFileMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDFileStructuredMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDFileMesh::getDirectChildren());
+ if((const DataArrayInt *)_fam_nodes)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_fam_nodes));
+ if((const DataArrayInt *)_num_nodes)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_num_nodes));
+ if((const DataArrayInt *)_fam_cells)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_fam_cells));
+ if((const DataArrayInt *)_num_cells)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_num_nodes));
+ if((const DataArrayInt *)_rev_num_nodes)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_rev_num_nodes));
+ if((const DataArrayInt *)_rev_num_cells)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_rev_num_cells));
return ret;
}
return new MEDFileCMesh(fid,mName,dt,it,mrs);
}
-std::size_t MEDFileCMesh::getHeapMemorySize() const
+std::size_t MEDFileCMesh::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=MEDFileStructuredMesh::getHeapMemorySize();
+ return MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDFileCMesh::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret(MEDFileStructuredMesh::getDirectChildren());
if((const MEDCouplingCMesh *)_cmesh)
- ret+=_cmesh->getHeapMemorySize();
+ ret.push_back(const_cast<MEDCouplingCMesh *>((const MEDCouplingCMesh *)_cmesh));
return ret;
}
return new MEDFileCurveLinearMesh(fid,mName,dt,it,mrs);
}
-std::size_t MEDFileCurveLinearMesh::getHeapMemorySize() const
+std::size_t MEDFileCurveLinearMesh::getHeapMemorySizeWithoutChildren() const
+{
+ return MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren();
+}
+
+std::vector<RefCountObject *> MEDFileCurveLinearMesh::getDirectChildren() const
{
- std::size_t ret=MEDFileStructuredMesh::getHeapMemorySize();
+ std::vector<RefCountObject *> ret(MEDFileStructuredMesh::getDirectChildren());
if((const MEDCouplingCurveLinearMesh *)_clmesh)
- ret+=_clmesh->getHeapMemorySize();
+ ret.push_back(const_cast<MEDCouplingCurveLinearMesh *>((const MEDCouplingCurveLinearMesh *)_clmesh));
return ret;
}
return ret.retn();
}
-std::size_t MEDFileMeshMultiTS::getHeapMemorySize() const
+std::size_t MEDFileMeshMultiTS::getHeapMemorySizeWithoutChildren() const
+{
+ return _mesh_one_ts.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMesh>);
+}
+
+std::vector<RefCountObject *> MEDFileMeshMultiTS::getDirectChildren() const
{
- std::size_t ret=_mesh_one_ts.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMesh>);
+ std::vector<RefCountObject *> ret;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMesh> >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++)
- ret+=(*it)->getHeapMemorySize();
+ {
+ const MEDFileMesh *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileMesh *>(cur));
+ }
return ret;
}
return ret.retn();
}
-std::size_t MEDFileMeshes::getHeapMemorySize() const
+std::size_t MEDFileMeshes::getHeapMemorySizeWithoutChildren() const
+{
+ return _meshes.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS>));
+}
+
+std::vector<RefCountObject *> MEDFileMeshes::getDirectChildren() const
{
- std::size_t ret=_meshes.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS>));
+ std::vector<RefCountObject *> ret;
for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileMeshMultiTS> >::const_iterator it=_meshes.begin();it!=_meshes.end();it++)
- if((const MEDFileMeshMultiTS*)*it)
- ret+=(*it)->getHeapMemorySize();
- return ret;
+ {
+ const MEDFileMeshMultiTS *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDFileMeshMultiTS *>(cur));
+ }
+ return ret;
}
std::string MEDFileMeshes::simpleRepr() const
public:
static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception) = 0;
virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception) = 0;
virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0;
static MEDFileUMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileUMesh *New();
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
{
friend class MEDFileMesh;
public:
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception);
static MEDFileCMesh *New();
static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
static MEDFileCurveLinearMesh *New();
static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception);
MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception);
static MEDFileMeshMultiTS *New(const char *fileName) throw(INTERP_KERNEL::Exception);
static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception);
MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
std::string getName() const throw(INTERP_KERNEL::Exception);
void setName(const char *newMeshName) throw(INTERP_KERNEL::Exception);
bool changeNames(const std::vector< std::pair<std::string,std::string> >& modifTab) throw(INTERP_KERNEL::Exception);
static MEDFileMeshes *New();
static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception);
MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
std::string simpleRepr() const;
void simpleReprWithoutHeader(std::ostream& oss) const;
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
return new MEDFileUMeshPerType(fid,mName,dt,it,mdim,geoElt,geoElt2,whichEntity,mrs);
}
+std::size_t MEDFileUMeshPerType::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDFileUMeshPerType::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ if((const MEDCoupling1GTUMesh *)_m)
+ ret.push_back(const_cast<MEDCoupling1GTUMesh *>((const MEDCoupling1GTUMesh *)_m));
+ if((const DataArrayInt *)_num)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_num));
+ if((const DataArrayInt *)_fam)
+ ret.push_back(const_cast<DataArrayInt *>((const DataArrayInt *)_fam));
+ if((const DataArrayAsciiChar *)_names)
+ ret.push_back(const_cast<DataArrayAsciiChar *>((const DataArrayAsciiChar *)_names));
+ return ret;
+}
+
bool MEDFileUMeshPerType::isExisting(med_idt fid, const char *mName, int dt, int it, med_geometry_type geoElt, med_entity_type& whichEntity)
{
static const med_entity_type entities[3]={MED_CELL,MED_DESCENDING_FACE,MED_DESCENDING_EDGE};
public:
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 getHeapMemorySize() const { return 0; }
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
int getDim() const;
MEDCoupling1GTUMesh *getMesh() const { return const_cast<MEDCoupling1GTUMesh *>((const MEDCoupling1GTUMesh *)_m); }
const DataArrayInt *getFam() const { return _fam; }
{
}
+std::size_t MEDFileMeshL2::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDFileMeshL2::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
int MEDFileMeshL2::GetMeshIdFromName(med_idt fid, const char *mname, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1) throw(INTERP_KERNEL::Exception)
{
med_mesh_type type_maillage;
assignMesh(m,newOrOld);
}
-std::size_t MEDFileUMeshSplitL1::getHeapMemorySize() const
+std::size_t MEDFileUMeshSplitL1::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=0;
- ret+=_m_by_types.getHeapMemorySize();
+ return 0;
+}
+
+std::vector<RefCountObject *> MEDFileUMeshSplitL1::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ ret.push_back(const_cast<MEDFileUMeshAggregateCompute *>(&_m_by_types));
if((const DataArrayInt*)_fam)
- ret+=_fam->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt*>((const DataArrayInt*)_fam));
if((const DataArrayInt*)_num)
- ret+=_num->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt*>((const DataArrayInt*)_num));
if((const DataArrayInt*)_rev_num)
- ret+=_rev_num->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayInt*>((const DataArrayInt*)_rev_num));
if((const DataArrayAsciiChar*)_names)
- ret+=_names->getHeapMemorySize();
+ ret.push_back(const_cast<DataArrayAsciiChar*>((const DataArrayAsciiChar*)_names));
return ret;
}
return m->getTimeOfThis();
}
-/*!
- * Coordinates pointer is not counted because father instance already count it !
- */
-std::size_t MEDFileUMeshAggregateCompute::getHeapMemorySize() const
-{
- std::size_t ret(0);
- ret+=_m_parts.size()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh>);
- std::size_t sz(_m_parts.size());
- for(std::size_t i=0;i<sz;i++)
+std::size_t MEDFileUMeshAggregateCompute::getHeapMemorySizeWithoutChildren() const
+{
+ std::size_t ret(_m_parts.size()*sizeof(MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh>));
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileUMeshAggregateCompute::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDCoupling1GTUMesh> >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++)
{
- const MEDCoupling1GTUMesh *pt(_m_parts[i]);
- if(pt)
- {
- ret+=pt->getHeapMemorySize();
- const DataArrayDouble *coo(pt->getCoords());
- if(coo)
- ret-=coo->getHeapMemorySize();
- }
+ const MEDCoupling1GTUMesh *cur(*it);
+ if(cur)
+ ret.push_back(const_cast<MEDCoupling1GTUMesh *>(cur));
}
const MEDCouplingUMesh *m(_m);
if(m)
- {
- ret+=m->getHeapMemorySize();
- const DataArrayDouble *coo(m->getCoords());
- if(coo)
- ret-=coo->getHeapMemorySize();
- }
+ ret.push_back(const_cast<MEDCouplingUMesh *>(m));
return ret;
}
{
public:
MEDFileMeshL2();
- std::size_t getHeapMemorySize() const { return 0; }
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
const char *getName() const { return _name.getReprForWrite(); }
const char *getDescription() const { return _description.getReprForWrite(); }
const char *getUnivName() const { return _univ_name.getReprForWrite(); }
mutable MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> _m;
};
- class MEDFileUMeshAggregateCompute
+ class MEDFileUMeshAggregateCompute : public RefCountObject
{
public:
MEDFileUMeshAggregateCompute();
std::vector<MEDCoupling1GTUMesh *> getPartsWithoutComputation() const throw(INTERP_KERNEL::Exception);
MEDCoupling1GTUMesh *getPartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception);
std::size_t getTimeOfThis() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileUMeshAggregateCompute deepCpy(DataArrayDouble *coords) const;
bool isEqual(const MEDFileUMeshAggregateCompute& other, double eps, std::string& what) const;
void clearNonDiscrAttributes() const;
MEDFileUMeshSplitL1(const MEDFileUMeshL2& l2, const char *mName, int id);
MEDFileUMeshSplitL1(MEDCouplingUMesh *m);
MEDFileUMeshSplitL1(MEDCouplingUMesh *m, bool newOrOld);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileUMeshSplitL1 *deepCpy(DataArrayDouble *coords) const;
void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception);
bool isEqual(const MEDFileUMeshSplitL1 *other, double eps, std::string& what) const;
return true;
}
-std::size_t MEDFileParameterDouble1TSWTI::getHeapMemorySize() const
+std::size_t MEDFileParameterDouble1TSWTI::getHeapMemorySizeWithoutChildren() const
{
return sizeof(MEDFileParameterDouble1TSWTI);
}
+std::vector<RefCountObject *> MEDFileParameterDouble1TSWTI::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
std::string MEDFileParameterDouble1TSWTI::simpleRepr() const
{
std::ostringstream oss;
return oss.str();
}
-std::size_t MEDFileParameterDouble1TS::getHeapMemorySize() const
+std::size_t MEDFileParameterDouble1TS::getHeapMemorySizeWithoutChildren() const
{
return getHeapMemSizeOfStrings()+sizeof(MEDFileParameterDouble1TS);
}
+std::vector<RefCountObject *> MEDFileParameterDouble1TS::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
void MEDFileParameterDouble1TS::write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception)
{
med_access_mode medmod=MEDFileUtilities::TraduceWriteMode(mode);
}
}
-std::size_t MEDFileParameterMultiTS::getHeapMemorySize() const
+std::size_t MEDFileParameterMultiTS::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=sizeof(MEDFileParameterMultiTS);
- std::size_t ret2=sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS>)*_param_per_ts.capacity();
- for(std::size_t i=0;i<_param_per_ts.size();i++)
+ std::size_t ret(sizeof(MEDFileParameterMultiTS));
+ ret+=sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS>)*_param_per_ts.capacity();
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileParameterMultiTS::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameter1TS> >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++)
{
- const MEDFileParameter1TS *pt(_param_per_ts[i]);
- if(pt)
- ret2+=pt->getHeapMemorySize();
+ const MEDFileParameter1TS *elt(*it);
+ if(elt)
+ ret.push_back(const_cast<MEDFileParameter1TS *>(elt));
}
- return ret2+ret;
+ return ret;
}
MEDFileParameterMultiTS *MEDFileParameterMultiTS::deepCpy() const throw(INTERP_KERNEL::Exception)
{
}
-std::size_t MEDFileParameters::getHeapMemorySize() const
+std::size_t MEDFileParameters::getHeapMemorySizeWithoutChildren() const
{
- std::size_t ret=sizeof(MEDFileParameters);
- std::size_t ret2=sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS>)*_params.capacity();
- for(std::size_t i=0;i<_params.size();i++)
+ std::size_t ret(sizeof(MEDFileParameters));
+ ret+=sizeof(MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS>)*_params.capacity();
+ return ret;
+}
+
+std::vector<RefCountObject *> MEDFileParameters::getDirectChildren() const
+{
+ std::vector<RefCountObject *> ret;
+ for(std::vector< MEDCouplingAutoRefCountObjectPtr<MEDFileParameterMultiTS> >::const_iterator it=_params.begin();it!=_params.end();it++)
{
- const MEDFileParameterMultiTS *pt(_params[i]);
- if(pt)
- ret2+=pt->getHeapMemorySize();
+ const MEDFileParameterMultiTS *elt(*it);
+ if(elt)
+ ret.push_back(const_cast<MEDFileParameterMultiTS *>(elt));
}
- return ret2+ret;
+ return ret;
}
MEDFileParameters *MEDFileParameters::deepCpy() const throw(INTERP_KERNEL::Exception)
void setValue(double val) throw(INTERP_KERNEL::Exception) { _arr=val; }
double getValue() const throw(INTERP_KERNEL::Exception) { return _arr; }
bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void readValue(med_idt fid, const std::string& name) throw(INTERP_KERNEL::Exception);
std::string simpleRepr() const;
protected:
virtual MEDFileParameter1TS *deepCpy() const throw(INTERP_KERNEL::Exception);
virtual bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const;
virtual std::string simpleRepr() const;
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void setName(const char *name) throw(INTERP_KERNEL::Exception) { _name=name; }
std::string getName() const throw(INTERP_KERNEL::Exception) { return _name; }
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
static MEDFileParameterMultiTS *New(const char *fileName, const char *paramName) throw(INTERP_KERNEL::Exception);
std::string getName() const { return _name; }
void setName(const char *name) { _name=name; }
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception);
bool isEqual(const MEDFileParameterMultiTS *other, double eps, std::string& what) const;
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
public:
static MEDFileParameters *New();
static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception);
- std::size_t getHeapMemorySize() const;
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception);
bool isEqual(const MEDFileParameters *other, double eps, std::string& what) const;
void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception);
_fileReader->decrRef();
}
+std::size_t SauvReader::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<RefCountObject *> SauvReader::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
//================================================================================
/*!
* \brief Return current line of ASCII file to report an error
~SauvReader();
private:
- std::size_t getHeapMemorySize() const { return 0; }
-
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() const;
void readRecord2();
void readRecord4();
void readRecord7();
virtual double getDouble() const = 0;
virtual std::string getName() const = 0;
protected:
- std::size_t getHeapMemorySize() const { return 0; }
+ std::size_t getHeapMemorySizeWithoutChildren() const { return 0; }
+ std::vector<RefCountObject *> getDirectChildren() const { return std::vector<RefCountObject *>(); }
protected:
std::string _fileName, _curLocale;
int _iRead, _nbToRead;
return new SauvWriter;
}
+std::size_t SauvWriter::getHeapMemorySizeWithoutChildren() const
+{
+ return 0;
+}
+
+std::vector<RefCountObject *> SauvWriter::getDirectChildren() const
+{
+ return std::vector<RefCountObject *>();
+}
+
//================================================================================
/*!
* \brief Fills own DS by MEDFileData
void write(const char* fileName);
private:
- std::size_t getHeapMemorySize() const { return 0; }
+ std::size_t getHeapMemorySizeWithoutChildren() const;
+ std::vector<RefCountObject *> getDirectChildren() 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.