Skip to content

Commit

Permalink
Add some friends to protect direct access to internal cell storage
Browse files Browse the repository at this point in the history
  • Loading branch information
jonjenssen committed Oct 25, 2024
1 parent 19bf09d commit 2228b67
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ApplicationLibCode/ReservoirDataModel/RigActiveCellGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class RigActiveCellGrid : public RigMainGrid
size_t totalCellCount() const override;
size_t totalActiveCellCount() const;

public: // only for use by file readers!
protected: // only for use by file readers!
friend class RifReaderOpmCommonActive;
std::map<size_t, RigCell>& nativeCells();
const std::map<size_t, RigCell>& nativeCells() const;
void setTotalCellCount( size_t totalCellCount );
Expand Down
11 changes: 10 additions & 1 deletion ApplicationLibCode/ReservoirDataModel/RigMainGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,16 @@ class RigMainGrid : public RigGridBase
bool isDualPorosity() const;
void setDualPorosity( bool enable );

public: // only for use by file readers!
protected: // only for use by file readers and internal services. TODO: replace with a better API
friend class RigGridBase;
friend class RigReservoirBuilder;
friend class RifRoffFileTools;
friend class RifEclipseOutputFileTools;
friend class RifReaderEclipseOutput;
friend class RifReaderOpmCommon;
friend class RiaGrpcCaseService;
friend class RiaActiveCellInfoStateHandler;
friend class RicCreateTemporaryLgrFeature;
std::vector<RigCell>& reservoirCells();
const std::vector<RigCell>& reservoirCells() const;

Expand Down

0 comments on commit 2228b67

Please sign in to comment.