Skip to content

Commit

Permalink
Merge pull request #160 from mdaus/revert_copy_constructor
Browse files Browse the repository at this point in the history
Revert "Merge pull request #159 from mdaus/band_info_copy"
  • Loading branch information
JonathanMeans authored Jan 29, 2020
2 parents f2ee167 + ba2d1b6 commit 3bce1fb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
1 change: 0 additions & 1 deletion modules/c++/nitf/include/nitf/BandInfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ DECLARE_CLASS(BandInfo)
const std::string& imageFilterCode);

private:
void cloneFromNative(nitf_BandInfo* bandInfo);
nitf_Error error;
};

Expand Down
19 changes: 3 additions & 16 deletions modules/c++/nitf/source/BandInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,23 +26,20 @@ using namespace nitf;

BandInfo::BandInfo(const BandInfo & x)
{
cloneFromNative(x.getNative());
setNative(x.getNative());
}

BandInfo& BandInfo::operator=(const BandInfo & x)
BandInfo & BandInfo::operator=(const BandInfo & x)
{
if (&x != this)
{
cloneFromNative(x.getNative());
}
setNative(x.getNative());
return *this;
}

BandInfo::BandInfo(nitf_BandInfo * x)
{
setNative(x);
getNativeOrThrow();
setManaged(false);
}

BandInfo::BandInfo()
Expand Down Expand Up @@ -148,13 +145,3 @@ void BandInfo::init(const std::string& representation,
throw nitf::NITFException(&error);
}

void BandInfo::cloneFromNative(nitf_BandInfo* bandInfo)
{
nitf_BandInfo* clone = nitf_BandInfo_clone(bandInfo, &error);
if (!clone)
{
throw nitf::NITFException(&error);
}
setNative(clone);
setManaged(false);
}

0 comments on commit 3bce1fb

Please sign in to comment.