28 #include <unordered_map>
78 extern "C" void sinkToOstream(
const char *text) {
79 auto osptr =
reinterpret_cast<std::ostream *
>(astChannelData);
86 auto thisStr = this->
show(
false);
87 auto rhsStr = rhs.
show(
false);
88 return rhsStr == thisStr;
94 {
"ChebyMap", makeShim<ChebyMap, AstChebyMap>},
95 {
"CmpFrame", makeShim<CmpFrame, AstCmpFrame>},
96 {
"FitsChan", makeShim<FitsChan, AstFitsChan>},
97 {
"FitsTable", makeShim<FitsTable, AstFitsTable>},
98 {
"Frame", makeShim<Frame, AstFrame>},
99 {
"FrameSet", makeShim<FrameSet, AstFrameSet>},
100 {
"FrameDict", makeShim<FrameDict, AstFrameSet>},
101 {
"KeyMap", makeShim<KeyMap, AstKeyMap>},
102 {
"LutMap", makeShim<LutMap, AstLutMap>},
103 {
"MathMap", makeShim<MathMap, AstMathMap>},
104 {
"MatrixMap", makeShim<MatrixMap, AstMatrixMap>},
105 {
"NormMap", makeShim<NormMap, AstNormMap>},
106 {
"ParallelMap", makeShim<ParallelMap, AstCmpMap>},
107 {
"PcdMap", makeShim<PcdMap, AstPcdMap>},
108 {
"PermMap", makeShim<PermMap, AstPermMap>},
109 {
"PolyMap", makeShim<PolyMap, AstPolyMap>},
110 {
"RateMap", makeShim<RateMap, AstRateMap>},
111 {
"SeriesMap", makeShim<SeriesMap, AstCmpMap>},
112 {
"ShiftMap", makeShim<ShiftMap, AstShiftMap>},
113 {
"SkyFrame", makeShim<SkyFrame, AstSkyFrame>},
114 {
"SlaMap", makeShim<SlaMap, AstSlaMap>},
115 {
"SpecFrame", makeShim<SpecFrame, AstSpecFrame>},
116 {
"SphMap", makeShim<SphMap, AstSphMap>},
117 {
"TimeFrame", makeShim<TimeFrame, AstTimeFrame>},
118 {
"Table", makeShim<Table, AstTable>},
119 {
"TimeMap", makeShim<TimeMap, AstTimeMap>},
120 {
"TranMap", makeShim<TranMap, AstTranMap>},
121 {
"UnitMap", makeShim<UnitMap, AstUnitMap>},
122 {
"UnitNormMap", makeShim<UnitNormMap, AstUnitNormMap>},
123 {
"WcsMap", makeShim<WcsMap, AstWcsMap>},
124 {
"WinMap", makeShim<WinMap, AstWinMap>},
125 {
"ZoomMap", makeShim<ZoomMap, AstZoomMap>},
129 auto name_caster = ClassCasterMap.find(className);
130 if (name_caster == ClassCasterMap.end()) {
134 return name_caster->second(rawObj);
137 template <
typename Class>
139 AstObject *rawObjCopy = rawObj;
141 rawObjCopy =
reinterpret_cast<AstObject *
>(astCopy(rawObj));
147 auto retObjectBeforeCast = Object::_basicFromAstObject(rawObjCopy);
148 auto retObject = std::dynamic_pointer_cast<Class>(retObjectBeforeCast);
151 os <<
"The component is of type " << retObject->getClassName()
152 <<
", which could not be cast to the desired type " <<
typeid(Class).
name();
160 Channel ch(stream, showComments ?
"" :
"Comment=0");