Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config.log
.sconf_temp
.cache
.pytest_cache
.coverage
*.o
*.os
*.so
Expand Down
2 changes: 1 addition & 1 deletion include/astshim/Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Channel : public Object {
int write(Object const &object);

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override { return std::shared_ptr<Object>(); }
std::shared_ptr<Object> copyPolymorphic() const override { return std::shared_ptr<Object>(); }

/**
Construct a channel from an AST channel pointer and a @ref Stream
Expand Down
2 changes: 1 addition & 1 deletion include/astshim/ChebyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class ChebyMap : public Mapping {
ChebyMap polyTran(bool forward, double acc, double maxacc, int maxorder) const;

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<ChebyMap, AstChebyMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/CmpFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class CmpFrame : public Frame {
std::shared_ptr<Frame> operator[](int i) const { return decompose<Frame>(i, false); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<CmpFrame, AstCmpFrame>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/CmpMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CmpMap : public Mapping {
bool getSeries() { return detail::isSeries(reinterpret_cast<AstCmpMap *>(getRawPtr())); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<CmpMap, AstCmpMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/Frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ class Frame : public Mapping {
}
}

virtual std::shared_ptr<Object> copyPolymorphic() const override { return copyImpl<Frame, AstFrame>(); }
std::shared_ptr<Object> copyPolymorphic() const override { return copyImpl<Frame, AstFrame>(); }

private:
/**
Expand Down
2 changes: 1 addition & 1 deletion include/astshim/FrameDict.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class FrameDict : public FrameSet {
void setDomain(std::string const &domain) override;

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<FrameDict, AstFrameSet>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/FrameSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ class FrameSet : public Frame {
void setCurrent(int ind) { setI("Current", ind); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<FrameSet, AstFrameSet>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/KeyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ class KeyMap : public Object {

protected:
// Protected implementation of deep-copy.
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return std::static_pointer_cast<KeyMap>(copyImpl<KeyMap, AstKeyMap>());
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/LutMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class LutMap : public Mapping {
int getLutInterp() const { return getI("LutInterp"); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<LutMap, AstLutMap>();
}

Expand Down
8 changes: 0 additions & 8 deletions include/astshim/Mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ class Mapping : public Object {
Mapping &operator=(Mapping const &) = delete;
Mapping &operator=(Mapping &&) = default;

/// Return a deep copy of this object.
std::shared_ptr<Mapping> copy() const { return std::static_pointer_cast<Mapping>(copyPolymorphic()); }

/**
Get @ref Mapping_NIn "NIn": the number of input axes
*/
Expand Down Expand Up @@ -406,11 +403,6 @@ class Mapping : public Object {
}
}

// Protected implementation of deep-copy.
virtual std::shared_ptr<Object> copyPolymorphic() const override {
return std::static_pointer_cast<Mapping>(copyImpl<Mapping, AstMapping>());
}

/**
Return a deep copy of one of the two component mappings.

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/MathMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ class MathMap : public Mapping {
bool getSimpIF() const { return getB("SimpIF"); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<MathMap, AstMathMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/MatrixMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class MatrixMap : public Mapping {
std::shared_ptr<MatrixMap> copy() const { return std::static_pointer_cast<MatrixMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<MatrixMap, AstMatrixMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/NormMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class NormMap : public Mapping {
std::shared_ptr<NormMap> copy() const { return std::static_pointer_cast<NormMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<NormMap, AstNormMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/ParallelMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class ParallelMap : public CmpMap {
}

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<ParallelMap, AstCmpMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/PcdMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class PcdMap : public Mapping {
}

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<PcdMap, AstPcdMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/PermMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class PermMap : public Mapping {
std::shared_ptr<PermMap> copy() const { return std::static_pointer_cast<PermMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<PermMap, AstPermMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/PolyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class PolyMap : public Mapping {
std::vector<double> const &ubnd) const;

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<PolyMap, AstPolyMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/RateMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class RateMap : public Mapping {
std::shared_ptr<RateMap> copy() const { return std::static_pointer_cast<RateMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<RateMap, AstRateMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/SeriesMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class SeriesMap : public CmpMap {
}

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<SeriesMap, AstCmpMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/ShiftMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ShiftMap : public Mapping {
std::shared_ptr<ShiftMap> copy() const { return std::static_pointer_cast<ShiftMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<ShiftMap, AstShiftMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/SkyFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ class SkyFrame : public Frame {
}

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<SkyFrame, AstSkyFrame>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/SlaMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class SlaMap : public Mapping {
}

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<SlaMap, AstSlaMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/SpecFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ class SpecFrame : public Frame {
void setStdOfRest(std::string const &stdOfRest) { setC("StdOfRest", stdOfRest); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<SpecFrame, AstSpecFrame>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/SphMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class SphMap : public Mapping {
double getPolarLong() const { return getD("PolarLong"); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<SphMap, AstSphMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/TimeFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class TimeFrame : public Frame {
void setTimeScale(std::string const &scale) { return setC("TimeScale", scale); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<TimeFrame, AstTimeFrame>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/TimeMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class TimeMap : public Mapping {
}

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<TimeMap, AstTimeMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/TranMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class TranMap : public Mapping {
std::shared_ptr<TranMap> copy() const { return std::static_pointer_cast<TranMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<TranMap, AstTranMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/UnitMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class UnitMap : public Mapping {
std::shared_ptr<UnitMap> copy() const { return std::static_pointer_cast<UnitMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<UnitMap, AstUnitMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/UnitNormMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class UnitNormMap : public Mapping {
}

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<UnitNormMap, AstUnitNormMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/WcsMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class WcsMap : public Mapping {
WcsType getWcsType() const { return static_cast<WcsType>(getI("WcsType")); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<WcsMap, AstWcsMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/WinMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class WinMap : public Mapping {
std::shared_ptr<WinMap> copy() const { return std::static_pointer_cast<WinMap>(copyPolymorphic()); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<WinMap, AstWinMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion include/astshim/ZoomMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class ZoomMap : public Mapping {
double getZoom() const { return getF("Zoom"); }

protected:
virtual std::shared_ptr<Object> copyPolymorphic() const override {
std::shared_ptr<Object> copyPolymorphic() const override {
return copyImpl<ZoomMap, AstZoomMap>();
}

Expand Down
2 changes: 1 addition & 1 deletion src/functional.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ std::shared_ptr<Mapping> makeRadialMapping(std::vector<double> const& center, Ma
" outputs, instead of 1");
}
auto unitNormMap = UnitNormMap(center);
return std::make_shared<Mapping>(
return std::make_shared<SeriesMap>(
unitNormMap.then(UnitMap(naxes).under(mapping1d)).then(*unitNormMap.getInverse()));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should standardize whether mappings are returned by value (then) or smart pointer (makeRadialMapping). This code seems to involve way more implicit moves than should be necessary.

@r-owen r-owen Jul 9, 2018

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right; then should probably be changed to return a shared pointer. However, I suggest that be a different ticket.

}

Expand Down