LSSTApplications  19.0.0-14-gb0260a2+4cd158d902,20.0.0+126303c00d,20.0.0+2f3d0e5c40,20.0.0+36ef800059,20.0.0+8d0ab3d2aa,20.0.0+bebc1f60e8,20.0.0+e271cb8385,20.0.0+e2e26847c2,20.0.0+eaf69e532d,20.0.0-1-g10df615+d6cc7df41f,20.0.0-1-g253301a+36ef800059,20.0.0-1-g2b7511a+bebc1f60e8,20.0.0-1-g4d801e7+6fee74fd2f,20.0.0-1-g5b95a8c+6c6c03acd5,20.0.0-1-g660595b+f45b7d88f4,20.0.0-1-gc96f8cb+d4517efcba,20.0.0-1-gd1c87d7+85c46248f3,20.0.0-1-gedffbd8+17eaf5db5c,20.0.0-16-g111fe95+d4517efcba,20.0.0-16-g233ea98+c27695f312,20.0.0-17-ga9337b4+cbc55e0393,20.0.0-19-gcdd82e7+317a1f5500,20.0.0-2-g4dae9ad+d4517efcba,20.0.0-2-g7818986+85c46248f3,20.0.0-2-gec03fae+ff10c6d78d,20.0.0-29-g26d13349+2d5e4f2fd7,20.0.0-3-g4cc78c6+63636aeed8,20.0.0-3-g6a8623c+317a1f5500,20.0.0-3-g750bffe+699cb77157,20.0.0-4-gfea843c+f45b7d88f4,20.0.0-5-g357b56b+f45b7d88f4,20.0.0-5-gfcebe35+ef19f498ed,20.0.0-54-gba713e9+a7d430d1e1,20.0.0-7-gcda7bf1+31d79aecbb,20.0.0-9-g61a2a9a3d+14f89e4eca,20.0.0-9-g70cec07d+482e8042f7,w.2020.40
LSSTDataManagementBasePackage
Persistable.cc
Go to the documentation of this file.
1 #include <memory>
2 
4 
5 namespace lsst {
6 namespace afw {
7 namespace table {
8 namespace io {
9 
17 template <typename T>
19  auto result = std::dynamic_pointer_cast<T>(ptr);
20  if (!result) {
21  throw LSST_EXCEPT(pex::exceptions::TypeError, "Dynamic pointer cast failed");
22  }
23  return result;
24 }
25 
26 } // namespace io
27 } // namespace table
28 } // namespace afw
29 } // namespace lsst
std::shared_ptr
STL class.
lsst::afw
Definition: imageAlgorithm.dox:1
ptr
uint64_t * ptr
Definition: RangeSet.cc:88
result
py::object result
Definition: _schema.cc:429
lsst
A base class for image defects.
Definition: imageAlgorithm.dox:1
LSST_EXCEPT
#define LSST_EXCEPT(type,...)
Create an exception with a given type.
Definition: Exception.h:48
lsst::afw::table::io::PersistableFacade::dynamicCast
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18
lsst.pex::exceptions::TypeError
Reports errors from accepting an object of an unexpected or inappropriate type.
Definition: Runtime.h:167
Persistable.h