LSSTApplications  19.0.0-14-gb0260a2+16456dd421,20.0.0+44dbdb3492,20.0.0+5d43f57eb7,20.0.0+8a208d85ec,20.0.0+a295394073,20.0.0+f15d39cacd,20.0.0-1-g253301a+8a208d85ec,20.0.0-1-g5b95a8c+fc0c0df92e,20.0.0-16-g760a3dc6+b31208f437,20.0.0-18-gcabc0c9fd+54cb7ade16,20.0.0-2-g4dae9ad+71e3c9ad45,20.0.0-2-g61b8584+b4ab3064f8,20.0.0-2-ga51b5d4+1f4ba438e8,20.0.0-2-gb780d76+d529cf1a41,20.0.0-2-ged6426c+c85f3a4c63,20.0.0-2-gf072044+8a208d85ec,20.0.0-2-gf1f7952+71e3c9ad45,20.0.0-22-g54e2caa+3351092962,20.0.0-25-g5eafb0f+71e3c9ad45,20.0.0-28-g73474ed+3c7e226ea7,20.0.0-29-g1235a2f+d30e658c1c,20.0.0-3-g8f21e14+558cb18951,20.0.0-3-gbd60e8c+ffb20d0b0d,20.0.0-3-gbecbe05+7f0063ada4,20.0.0-4-g4bc9b9f+57161cfff5,20.0.0-4-gb4befbc+0e003188f4,20.0.0-4-gf910f65+b4ab3064f8,20.0.0-43-gfec247c5+985768289e,20.0.0-5-gcbc8587+3c7e226ea7,20.0.0-5-gfbfe500+d529cf1a41,20.0.0-6-g4aa86cc+b6dcff6f8d,20.0.0-6-g9a5b7a1+4bc2181c53,20.0.0-6-gd222c45+7040a8a6f6,20.0.0-74-g0218c7a+7d276c6844,20.0.0-9-g4aef684+90bf294a58,20.0.0-9-g5051ac2+d529cf1a41,w.2020.47
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.
Persistable.h
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