LSSTApplications  19.0.0-14-gb0260a2+1b9fb4b99f,20.0.0+14a7f838e9,20.0.0+19029f0d82,20.0.0+4c45e9990f,20.0.0+e2e26847c2,20.0.0+e47e9b3a81,20.0.0-1-g253301a+19029f0d82,20.0.0-1-g2b7511a+46a6078777,20.0.0-1-g3dda6ea+81aab9741f,20.0.0-1-g4d801e7+e868bd9c46,20.0.0-1-g5b95a8c+f88803b0ab,20.0.0-1-gc96f8cb+ec36e0f211,20.0.0-1-gedffbd8+974f4d13e0,20.0.0-10-g0891cd99+0db8181fd1,20.0.0-13-gad96b2d30+614f89f815,20.0.0-17-gcdbda88+9866f06e69,20.0.0-2-g4dae9ad+ec36e0f211,20.0.0-2-g52fdb94+046030bafd,20.0.0-2-g61b8584+85c46248f3,20.0.0-2-g8177d33+5b5417f15c,20.0.0-2-gb780d76+f45b7d88f4,20.0.0-2-gf072044+19029f0d82,20.0.0-22-gdf434b7+ec36e0f211,20.0.0-23-g10eeb28+0064d5905c,20.0.0-24-g5395043+51462c573c,20.0.0-3-g1653f94+85c46248f3,20.0.0-3-g4cc78c6+63636aeed8,20.0.0-3-g750bffe+1f8ba646cd,20.0.0-3-gbd60e8c+ff10c6d78d,20.0.0-33-g078e64d5+00a703b33a,20.0.0-4-g97dc21a+51462c573c,20.0.0-4-gfea843c+f45b7d88f4,20.0.0-5-g357b56b+f45b7d88f4,20.0.0-6-g9a5b7a1+02b9007320,20.0.0-63-g7191b3b+8ae2fb2912,20.0.0-7-gcda7bf1+3dbcc0d021,w.2020.44
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