Use raw pointers in file readers to avoid circular references

p4#: 20826
This commit is contained in:
Magne Sjaastad
2013-03-08 08:24:40 +01:00
parent d4a28126d1
commit f6fa801607
4 changed files with 9 additions and 8 deletions

View File

@@ -207,6 +207,7 @@ RifReaderEclipseOutput::RifReaderEclipseOutput()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
RifReaderEclipseOutput::~RifReaderEclipseOutput() RifReaderEclipseOutput::~RifReaderEclipseOutput()
{ {
close();
} }
@@ -440,7 +441,7 @@ bool RifReaderEclipseOutput::openAndReadActiveCellData(const QString& fileName,
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RifReaderEclipseOutput::readActiveCellInfo() bool RifReaderEclipseOutput::readActiveCellInfo()
{ {
CVF_ASSERT(m_eclipseCase.notNull()); CVF_ASSERT(m_eclipseCase);
CVF_ASSERT(m_eclipseCase->mainGrid()); CVF_ASSERT(m_eclipseCase->mainGrid());
QString egridFileName = RifEclipseOutputFileTools::fileNameByType(m_fileSet, ECL_EGRID_FILE); QString egridFileName = RifEclipseOutputFileTools::fileNameByType(m_fileSet, ECL_EGRID_FILE);
@@ -521,7 +522,7 @@ bool RifReaderEclipseOutput::readActiveCellInfo()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RifReaderEclipseOutput::buildMetaData() bool RifReaderEclipseOutput::buildMetaData()
{ {
CVF_ASSERT(m_eclipseCase.notNull()); CVF_ASSERT(m_eclipseCase);
CVF_ASSERT(m_fileSet.size() > 0); CVF_ASSERT(m_fileSet.size() > 0);
caf::ProgressInfo progInfo(m_fileSet.size() + 3,""); caf::ProgressInfo progInfo(m_fileSet.size() + 3,"");
@@ -712,7 +713,7 @@ bool RifReaderEclipseOutput::dynamicResult(const QString& result, PorosityModelR
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
void RifReaderEclipseOutput::readWellCells() void RifReaderEclipseOutput::readWellCells()
{ {
CVF_ASSERT(m_eclipseCase.notNull()); CVF_ASSERT(m_eclipseCase);
if (m_dynamicResultsAccess.isNull()) return; if (m_dynamicResultsAccess.isNull()) return;

View File

@@ -71,7 +71,7 @@ private:
QString m_fileName; // Name of file used to start accessing Eclipse output files QString m_fileName; // Name of file used to start accessing Eclipse output files
QStringList m_fileSet; // Set of files in filename's path with same base name as filename QStringList m_fileSet; // Set of files in filename's path with same base name as filename
cvf::ref<RigEclipseCase> m_eclipseCase; RigEclipseCase* m_eclipseCase;
QList<QDateTime> m_timeSteps; QList<QDateTime> m_timeSteps;

View File

@@ -96,7 +96,7 @@ void RifReaderMockModel::close()
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RifReaderMockModel::inputProperty(const QString& propertyName, std::vector<double>* values) bool RifReaderMockModel::inputProperty(const QString& propertyName, std::vector<double>* values)
{ {
return m_reservoirBuilder.inputProperty(m_reservoir.p(), propertyName, values); return m_reservoirBuilder.inputProperty(m_reservoir, propertyName, values);
} }
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
@@ -104,7 +104,7 @@ bool RifReaderMockModel::inputProperty(const QString& propertyName, std::vector<
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RifReaderMockModel::staticResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, std::vector<double>* values) bool RifReaderMockModel::staticResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, std::vector<double>* values)
{ {
m_reservoirBuilder.staticResult(m_reservoir.p(), result, values); m_reservoirBuilder.staticResult(m_reservoir, result, values);
return true; return true;
} }
@@ -114,7 +114,7 @@ bool RifReaderMockModel::staticResult(const QString& result, RifReaderInterface:
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
bool RifReaderMockModel::dynamicResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values) bool RifReaderMockModel::dynamicResult(const QString& result, RifReaderInterface::PorosityModelResultType matrixOrFracture, size_t stepIndex, std::vector<double>* values)
{ {
m_reservoirBuilder.dynamicResult(m_reservoir.p(), result, stepIndex, values); m_reservoirBuilder.dynamicResult(m_reservoir, result, stepIndex, values);
return true; return true;
} }

View File

@@ -44,6 +44,6 @@ private:
bool inputProperty( const QString& propertyName, std::vector<double>* values ); bool inputProperty( const QString& propertyName, std::vector<double>* values );
RigReservoirBuilderMock m_reservoirBuilder; RigReservoirBuilderMock m_reservoirBuilder;
cvf::ref<RigEclipseCase> m_reservoir; RigEclipseCase* m_reservoir;
}; };