mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Cached result variables in the summary reader
Fixed late field initialization Additional cleanup and rename
This commit is contained in:
@@ -47,7 +47,10 @@ RifReaderEclipseSummary::~RifReaderEclipseSummary()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RifReaderEclipseSummary::open(const std::string& headerFileName, const std::vector<std::string>& dataFileNames)
|
||||
{
|
||||
assert(ecl_sum == NULL);
|
||||
assert(ecl_sum == NULL);
|
||||
|
||||
if (headerFileName.empty() || dataFileNames.size() == 0) return false;
|
||||
|
||||
assert(!headerFileName.empty());
|
||||
assert(dataFileNames.size() > 0);
|
||||
|
||||
@@ -106,17 +109,18 @@ std::vector<std::string> RifReaderEclipseSummary::variableNames() const
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
std::vector<RifEclipseSummaryAddress> RifReaderEclipseSummary::allResultAddresses() const
|
||||
const std::vector<RifEclipseSummaryAddress>& RifReaderEclipseSummary::allResultAddresses()
|
||||
{
|
||||
std::vector<RifEclipseSummaryAddress> addresses;
|
||||
|
||||
std::vector<std::string> fileVariableNames = variableNames();
|
||||
for (size_t i = 0; i < fileVariableNames.size(); i++)
|
||||
if (m_allResultAddresses.size() == 0)
|
||||
{
|
||||
addresses.push_back(RifEclipseSummaryAddress(fileVariableNames[i]));
|
||||
std::vector<std::string> fileVariableNames = variableNames();
|
||||
for(size_t i = 0; i < fileVariableNames.size(); i++)
|
||||
{
|
||||
m_allResultAddresses.push_back(RifEclipseSummaryAddress(fileVariableNames[i]));
|
||||
}
|
||||
}
|
||||
|
||||
return addresses;
|
||||
return m_allResultAddresses;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
|
@@ -23,20 +23,17 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "cvfObject.h"
|
||||
|
||||
|
||||
class QDateTime;
|
||||
|
||||
// Taken from ecl_sum.h
|
||||
typedef struct ecl_sum_struct ecl_sum_type;
|
||||
|
||||
// Taken from stringlist.h
|
||||
typedef struct stringlist_struct stringlist_type;
|
||||
|
||||
//==================================================================================================
|
||||
//
|
||||
//
|
||||
//==================================================================================================
|
||||
class RifReaderEclipseSummary
|
||||
class RifReaderEclipseSummary : public cvf::Object
|
||||
{
|
||||
public:
|
||||
RifReaderEclipseSummary();
|
||||
@@ -46,7 +43,7 @@ public:
|
||||
void close();
|
||||
|
||||
std::vector<std::string> variableNames() const;
|
||||
std::vector<RifEclipseSummaryAddress> allResultAddresses() const;
|
||||
const std::vector<RifEclipseSummaryAddress>& allResultAddresses();
|
||||
|
||||
std::vector<time_t> timeSteps() const;
|
||||
|
||||
@@ -61,8 +58,14 @@ private:
|
||||
|
||||
int timeStepCount() const;
|
||||
|
||||
// Taken from stringlist.h
|
||||
typedef struct stringlist_struct stringlist_type;
|
||||
static void populateVectorFromStringList(stringlist_type* stringList, std::vector<std::string>* strings);
|
||||
|
||||
private:
|
||||
// Taken from ecl_sum.h
|
||||
typedef struct ecl_sum_struct ecl_sum_type;
|
||||
ecl_sum_type* ecl_sum;
|
||||
std::vector<RifEclipseSummaryAddress> m_allResultAddresses;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user