LSSTApplications  19.0.0-1-g1faeb96,19.0.0-1-g8c57eb9+33,19.0.0-1-ga3b31f8+2,19.0.0-1-gad49e94,19.0.0-14-g7511ce4+10,19.0.0-17-gde1f5b76+2,19.0.0-18-gfb21c91+1,19.0.0-19-gb85e94b+1,19.0.0-19-gda55c62e5,19.0.0-2-g15ad1b6+1,19.0.0-2-g2ed0b45,19.0.0-2-g456d77f+2,19.0.0-2-g4aada73,19.0.0-2-g5e94dc7,19.0.0-2-g6e0b8f9,19.0.0-2-g822544a+1,19.0.0-2-gb013ac2+1,19.0.0-2-gd82b0d5+2,19.0.0-20-g3336a1e+2,19.0.0-22-g08d7e7a+2,19.0.0-22-ge8ce431+1,19.0.0-3-g57fcecc+1,19.0.0-3-g9629746,19.0.0-3-g99a058e,19.0.0-3-ga84a0ef,19.0.0-3-gbea416a,19.0.0-3-gc2296d9,19.0.0-3-gc70e9ed,19.0.0-3-gc851abf+2,19.0.0-4-gac56cce+21,19.0.0-4-gb666382+2,19.0.0-4-gc799371+2,19.0.0-5-g24a5ec6,19.0.0-51-gb87bce2+1,19.0.0-54-g1bde8684,19.0.0-6-g4aaee92+2,19.0.0-6-gce3e386+2,19.0.0-8-g967c747,19.0.0-8-gb750100+1,19.0.0-9-g98aad11,w.2020.17
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