|
ITK
5.2.0
Insight Toolkit
|
Go to the documentation of this file.
19 #ifndef itkSmartPointer_h
20 #define itkSmartPointer_h
24 #include <type_traits>
25 #include "itkConfigure.h"
50 template <
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; }
173 (*m_Pointer).Print(os);
179 #if !defined(ITK_LEGACY_REMOVE)
192 other.m_Pointer = tmp;
199 template <
typename T>
223 template <
class T,
class TU>
227 return (l.GetPointer() == r.GetPointer());
233 return (l.GetPointer() ==
nullptr);
239 return (
nullptr == r.GetPointer());
244 template <
class T,
class TU>
248 return (l.GetPointer() != r.GetPointer());
254 return (l.GetPointer() !=
nullptr);
260 return (
nullptr != r.GetPointer());
266 template <
class T,
class TU>
270 return (l.GetPointer() < r.GetPointer());
274 template <
class T,
class TU>
278 return (l.GetPointer() > r.GetPointer());
282 template <
class T,
class TU>
286 return (l.GetPointer() <= r.GetPointer());
290 template <
class T,
class TU>
294 return (l.GetPointer() >= r.GetPointer());
297 template <
typename T>
305 template <
typename T>
void Swap(SmartPointer &other) noexcept
SmartPointer(const SmartPointer< T > &p) noexcept
bool operator<(const Index< VDimension > &one, const Index< VDimension > &two)
typename std::enable_if< std::is_convertible< T *, const Self * >::value > EnableIfConvertible
bool operator<=(const Index< VDimension > &one, const Index< VDimension > &two)
SmartPointer(ObjectType *p) noexcept
std::ostream & operator<<(std::ostream &os, const Array< TValue > &arr)
void swap(Array< T > &a, Array< T > &b)
SmartPointer(SmartPointer< ObjectType > &&p) noexcept
SmartPointer & operator=(SmartPointer r) noexcept
Implements transparent reference counting.
ObjectType * Print(std::ostream &os) const
constexpr SmartPointer() noexcept=default
ObjectType * GetPointer() const noexcept
void UnRegister() noexcept
ObjectType & operator*() const noexcept
bool operator>=(const Index< VDimension > &one, const Index< VDimension > &two)
ObjectType * operator->() const noexcept
bool operator>(const Index< VDimension > &one, const Index< VDimension > &two)
bool operator==(const Index< VDimension > &one, const Index< VDimension > &two)
bool IsNull() const noexcept
SmartPointer(SmartPointer< T > &&p) noexcept
bool operator!=(const Index< VDimension > &one, const Index< VDimension > &two)
SmartPointer & operator=(std::nullptr_t) noexcept
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
bool IsNotNull() const noexcept
constexpr SmartPointer(std::nullptr_t) noexcept