{
}
-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