Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-6056: replace CONST_PTR and PTR macros by std::shared #146

Merged
merged 1 commit into from
Aug 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions include/lsst/meas/astrom/matchOptimisticB.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ A wrapper around a SimpleRecord or SourceRecord that allows us to record a pixel
in a way that is independent of the record type.
*/
struct RecordProxy {
PTR(afw::table::SimpleRecord) record;
std::shared_ptr<afw::table::SimpleRecord> record;
geom::Point2D position;
mutable bool used; // set true if this star object has already been used for a match
// mutable to allow freezing the fundamental object data using const
Expand All @@ -32,7 +32,7 @@ struct RecordProxy {
/**
Support implicit conversion to SimpleRecord (discarding the pixel position)
*/
operator PTR(afw::table::SimpleRecord)() const { return record; }
operator std::shared_ptr<afw::table::SimpleRecord>() const { return record; }

bool operator==(RecordProxy const& other) const { return record == other.record; }
bool operator!=(RecordProxy const& other) const { return record != other.record; }
Expand All @@ -43,7 +43,7 @@ struct RecordProxy {
@param[in] record the record to wrap
@param[in] position pixel position; this is likely to be an initial guess while fitting a WCS
*/
RecordProxy(PTR(afw::table::SimpleRecord) record, geom::Point2D const& position)
RecordProxy(std::shared_ptr<afw::table::SimpleRecord> record, geom::Point2D const& position)
: record(record), position(position) {}

explicit RecordProxy() {} // default constructor needed so we can call ProxyVector::resize()
Expand Down
6 changes: 3 additions & 3 deletions include/lsst/meas/astrom/sip/MatchSrcToCatalogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ class MatchSrcToCatalogue {
typedef std::shared_ptr<MatchSrcToCatalogue const> ConstPtr;

MatchSrcToCatalogue(afw::table::SimpleCatalog const& catSet, afw::table::SourceCatalog const& imgSet,
CONST_PTR(afw::geom::SkyWcs) wcs, geom::Angle dist);
std::shared_ptr<afw::geom::SkyWcs const> wcs, geom::Angle dist);

// Mutators
void setDist(geom::Angle dist);
void setWcs(CONST_PTR(afw::geom::SkyWcs) wcs);
void setWcs(std::shared_ptr<afw::geom::SkyWcs const> wcs);
void setCatSrcSet(afw::table::SimpleCatalog const& catSet);
void setImgSrcSet(afw::table::SourceCatalog const& srcSet);

Expand All @@ -77,7 +77,7 @@ class MatchSrcToCatalogue {
afw::table::SimpleCatalog _catSet; ///< Copy of input catalog
afw::table::SourceCatalog _imgSet; ///< Copy of input catalog
afw::table::ReferenceMatchVector _match; /// List of tuples of matching indices
CONST_PTR(afw::geom::SkyWcs) _wcs;
std::shared_ptr<afw::geom::SkyWcs const> _wcs;
geom::Angle _dist; ///< How close must two objects be to match

void _removeOneToMany();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static void declareRecordProxy(py::module &mod) {
cls.def(py::init<std::shared_ptr<afw::table::SimpleRecord>, geom::Point2D const &>(), "record"_a,
"position"_a);

// TO DO: decide if we need to wrap operator PTR(lsst::afw::table::SimpleRecord)()
// TO DO: decide if we need to wrap operator std::shared_ptr<lsst::afw::table::SimpleRecord>()

cls.def("__eq__", &RecordProxy::operator==, py::is_operator());
cls.def("__ne__", &RecordProxy::operator!=, py::is_operator());
Expand Down
4 changes: 2 additions & 2 deletions src/sip/MatchSrcToCatalogue.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace sip {
///
MatchSrcToCatalogue::MatchSrcToCatalogue(afw::table::SimpleCatalog const& catSet,
afw::table::SourceCatalog const& imgSet,
CONST_PTR(afw::geom::SkyWcs) wcs, geom::Angle dist) {
std::shared_ptr<afw::geom::SkyWcs const> wcs, geom::Angle dist) {
setImgSrcSet(imgSet);
setCatSrcSet(catSet);
setDist(dist);
Expand All @@ -64,7 +64,7 @@ void MatchSrcToCatalogue::setDist(geom::Angle dist) {
}

/// Set a different Wcs solution
void MatchSrcToCatalogue::setWcs(CONST_PTR(afw::geom::SkyWcs) wcs) { _wcs = wcs; }
void MatchSrcToCatalogue::setWcs(std::shared_ptr<afw::geom::SkyWcs const> wcs) { _wcs = wcs; }

/// sourceSet is a vector of pointers to Sources.
void MatchSrcToCatalogue::setImgSrcSet(afw::table::SourceCatalog const& srcSet) { _imgSet = srcSet; }
Expand Down