22 #ifndef ASTSHIM_SHIFTMAP_H
23 #define ASTSHIM_SHIFTMAP_H
28 #include "astshim/base.h"
29 #include "astshim/Mapping.h"
49 explicit ShiftMap(std::vector<double>
const &shift, std::string
const &options =
"")
50 :
Mapping(reinterpret_cast<AstMapping *>(
51 astShiftMap(shift.size(), shift.data(),
"%s", options.c_str()))) {}
65 return copyImpl<ShiftMap, AstShiftMap>();
69 explicit ShiftMap(AstShiftMap *rawptr) :
Mapping(reinterpret_cast<AstMapping *>(rawptr)) {
71 std::ostringstream os;
72 os <<
"this is a " <<
getClassName() <<
", which is not a ShiftMap";
73 throw std::invalid_argument(os.str());
virtual std::shared_ptr< Object > copyPolymorphic() const override
Definition: ShiftMap.h:64
AstObject const * getRawPtr() const
Definition: Object.h:286
Definition: ShiftMap.h:40
ShiftMap(std::vector< double > const &shift, std::string const &options="")
Definition: ShiftMap.h:49
ShiftMap(AstShiftMap *rawptr)
Construct a ShiftMap from a raw AST pointer.
Definition: ShiftMap.h:69
std::string getClassName() const
Definition: Object.h:133
std::shared_ptr< ShiftMap > copy() const
Return a deep copy of this object.
Definition: ShiftMap.h:61