Skip to content

Commit 22f226c

Browse files
committed
Basic update
1 parent de57e81 commit 22f226c

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Core/Algorithms/Legacy/DataIO/DataIOAlgo.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ bool DataIOAlgo::ReadNrrd(const std::string& filename, NrrdDataHandle& nrrd, con
156156
const std::string ext = filename.substr(filename.size()-5,5);
157157
if (ext == ".nhdr" || ext == ".nrrd")
158158
{
159-
nrrd = new NrrdData;
160-
if (nrrd.get_rep() == 0) return (false);
159+
nrrd.reset(new NrrdData);
160+
if (!nrrd) return (false);
161161

162162
NrrdData::lock_teem();
163163
if (nrrdLoad(nrrd->nrrd_, airStrdup(filename.c_str()), 0))
@@ -185,7 +185,7 @@ bool DataIOAlgo::ReadNrrd(const std::string& filename, NrrdDataHandle& nrrd, con
185185

186186
// Read the file through Pio
187187
Pio(*stream, nrrd);
188-
if (!nrrd.get_rep() || stream->error())
188+
if (!nrrd || stream->error())
189189
{
190190
error("Error reading data from file '" + filename +"'.");
191191
return (false);
@@ -421,9 +421,9 @@ bool DataIOAlgo::WriteBundle(const std::string& filename, BundleHandle& bundle,
421421
#endif
422422

423423

424-
bool DataIOAlgo::WriteNrrd(const std::string& filename, NrrdDataHandle& nrrd, const std::string& exporter)
424+
bool DataIOAlgo::WriteNrrd(const std::string& filename, NrrdDataHandle nrrd, const std::string& exporter)
425425
{
426-
if (nrrd.get_rep() == 0) return (false);
426+
if (!nrrd) return (false);
427427

428428
if ((exporter == "text")||(exporter == "Text"))
429429
{
@@ -439,7 +439,7 @@ bool DataIOAlgo::WriteNrrd(const std::string& filename, NrrdDataHandle& nrrd, co
439439
Pio(*stream, nrrd);
440440
}
441441
}
442-
else if (exporter == "")
442+
else if (exporter.empty())
443443
{
444444

445445
if (filename.size() > 4)
@@ -626,7 +626,7 @@ bool DataIOAlgo::WritePath(const std::string& filename, PathHandle& path, const
626626
}
627627
#endif
628628

629-
AlgorithmOutput DataIOAlgo::run_generic(const AlgorithmInput& input) const override
629+
AlgorithmOutput DataIOAlgo::run_generic(const AlgorithmInput& input) const
630630
{
631631
throw "not implemented";
632632
}

src/Core/Algorithms/Legacy/DataIO/DataIOAlgo.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,31 +47,31 @@ class SCISHARE DataIOAlgo : public AlgorithmBase {
4747

4848
#ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
4949
bool ReadField(const std::string& filename, FieldHandle& field, const std::string& importer = "");
50-
bool WriteField(const std::string& filename, FieldHandle& field, const std::string& exporter = "");
50+
bool WriteField(const std::string& filename, FieldHandle field, const std::string& exporter = "");
5151

5252
bool ReadMatrix(const std::string& filename, Datatypes::MatrixHandle& matrix, const std::string& importer = "");
53-
bool WriteMatrix(const std::string& filename, Datatypes::MatrixHandle& matrix, const std::string& exporter = "");
53+
bool WriteMatrix(const std::string& filename, Datatypes::MatrixHandle matrix, const std::string& exporter = "");
5454
#endif
5555

5656
bool ReadNrrd(const std::string& filename, NrrdDataHandle& nrrd, const std::string& importer = "");
57-
bool WriteNrrd(const std::string& filename, NrrdDataHandle& nrrd, const std::string& exporter = "");
57+
bool WriteNrrd(const std::string& filename, NrrdDataHandle nrrd, const std::string& exporter = "");
5858

5959
#ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
6060
bool ReadBundle(const std::string& filename, Datatypes::BundleHandle& bundle, const std::string& importer = "");
61-
bool WriteBundle(const std::string& filename, Datatypes::BundleHandle& bundle, const std::string& exporter = "");
61+
bool WriteBundle(const std::string& filename, Datatypes::BundleHandle bundle, const std::string& exporter = "");
6262

6363
bool ReadColorMap(const std::string& filename, Datatypes::ColorMapHandle& colorMap, const std::string& importer = "");
64-
bool WriteColorMap(const std::string& filename, Datatypes::ColorMapHandle& colorMap, const std::string& exporter = "");
64+
bool WriteColorMap(const std::string& filename, Datatypes::ColorMapHandle colorMap, const std::string& exporter = "");
6565
#endif
6666

6767
virtual AlgorithmOutput run_generic(const AlgorithmInput& input) const override;
6868

6969
#ifdef SCIRUN4_CODE_TO_BE_ENABLED_LATER
7070
bool ReadColorMap2(const std::string& filename, ColorMap2Handle& colorMap2, const std::string& importer = "");
71-
bool WriteColorMap2(const std::string& filename, ColorMap2Handle& colorMap2, const std::string& exporter = "");
71+
bool WriteColorMap2(const std::string& filename, ColorMap2Handle colorMap2, const std::string& exporter = "");
7272

7373
bool ReadPath(const std::string& filename, PathHandle& path, const std::string& importer = "");
74-
bool WritePath(const std::string& filename, PathHandle& path, const std::string& exporter = "");
74+
bool WritePath(const std::string& filename, PathHandle path, const std::string& exporter = "");
7575
#endif
7676
private:
7777
Core::Logging::LoggerHandle pr_;

0 commit comments

Comments
 (0)