ITK  6.0.0
Insight Toolkit
Public Types | Public Member Functions | Private Attributes | List of all members
itk::NeighborhoodAllocator< TPixel > Class Template Reference

#include <itkNeighborhoodAllocator.h>

Detailed Description

template<typename TPixel>
class itk::NeighborhoodAllocator< TPixel >

A memory allocator for use as the default allocator type in Neighborhood.

This is a memory allocator for use as the default allocator type in Neighborhood. The API is designed to mimic that of vnl_vector so that vnl_vector can also be used as an allocator for Neighborhood.

The decision to create this allocator with the vnl_vector api (versus using an STL allocator and wrapping the vnl_vector API) was made because the STL allocator API is not guaranteed stable at this time.

Definition at line 44 of file itkNeighborhoodAllocator.h.

+ Collaboration diagram for itk::NeighborhoodAllocator< TPixel >:

Public Types

using const_iterator = const TPixel *
 
using iterator = TPixel *
 
using Self = NeighborhoodAllocator
 

Public Member Functions

const TPixel * data () const noexcept
 
TPixel * data () noexcept
 
 NeighborhoodAllocator ()=default
 
 NeighborhoodAllocator (const Self &other)
 
 ~NeighborhoodAllocator ()=default
 
void Allocate (unsigned int n)
 
void Deallocate ()
 
 NeighborhoodAllocator (Self &&other) noexcept
 
Selfoperator= (const Self &other)
 
Selfoperator= (Self &&other) noexcept
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
unsigned int size () const
 
const TPixel & operator[] (unsigned int i) const
 
TPixel & operator[] (unsigned int i)
 
void set_size (unsigned int n)
 

Private Attributes

std::unique_ptr< TPixel[]> m_Data
 
unsigned int m_ElementCount { 0 }
 

Member Typedef Documentation

◆ const_iterator

template<typename TPixel >
using itk::NeighborhoodAllocator< TPixel >::const_iterator = const TPixel *

Definition at line 55 of file itkNeighborhoodAllocator.h.

◆ iterator

template<typename TPixel >
using itk::NeighborhoodAllocator< TPixel >::iterator = TPixel *

Iterator support. Note that the naming of the type alias is on purpose. itk::Neighborhood makes reference to the allocator, which because it may be vnl or other type, uses the lower case/underscore forms iterator and const_iterator.

Definition at line 54 of file itkNeighborhoodAllocator.h.

◆ Self

template<typename TPixel >
using itk::NeighborhoodAllocator< TPixel >::Self = NeighborhoodAllocator

Standard class type aliases.

Definition at line 48 of file itkNeighborhoodAllocator.h.

Constructor & Destructor Documentation

◆ NeighborhoodAllocator() [1/3]

template<typename TPixel >
itk::NeighborhoodAllocator< TPixel >::NeighborhoodAllocator ( )
default

Default constructor

Referenced by itk::NeighborhoodAllocator< TPixel >::set_size().

◆ ~NeighborhoodAllocator()

template<typename TPixel >
itk::NeighborhoodAllocator< TPixel >::~NeighborhoodAllocator ( )
default

Defaulted destructor

◆ NeighborhoodAllocator() [2/3]

template<typename TPixel >
itk::NeighborhoodAllocator< TPixel >::NeighborhoodAllocator ( const Self other)
inline

◆ NeighborhoodAllocator() [3/3]

template<typename TPixel >
itk::NeighborhoodAllocator< TPixel >::NeighborhoodAllocator ( Self &&  other)
inlinenoexcept

Move-constructor.

Definition at line 91 of file itkNeighborhoodAllocator.h.

Member Function Documentation

◆ Allocate()

template<typename TPixel >
void itk::NeighborhoodAllocator< TPixel >::Allocate ( unsigned int  n)
inline

◆ begin() [1/2]

template<typename TPixel >
iterator itk::NeighborhoodAllocator< TPixel >::begin ( )
inline

STL-style iterator support for the memory buffer.

Definition at line 131 of file itkNeighborhoodAllocator.h.

References itk::NeighborhoodAllocator< TPixel >::m_Data.

Referenced by itk::operator<<(), and itk::operator==().

◆ begin() [2/2]

template<typename TPixel >
const_iterator itk::NeighborhoodAllocator< TPixel >::begin ( ) const
inline

STL-style iterator support for the memory buffer.

Definition at line 136 of file itkNeighborhoodAllocator.h.

References itk::NeighborhoodAllocator< TPixel >::m_Data.

◆ data() [1/2]

template<typename TPixel >
const TPixel * itk::NeighborhoodAllocator< TPixel >::data ( ) const
inlinenoexcept

◆ data() [2/2]

template<typename TPixel >
TPixel * itk::NeighborhoodAllocator< TPixel >::data ( )
inlinenoexcept

◆ Deallocate()

template<typename TPixel >
void itk::NeighborhoodAllocator< TPixel >::Deallocate ( )
inline

◆ end() [1/2]

template<typename TPixel >
iterator itk::NeighborhoodAllocator< TPixel >::end ( )
inline

STL-style iterator support for the memory buffer.

Definition at line 141 of file itkNeighborhoodAllocator.h.

References itk::NeighborhoodAllocator< TPixel >::m_Data, and itk::NeighborhoodAllocator< TPixel >::m_ElementCount.

Referenced by itk::operator==().

◆ end() [2/2]

template<typename TPixel >
const_iterator itk::NeighborhoodAllocator< TPixel >::end ( ) const
inline

STL-style iterator support for the memory buffer.

Definition at line 146 of file itkNeighborhoodAllocator.h.

References itk::NeighborhoodAllocator< TPixel >::m_Data, and itk::NeighborhoodAllocator< TPixel >::m_ElementCount.

◆ operator=() [1/2]

template<typename TPixel >
Self & itk::NeighborhoodAllocator< TPixel >::operator= ( const Self other)
inline

◆ operator=() [2/2]

template<typename TPixel >
Self & itk::NeighborhoodAllocator< TPixel >::operator= ( Self &&  other)
inlinenoexcept

◆ operator[]() [1/2]

template<typename TPixel >
TPixel & itk::NeighborhoodAllocator< TPixel >::operator[] ( unsigned int  i)
inline

Data access methods

Definition at line 159 of file itkNeighborhoodAllocator.h.

References itk::NeighborhoodAllocator< TPixel >::m_Data.

◆ operator[]() [2/2]

template<typename TPixel >
const TPixel & itk::NeighborhoodAllocator< TPixel >::operator[] ( unsigned int  i) const
inline

Data access methods

Definition at line 158 of file itkNeighborhoodAllocator.h.

References itk::NeighborhoodAllocator< TPixel >::m_Data.

◆ set_size()

template<typename TPixel >
void itk::NeighborhoodAllocator< TPixel >::set_size ( unsigned int  n)
inline

◆ size()

template<typename TPixel >
unsigned int itk::NeighborhoodAllocator< TPixel >::size ( ) const
inline

STL-style iterator support for the memory buffer.

Definition at line 151 of file itkNeighborhoodAllocator.h.

References itk::NeighborhoodAllocator< TPixel >::m_ElementCount.

Referenced by itk::operator<<(), and itk::operator==().

Member Data Documentation

◆ m_Data

template<typename TPixel >
std::unique_ptr<TPixel[]> itk::NeighborhoodAllocator< TPixel >::m_Data
private

◆ m_ElementCount

template<typename TPixel >
unsigned int itk::NeighborhoodAllocator< TPixel >::m_ElementCount { 0 }
private

The documentation for this class was generated from the following file: