Writing output should not change the state
Therefore we take const parameters across the board. (This is a follow-up to the patch which declared the UnstructuredGrid const).
This commit is contained in:
1 parent
eb276f79e1
commit
d83d7d829c
6 files changed
+26
-26
No files matched your search
@@ -46,7 +46,7 @@ private:
|
||||
/// Psuedo-constructor, can appear in template
|
||||
template <typename Format> unique_ptr <OutputWriter>
|
||||
create (const ParameterGroup& params,
|
||||
std::shared_ptr <EclipseGridParser> parser,
|
||||
std::shared_ptr <const EclipseGridParser> parser,
|
||||
std::shared_ptr <const UnstructuredGrid> grid) {
|
||||
return unique_ptr <OutputWriter> (new Format (params, parser, grid));
|
||||
}
|
||||
@@ -59,7 +59,7 @@ create (const ParameterGroup& params,
|
||||
/// to the list below!
|
||||
typedef map <const char*, unique_ptr <OutputWriter> (*)(
|
||||
const ParameterGroup&,
|
||||
std::shared_ptr <EclipseGridParser>,
|
||||
std::shared_ptr <const EclipseGridParser>,
|
||||
std::shared_ptr <const UnstructuredGrid>)> map_t;
|
||||
map_t FORMATS = {
|
||||
{ "output_ecl", &create <EclipseWriter> },
|
||||
@@ -69,7 +69,7 @@ map_t FORMATS = {
|
||||
|
||||
unique_ptr <OutputWriter>
|
||||
OutputWriter::create (const ParameterGroup& params,
|
||||
std::shared_ptr <EclipseGridParser> parser,
|
||||
std::shared_ptr <const EclipseGridParser> parser,
|
||||
std::shared_ptr <const UnstructuredGrid> grid) {
|
||||
// allocate a list which will be filled with writers. this list
|
||||
// is initially empty (no output).
|
||||
|
||||
Reference in new issue
Block a user