LSSTApplications  19.0.0-16-gf391218+0d4bdb7e99,20.0.0-11-g973f35b+fc3da11c03,20.0.0-18-g2b8c1f54+f8fc1aa9fb,20.0.0-2-g103fe59+1a747c5cf5,20.0.0-2-g1367e85+b8fe48c8a0,20.0.0-2-g7f82c8f+cb8155b8e8,20.0.0-2-g8dde007+aaa4e16c0f,20.0.0-2-ga326454+cb8155b8e8,20.0.0-2-ga51b5d4+6432c6fd8d,20.0.0-2-gde069b7+44dbdb3492,20.0.0-2-gfc62afb+b8fe48c8a0,20.0.0-20-g54e6697de+ce03d725a7,20.0.0-22-g54e2caa+e2d4a7822a,20.0.0-25-g5eafb0f+f4a3e7a5aa,20.0.0-28-g73474ed+96410ea1f8,20.0.0-3-g5242d73+b8fe48c8a0,20.0.0-3-ga63a54e+af87b3138b,20.0.0-30-g597c966+cf8eea114e,20.0.0-4-g2909d54+37efb4748c,20.0.0-4-g35ce6d5+f4a3e7a5aa,20.0.0-4-g45278ab+d529cf1a41,20.0.0-4-g4bc9b9f+a7376eab67,20.0.0-4-g66bcc37+f4a3e7a5aa,20.0.0-4-ge17e5af+b8fe48c8a0,20.0.0-4-gecfae73+77584f1b13,20.0.0-4-gf910f65+37efb4748c,20.0.0-46-gd70f10e1+f17cbaf3d1,20.0.0-5-g8f08a60+4fac22bdb7,20.0.0-5-ga885a99+c1363b8d99,20.0.0-5-gc738bc1+47717dd73f,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-gd222c45+88b21af515,20.0.0-6-gdef485e+46cd8289a4,20.0.0-7-gaa929c8+96410ea1f8,20.0.0-74-g0218c7a+939693069d,20.0.0-8-g5dd23de+1834535a4e,20.0.0-8-ge712728+fb4ad641b9,20.0.0-9-g5051ac2+d529cf1a41,w.2020.48-1-gdf601d2
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
Persistable.h
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