Change API for PdmObjectHandle and PdmFieldHandle

* Refactor interface to PdmObjectHandle and PdmFieldHandle
Return objects instead of passing in structures as parameters

* Add nodiscard to several functions
* Remove redundant this->
* Rename to ptrReferencedObjectsByType
This commit is contained in:
Magne Sjaastad
2023-05-12 21:41:34 +02:00
committed by GitHub
parent 37e29a0f68
commit 0c90f67dcc
510 changed files with 1651 additions and 3111 deletions

View File

@@ -163,8 +163,7 @@ void RicCloseCaseFeature::deleteEclipseCase( RimEclipseCase* eclipseCase )
// This is done because the views do not work well
if ( caseGroup->caseCollection()->reservoirs.size() == 1 )
{
std::vector<caf::PdmObjectHandle*> children;
caseGroup->statisticsCaseCollection()->reservoirs.children( &children );
std::vector<caf::PdmObjectHandle*> children = caseGroup->statisticsCaseCollection()->reservoirs.children();
for ( size_t i = children.size(); i-- > 0; )
{
@@ -257,8 +256,7 @@ bool RicCloseCaseFeature::userConfirmedGridCaseGroupChange( const std::vector<Ri
for ( auto caseToDelete : casesToBeDeleted )
{
RimIdenticalGridCaseGroup* gridCaseGroup = nullptr;
caseToDelete->firstAncestorOrThisOfType( gridCaseGroup );
RimIdenticalGridCaseGroup* gridCaseGroup = caseToDelete->firstAncestorOrThisOfType<RimIdenticalGridCaseGroup>();
if ( gridCaseGroup && hasAnyStatisticsResults( gridCaseGroup ) )
{