25 #include "itkSmartPointer.h"
38 template <
typename T2,
typename T1>
39 inline itk::SmartPointer<T2>
DynamicCast(
const itk::SmartPointer<T1>& p1)
41 return typename itk::SmartPointer<T2>(
dynamic_cast<typename itk::SmartPointer<T2>::ObjectType*
>(p1.GetPointer()));
54 template <
typename T2,
typename T1>
55 inline itk::SmartPointer<const T2>
ConstCast(
const itk::SmartPointer<T1>& p1)
57 return typename itk::SmartPointer<const T2>(
const_cast<typename itk::SmartPointer<const T2>::ObjectType*
>(p1.GetPointer()));
72 template <
typename T2,
typename T1>
73 inline itk::SmartPointer<T2>
ConstCast(
const itk::SmartPointer<const T1>& p1)
75 return typename itk::SmartPointer<T2>(
const_cast<typename itk::SmartPointer<T2>::ObjectType*
>(p1.GetPointer()));
The "otb" namespace contains all Orfeo Toolbox (OTB) classes.
itk::SmartPointer< const T2 > ConstCast(const itk::SmartPointer< T1 > &p1)
const_cast<>() like operator to work with itk::SmartPointer<>.
itk::SmartPointer< T2 > DynamicCast(const itk::SmartPointer< T1 > &p1)
dynamic_cast<>() like operator to work with itk::SmartPointer<>.