Use constant grid in output writing

Grid manager returns a const UnstructuredGrid*, and the entire chain
of pointer-passing glory should adhere to this const-ness.
This commit is contained in:
Roland Kaufmann
2013-11-19 14:33:58 +01:00
parent e02f0cd7de
commit 1baf7369ef
6 changed files with 10 additions and 10 deletions

View File

@@ -47,7 +47,7 @@ private:
template <typename Format> unique_ptr <OutputWriter>
create (const ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid) {
std::shared_ptr <const UnstructuredGrid> grid) {
return unique_ptr <OutputWriter> (new Format (params, parser, grid));
}
@@ -60,7 +60,7 @@ create (const ParameterGroup& params,
typedef map <const char*, unique_ptr <OutputWriter> (*)(
const ParameterGroup&,
std::shared_ptr <EclipseGridParser>,
std::shared_ptr <UnstructuredGrid>)> map_t;
std::shared_ptr <const UnstructuredGrid>)> map_t;
map_t FORMATS = {
{ "output_ecl", &create <EclipseWriter> },
};
@@ -70,7 +70,7 @@ map_t FORMATS = {
unique_ptr <OutputWriter>
OutputWriter::create (const ParameterGroup& params,
std::shared_ptr <EclipseGridParser> parser,
std::shared_ptr <UnstructuredGrid> grid) {
std::shared_ptr <const UnstructuredGrid> grid) {
// allocate a list which will be filled with writers. this list
// is initially empty (no output).
MultiWriter::ptr_t list (new MultiWriter::writers_t ());