Skip to content

More pdm object collections#13985

Merged
kriben merged 5 commits into
devfrom
more-pdm-object-collections
May 11, 2026
Merged

More pdm object collections#13985
kriben merged 5 commits into
devfrom
more-pdm-object-collections

Conversation

@kriben
Copy link
Copy Markdown
Collaborator

@kriben kriben commented May 8, 2026

No description provided.

kriben added 2 commits May 8, 2026 14:50
RimEnsembleFileSetCollection, RimJobCollection, RimQuickAccessCollection,
RimRefinementRegionCollection and RimFractureTemplateCollection now inherit
from the templated caf::PdmObjectCollection<T> base, reusing the shared
add/insert/delete/items plumbing introduced for RimValveTemplateCollection.

XML field keywords are preserved on every collection so existing project
files continue to load.
…on<T>

Migrated to the templated base, preserving each collection's existing XML
field keyword for project-file backward compatibility:

- RimEnsembleFractureStatisticsCollection
- RimEclipseInputPropertyCollection
- RimPlotDataFilterCollection
- RimGeoMechContourMapViewCollection
- RimIntersectionResultsDefinitionCollection
- RimCustomObjectiveFunctionCollection
- RimStimPlanModelTemplateCollection
- RimEnsembleWellLogsCollection
- RimEclipseContourMapViewCollection
- RimSeismicViewCollection
- RimGridInfoCollection
- RimEclipseStatisticsCaseCollection
- RimWellIASettingsCollection
- RimVfpDataCollection

External callers that accessed the old public/named array fields directly
(RimEclipseInputPropertyCollection::inputProperties,
RimEclipseStatisticsCaseCollection::cases) now use addItem/items() from
the base. RimCustomObjectiveFunction.h replaced its include of the
collection header with a forward declaration to break the new include
cycle introduced by the migration.
@kriben kriben requested a review from magnesj May 8, 2026 13:44
@kriben kriben marked this pull request as ready for review May 8, 2026 13:44
@jonjenssen
Copy link
Copy Markdown
Collaborator

jonjenssen commented May 8, 2026

Is there a way to avoid the #include statements for the object type that the collection is used for? Previously there used to be only forward defines in the collection header file, i.e.

class RimGenericJob;

not

#include "RimGenericJob.h"

magnesj added 2 commits May 9, 2026 14:05
Replace the class-level static_assert with a DerivedFromPdmObject concept
checked inside the constructor body. The constructor is lazily instantiated,
so T can be forward-declared at the point PdmObjectCollection<T> is used
as a base class.
Move the RimGenericJob include from the header to the .cpp now that
PdmObjectCollection<T> permits forward-declared template parameters.
@magnesj
Copy link
Copy Markdown
Member

magnesj commented May 9, 2026

Is there a way to avoid the #include statements for the object type that the collection is used for? Previously there used to be only forward defines in the collection header file, i.e.

class RimGenericJob;

not

#include "RimGenericJob.h"

Yes, this is possible. I fixed this during work with the nested collections. Added two commits that fixes this issue.

Move the element-type include from each migrated collection header into
its .cpp, leaving only a forward declaration in the header. Follows the
pattern from 9e4d791 for RimJobCollection, made possible by the
constructor-time PdmObject base check.
@kriben kriben merged commit 2fa7520 into dev May 11, 2026
19 checks passed
@kriben kriben deleted the more-pdm-object-collections branch May 11, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants