18 #ifndef itkSmartPointer_h 19 #define itkSmartPointer_h 42 #if ITK_COMPILED_CXX_VERSION >= 201103L 48 #define ITK_SP_NULLPTR nullptr 49 #define ITK_SP_NOEXCEPT noexcept 51 #define ITK_SP_NULLPTR NULL 52 #define ITK_SP_NOEXCEPT 54 template<
typename TObjectType >
87 operator ObjectType *()
const 99 template<
typename TR >
101 {
return (
m_Pointer == static_cast< const ObjectType * >( r ) ); }
103 template<
typename TR >
105 {
return (
m_Pointer != static_cast< const ObjectType * >( r ) ); }
143 ObjectType *
Print(std::ostream & os)
const 152 ( *m_Pointer ).Print(os);
158 #if ! defined ( ITK_FUTURE_LEGACY_REMOVE ) 178 if ( m_Pointer ) { m_Pointer->Register(); }
183 if ( m_Pointer ) { m_Pointer->UnRegister(); }
187 template<
typename T >
188 std::ostream & operator<<(std::ostream & os, SmartPointer< T > p)
202 #ifdef ITK_SP_NULLPTR 203 #undef ITK_SP_NULLPTR 205 #ifdef ITK_SP_NOEXECPT 206 #undef ITK_SP_NOEXCEPT void Swap(SmartPointer &other)
SmartPointer & operator=(const SmartPointer &r)
void swap(SmartPointer &other)
bool operator<(const SmartPointer &r) const
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes...
SmartPointer(ObjectType *p)
SmartPointer(const SmartPointer< ObjectType > &p)
ObjectType * GetPointer() const
void UnRegister() ITK_SP_NOEXCEPT
bool operator>=(const SmartPointer &r) const
ObjectType * operator->() const
bool operator<=(const SmartPointer &r) const
bool operator!=(TR r) const
bool operator>(const SmartPointer &r) const
Implements transparent reference counting.
ObjectType * Print(std::ostream &os) const
SmartPointer & operator=(ObjectType *r)
bool operator==(TR r) const