Correct design for producer/consumer in StateItemExtension #3264
Labels
0 Diff
The changes in this pull request have verified to be zero-diff with the target branch.
📈 MAPL3
MAPL 3 Related
🛠️ Refactor
This is code refactoring
Currently extensions have an allocatable "producer" and a Map of pointers to "consumers". This is convenient because it allows the procedure that creates a new spec and a producer to immediately bind them into a new extension, but ultimately the ownership is wrong.
The main problem is that it import specs need to share the producer with the "ultimate" extension, and as an ALLOCATABLE they cannot share. But if we reverse the design, to have an extension have a map of (allocatable) consumers and only a pointer to the producer, this problem is fixed.
The fix will also allow a cleaner implementation for the loops that identify all import and export couplers for a given component:
The text was updated successfully, but these errors were encountered: