24 #ifndef LSST_AFW_GEOM_TRANSFORMUTILS_H
25 #define LSST_AFW_GEOM_TRANSFORMUTILS_H
36 #include "lsst/daf/base/PropertyList.h"
56 template<
class Transform>
72 template<
class Transform>
79 template<
class Transform>
84 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError,
85 "Unsupported version " + std::to_string(version));
87 std::string shortClassName;
90 std::ostringstream os;
92 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, os.str());
94 auto astStream = ast::Stream(&is,
nullptr);
95 auto astObjectPtr = ast::Channel(astStream).read();
96 auto frameSet = std::dynamic_pointer_cast<ast::FrameSet>(astObjectPtr);
98 std::ostringstream os;
99 os <<
"The AST serialization was read as a " << astObjectPtr->getClassName()
100 <<
" instead of a FrameSet";
101 throw LSST_EXCEPT(pex::exceptions::InvalidParameterError, os.str());
107 template<
class Transform>
void writeStream(Transform const &transform, std::ostream &os)
Serialize a Transform to an output stream.
Transform readStream(std::istream &is)
Deserialize a Transform from an input stream.
constexpr int serializationVersion
version of serialization used when writing (older versions may also be supported when reading) ...