ADded const qualifier to shallowCopy() method

This commit is contained in:
Joakim Hove
2013-11-08 23:18:49 +01:00
parent bdc788d905
commit ad3d3adf21
2 changed files with 5 additions and 5 deletions

View File

@@ -55,8 +55,8 @@ namespace Opm {
}
CompletionSet * CompletionSet::shallowCopy() {
CompletionSet * copy = new CompletionSet();
CompletionSet * CompletionSet::shallowCopy() const {
CompletionSet * copy = new CompletionSet();
for (size_t ic = 0; ic < m_completions.size(); ic++) {
CompletionConstPtr completion = m_completions[ic];
copy->m_completions.push_back( completion );
@@ -64,5 +64,5 @@ namespace Opm {
return copy;
}
}

View File

@@ -26,7 +26,7 @@
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
namespace Opm {
@@ -35,7 +35,7 @@ namespace Opm {
CompletionSet();
void add(CompletionConstPtr completion);
size_t size() const;
CompletionSet * shallowCopy();
CompletionSet * shallowCopy() const;
CompletionConstPtr get(size_t index) const;
private:
std::vector<CompletionConstPtr> m_completions;