lsst.afw g4e8c878dce+b648b522b0
Loading...
Searching...
No Matches
Persistable.cc
Go to the documentation of this file.
1#include <memory>
2
4
5namespace lsst {
6namespace afw {
7namespace table {
8namespace io {
9
17template <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
#define LSST_EXCEPT(type,...)
static std::shared_ptr< T > dynamicCast(std::shared_ptr< Persistable > const &ptr)
Dynamically cast a shared_ptr.
Definition: Persistable.cc:18