2012-05-18 02:45:23 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
|
|
|
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -05:00
|
|
|
// ResInsight is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
2012-05-18 02:45:23 -05:00
|
|
|
// ResInsight is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE.
|
2019-09-06 03:40:57 -05:00
|
|
|
//
|
|
|
|
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
|
2012-05-18 02:45:23 -05:00
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-06-26 09:10:41 -05:00
|
|
|
#include "RifEclipseRestartDataAccess.h"
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
/// Constructor
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RifEclipseRestartDataAccess::RifEclipseRestartDataAccess()
|
|
|
|
{
|
|
|
|
}
|
2012-05-18 02:45:23 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
/// Destructor
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2020-02-12 04:13:38 -06:00
|
|
|
RifEclipseRestartDataAccess::~RifEclipseRestartDataAccess()
|
|
|
|
{
|
|
|
|
}
|
2016-07-14 06:35:32 -05:00
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-07-14 06:35:32 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-05-09 04:41:56 -05:00
|
|
|
void RifRestartReportKeywords::appendKeywordCount( const std::string& keyword, size_t valueCount, RifKeywordValueCount::KeywordDataType dataType )
|
2020-02-12 04:13:38 -06:00
|
|
|
{
|
2023-05-09 04:41:56 -05:00
|
|
|
auto it = m_keywordValueCounts.find( keyword );
|
2016-07-14 06:35:32 -05:00
|
|
|
|
2023-05-09 04:41:56 -05:00
|
|
|
if ( it == m_keywordValueCounts.end() )
|
2016-07-14 06:35:32 -05:00
|
|
|
{
|
2023-05-09 04:41:56 -05:00
|
|
|
m_keywordValueCounts[keyword] = RifKeywordValueCount( keyword, valueCount, dataType );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
it->second.addValueCount( valueCount );
|
2016-07-14 06:35:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-07-14 06:35:32 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-05-09 04:41:56 -05:00
|
|
|
void RifRestartReportKeywords::appendKeywordCount( const RifRestartReportKeywords& other )
|
2016-07-14 06:35:32 -05:00
|
|
|
{
|
2023-05-09 04:41:56 -05:00
|
|
|
for ( const auto& [keyword, keywordInfo] : other.m_keywordValueCounts )
|
2016-07-14 06:35:32 -05:00
|
|
|
{
|
2023-05-09 04:41:56 -05:00
|
|
|
appendKeywordCount( keyword, keywordInfo.valueCount(), keywordInfo.dataType() );
|
2016-07-14 06:35:32 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
///
|
2016-07-14 06:35:32 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
2023-05-09 04:41:56 -05:00
|
|
|
std::vector<RifKeywordValueCount> RifRestartReportKeywords::keywordValueCounts() const
|
2016-07-14 06:35:32 -05:00
|
|
|
{
|
2023-05-09 04:41:56 -05:00
|
|
|
std::vector<RifKeywordValueCount> tmp;
|
|
|
|
for ( const auto& [keyword, info] : m_keywordValueCounts )
|
2016-07-14 06:35:32 -05:00
|
|
|
{
|
2023-05-09 04:41:56 -05:00
|
|
|
tmp.push_back( info );
|
2016-07-14 06:35:32 -05:00
|
|
|
}
|
2023-05-09 04:41:56 -05:00
|
|
|
return tmp;
|
2016-07-14 06:35:32 -05:00
|
|
|
}
|