19#ifndef itkSmartPointer_h
20#define itkSmartPointer_h
25#include "itkConfigure.h"
50template <
typename TObjectType>
73 template <typename T, typename = typename EnableIfConvertible<T>::type>
84 p.m_Pointer =
nullptr;
88 template <typename T, typename = typename EnableIfConvertible<T>::type>
92 p.m_Pointer =
nullptr;
110 explicit operator bool() const noexcept {
return m_Pointer !=
nullptr; }
188#if !defined(ITK_LEGACY_REMOVE)
201 other.m_Pointer = tmp;
208 template <
typename T>
232template <
class T,
class TU>
236 return (l.GetPointer() == r.GetPointer());
242 return (l.GetPointer() ==
nullptr);
248 return (
nullptr == r.GetPointer());
253template <
class T,
class TU>
257 return (l.GetPointer() != r.GetPointer());
263 return (l.GetPointer() !=
nullptr);
269 return (
nullptr != r.GetPointer());
275template <
class T,
class TU>
279 return (l.GetPointer() < r.GetPointer());
283template <
class T,
class TU>
287 return (l.GetPointer() > r.GetPointer());
291template <
class T,
class TU>
295 return (l.GetPointer() <= r.GetPointer());
299template <
class T,
class TU>
303 return (l.GetPointer() >= r.GetPointer());
Implements transparent reference counting.
ObjectType & operator*() const noexcept
SmartPointer & operator=(SmartPointer r) noexcept
constexpr SmartPointer(std::nullptr_t) noexcept
ObjectType * GetPointer() const noexcept
SmartPointer(const SmartPointer< T > &p) noexcept
SmartPointer(ObjectType *p) noexcept
void UnRegister() noexcept
bool IsNull() const noexcept
ObjectType * get() const noexcept
SmartPointer(SmartPointer< ObjectType > &&p) noexcept
ObjectType * operator->() const noexcept
void Swap(SmartPointer &other) noexcept
bool IsNotNull() const noexcept
typename std::enable_if< std::is_convertible_v< T *, TObjectType * > > EnableIfConvertible
ObjectType * Print(std::ostream &os) const
SmartPointer(SmartPointer< T > &&p) noexcept
constexpr SmartPointer() noexcept=default
SmartPointer & operator=(std::nullptr_t) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
void swap(Array< T > &a, Array< T > &b) noexcept
bool operator>(const Index< VDimension > &one, const Index< VDimension > &two)
ITKCommon_EXPORT std::ostream & operator<<(std::ostream &out, typename AnatomicalOrientation::CoordinateEnum value)
bool operator<=(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator!=(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator>=(const Index< VDimension > &one, const Index< VDimension > &two)