Changed return value of RifOdbReader::stepFrame()

Made sure that RifOdbReader::stepFrame() returns a const reference to
the given frame.
This commit is contained in:
Stein Dale 2015-06-03 11:15:05 +02:00
parent 4e61f0774b
commit fd571091b4
2 changed files with 6 additions and 6 deletions

View File

@ -443,14 +443,14 @@ std::map<std::string, std::vector<std::string> > RifOdbReader::scalarIntegration
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
/// ///
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
odb_Frame RifOdbReader::stepFrame(int stepIndex, int frameIndex) const const odb_Frame& RifOdbReader::stepFrame(int stepIndex, int frameIndex) const
{ {
CVF_ASSERT(m_odb); CVF_ASSERT(m_odb);
odb_StepRepository& stepRepository = m_odb->steps(); const odb_StepRepository& stepRepository = m_odb->steps();
odb_StepList stepList = stepRepository.stepList(); const odb_StepList& stepList = stepRepository.stepList();
odb_Step& step = stepList.Get(stepIndex); const odb_Step& step = stepList.ConstGet(stepIndex);
odb_SequenceFrame& stepFrames = step.frames(); const odb_SequenceFrame& stepFrames = step.frames();
return stepFrames.constGet(frameIndex); return stepFrames.constGet(frameIndex);
} }

View File

@ -69,7 +69,7 @@ private:
bool buildMetaData(); bool buildMetaData();
void close(); void close();
size_t resultItemCount(const std::string& fieldName, int partIndex, int stepIndex, int frameIndex); size_t resultItemCount(const std::string& fieldName, int partIndex, int stepIndex, int frameIndex);
odb_Frame stepFrame(int stepIndex, int frameIndex) const; const odb_Frame& stepFrame(int stepIndex, int frameIndex) const;
odb_Instance* instance(int instanceIndex); odb_Instance* instance(int instanceIndex);
int componentIndex(ResPos position, const std::string& fieldName, const std::string& componentName) const; int componentIndex(ResPos position, const std::string& fieldName, const std::string& componentName) const;
std::vector<std::string> componentNames(ResPos position, const std::string& fieldName) const; std::vector<std::string> componentNames(ResPos position, const std::string& fieldName) const;