}
}
//
- ret->incrRef();
- return ret;
+ return ret.retn();
}
/*!
m2->setName(mesh->getName());
MEDCouplingAutoRefCountObjectPtr<MEDCouplingFieldDouble> ret=finishField(type,glob,dads,locs,m2,isPfl);
isPfl=true;
- ret->incrRef();
- return ret;
+ return ret.retn();
}
/*!
meshuc->finishInsertingCells();
ret->setMesh(meshuc);
ret->checkCoherency();
- ret->incrRef();
- return ret;
+ return ret.retn();
}
}
//
ret->getArray()->renumberInPlace(da3->getConstPointer());
mesh2->setName(mesh->getName());
ret->setMesh(mesh2);
- ret->incrRef();
- return ret;
+ return ret.retn();
}
else
{
for(int i=0;i<nbOfComp;i++)
da->setInfoOnComponent(i,infos[i].c_str());
safePfl->incrRef();
- da->incrRef();
- return da;
+ return da.retn();
}
MEDFileFieldPerMesh::MEDFileFieldPerMesh(med_idt fid, MEDFileField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder) throw(INTERP_KERNEL::Exception):_mesh_iteration(meshIteration),_mesh_order(meshOrder),
case 0:
{
//no need to test _field_per_mesh.empty() because geMeshName has already done it
- ret->incrRef();
- return ret;
+ return ret.retn();
}
case 3:
case 1:
ret->renumberCells(cellRenum->getConstPointer(),true);
}
if(renumPol==1)
- {
- ret->incrRef();
- return ret;
- }
+ return ret.retn();
}
case 2:
{
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> nodeRenumSafe=nodeRenum->checkAndPreparePermutation();
ret->renumberNodes(nodeRenumSafe->getConstPointer());
}
- ret->incrRef();
- return ret;
+ return ret.retn();
}
default:
throw INTERP_KERNEL::Exception("MEDFileField1TSWithoutSDA::getFieldOnMeshAtLevel : unsupported renum policy ! Dealing with policy 0 1 2 and 3 !");
const MEDFileField1TSWithoutSDA *item=_content->getTimeStepAtPos2(pos);
MEDCouplingAutoRefCountObjectPtr<MEDFileField1TS> ret=MEDFileField1TS::New(*item,false);
ret->shallowCpyGlobs(*this);
- ret->incrRef();
- return ret;
+ return ret.retn();
}
MEDFileField1TS *MEDFileFieldMultiTS::getTimeStep(int iteration, int order) const throw(INTERP_KERNEL::Exception)
const MEDFileFieldMultiTSWithoutSDA *fmts=_fields[i];
MEDCouplingAutoRefCountObjectPtr<MEDFileFieldMultiTS> ret=MEDFileFieldMultiTS::New(*fmts,false);
ret->shallowCpyGlobs(*this);
- ret->incrRef();
- return ret;
+ return ret.retn();
}
MEDFileFieldMultiTS *MEDFileFields::getFieldWithName(const char *fieldName) const throw(INTERP_KERNEL::Exception)
{
MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret=MEDFileUMesh::New();
ret->loadUMeshFromFile(fid,ms.front().c_str(),dt,it);
- ret->incrRef();
- return (MEDFileUMesh *)ret;
+ return (MEDFileUMesh *)ret.retn();
}
case CARTESIAN:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> ret=MEDFileCMesh::New();
ret->loadCMeshFromFile(fid,ms.front().c_str(),dt,it);
- ret->incrRef();
- return (MEDFileCMesh *)ret;
+ return (MEDFileCMesh *)ret.retn();
}
default:
{
{
MEDCouplingAutoRefCountObjectPtr<MEDFileUMesh> ret=MEDFileUMesh::New();
ret->loadUMeshFromFile(fid,mName,dt,it);
- ret->incrRef();
- return (MEDFileUMesh *)ret;
+ return (MEDFileUMesh *)ret.retn();
}
case CARTESIAN:
{
MEDCouplingAutoRefCountObjectPtr<MEDFileCMesh> ret=MEDFileCMesh::New();
ret->loadCMeshFromFile(fid,mName,dt,it);
- ret->incrRef();
- return (MEDFileCMesh *)ret;
+ return (MEDFileCMesh *)ret.retn();
}
default:
{
v.insert((*it).second);
ret->alloc((int)v.size(),1);
std::copy(v.begin(),v.end(),ret->getPointer());
- ret->incrRef(); return ret;
+ return ret.retn();
}
/*!
MEDCouplingAutoRefCountObjectPtr<MEDCouplingUMesh> ret=MEDCouplingUMesh::New();
MEDCouplingAutoRefCountObjectPtr<DataArrayDouble> c=_coords->selectByTupleId(arr->getConstPointer(),arr->getConstPointer()+arr->getNbOfElems());
ret->setCoords(c);
- ret->incrRef();
- return ret;
+ return ret.retn();
}
std::vector<int> famIds=getFamiliesIds(fams);
const MEDFileUMeshSplitL1 *l1=getMeshAtLevSafe(meshDimRelToMaxExt);
if(renum)
return MEDFileUMeshSplitL1::Renumber(_num_coords,da);
else
- {
- da->incrRef();
- return da;
- }
+ return da.retn();
}
else
throw INTERP_KERNEL::Exception("MEDFileUMesh::getFamiliesArr : no family array specified on nodes !");
newFam->setPartOfValuesSimple1(0,nbNodes,newNbOfNodes,1,0,1,1);
_fam_coords=newFam;
}
- nodesDuplicated=nodeIdsToDuplicate; nodeIdsToDuplicate->incrRef();
- cellsModified=cellsToModifyConn0; cellsToModifyConn0->incrRef();
- cellsNotModified=cellsToModifyConn1; cellsToModifyConn1->incrRef();
+ nodesDuplicated=nodeIdsToDuplicate.retn();
+ cellsModified=cellsToModifyConn0.retn();
+ cellsNotModified=cellsToModifyConn1.retn();
}
/*!
{
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> renumCells=DataArrayInt::Aggregate(renumCellsSplited);
MEDCouplingAutoRefCountObjectPtr<DataArrayInt> o2nRenumCellRet=renumCells->buildPermArrPerLevel();
- o2nRenumCell=o2nRenumCellRet; o2nRenumCellRet->incrRef();
+ o2nRenumCell=o2nRenumCellRet.retn();
}
return ret;
}
if(renum)
return MEDFileUMeshSplitL1::Renumber(_num_nodes,da);
else
- {
- da->incrRef();
- return da;
- }
+ return da.retn();
}
else
throw INTERP_KERNEL::Exception("MEDFileCMesh::getFamiliesArr : no family array specified on nodes !");
if(renum)
return MEDFileUMeshSplitL1::Renumber(_num_cells,da);
else
- {
- da->incrRef();
- return da;
- }
+ return da.retn();
}
else
throw INTERP_KERNEL::Exception("MEDFileCMesh::getFamiliesArr : no family array specified on cells !");