go home Home | Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Friends
itk::VectorDataContainer< TElementIdentifier, TElement > Class Template Reference

#include <itkVectorDataContainer.h>

Detailed Description

template<typename TElementIdentifier, typename TElement>
class itk::VectorDataContainer< TElementIdentifier, TElement >

Define a front-end to the STL "vector" container that conforms to the IndexedContainerInterface.

This is a full-fleged Object, so there is modification time, debug, and reference count information.

Template parameters for VectorDataContainer:

TElementIdentifier = An INTEGRAL type for use in indexing the vector.

TElement = The element type stored in the container.

CHANGES: This class is a modification of the itk::VectorContainer. It now inherits from itk::DataObject instead of itk::Object. This way it is easy to use in an itk::ProcessObject (a filter).

Definition at line 76 of file itkVectorDataContainer.h.

+ Inheritance diagram for itk::VectorDataContainer< TElementIdentifier, TElement >:

Data Structures

class  ConstIterator
 
class  Iterator
 

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef TElement Element
 
typedef TElementIdentifier ElementIdentifier
 
typedef SmartPointer< SelfPointer
 
typedef VectorDataContainer Self
 
typedef VectorType STLContainerType
 
typedef DataObject Superclass
 

Public Member Functions

Iterator Begin (void)
 
ConstIterator Begin (void) const
 
const STLContainerTypeCastToSTLConstContainer () const
 
STLContainerTypeCastToSTLContainer ()
 
ElementCreateElementAt (ElementIdentifier)
 
void CreateIndex (ElementIdentifier)
 
void DeleteIndex (ElementIdentifier)
 
ElementElementAt (ElementIdentifier)
 
const ElementElementAt (ElementIdentifier) const
 
Iterator End (void)
 
ConstIterator End (void) const
 
virtual const char * GetClassName () const
 
Element GetElement (ElementIdentifier) const
 
bool GetElementIfIndexExists (ElementIdentifier, Element *) const
 
bool IndexExists (ElementIdentifier) const
 
void Initialize (void) override
 
void InsertElement (ElementIdentifier, Element)
 
void Reserve (ElementIdentifier)
 
void SetElement (ElementIdentifier, Element)
 
unsigned long Size (void) const
 
void Squeeze (void)
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 VectorDataContainer ()
 
 VectorDataContainer (const Self &r)
 
template<typename InputIterator >
 VectorDataContainer (InputIterator first, InputIterator last)
 
 VectorDataContainer (size_type n)
 
 VectorDataContainer (size_type n, const Element &x)
 

Private Types

typedef VectorType::size_type size_type
 
typedef VectorType::const_iterator VectorConstIterator
 
typedef VectorType::iterator VectorIterator
 
typedef std::vector< ElementVectorType
 

Friends

class ConstIterator
 
class Iterator
 

Member Typedef Documentation

◆ ConstPointer

template<typename TElementIdentifier , typename TElement >
typedef SmartPointer< const Self > itk::VectorDataContainer< TElementIdentifier, TElement >::ConstPointer

Definition at line 86 of file itkVectorDataContainer.h.

◆ Element

template<typename TElementIdentifier , typename TElement >
typedef TElement itk::VectorDataContainer< TElementIdentifier, TElement >::Element

Definition at line 90 of file itkVectorDataContainer.h.

◆ ElementIdentifier

template<typename TElementIdentifier , typename TElement >
typedef TElementIdentifier itk::VectorDataContainer< TElementIdentifier, TElement >::ElementIdentifier

Save the template parameters.

Definition at line 89 of file itkVectorDataContainer.h.

◆ Pointer

template<typename TElementIdentifier , typename TElement >
typedef SmartPointer< Self > itk::VectorDataContainer< TElementIdentifier, TElement >::Pointer

Definition at line 85 of file itkVectorDataContainer.h.

◆ Self

template<typename TElementIdentifier , typename TElement >
typedef VectorDataContainer itk::VectorDataContainer< TElementIdentifier, TElement >::Self

Standard class typedefs.

Definition at line 83 of file itkVectorDataContainer.h.

◆ size_type

template<typename TElementIdentifier , typename TElement >
typedef VectorType::size_type itk::VectorDataContainer< TElementIdentifier, TElement >::size_type
private

Definition at line 96 of file itkVectorDataContainer.h.

◆ STLContainerType

template<typename TElementIdentifier , typename TElement >
typedef VectorType itk::VectorDataContainer< TElementIdentifier, TElement >::STLContainerType

This type is provided to Adapt this container as an STL container

Definition at line 120 of file itkVectorDataContainer.h.

◆ Superclass

template<typename TElementIdentifier , typename TElement >
typedef DataObject itk::VectorDataContainer< TElementIdentifier, TElement >::Superclass

Definition at line 84 of file itkVectorDataContainer.h.

◆ VectorConstIterator

template<typename TElementIdentifier , typename TElement >
typedef VectorType::const_iterator itk::VectorDataContainer< TElementIdentifier, TElement >::VectorConstIterator
private

Definition at line 98 of file itkVectorDataContainer.h.

◆ VectorIterator

template<typename TElementIdentifier , typename TElement >
typedef VectorType::iterator itk::VectorDataContainer< TElementIdentifier, TElement >::VectorIterator
private

Definition at line 97 of file itkVectorDataContainer.h.

◆ VectorType

template<typename TElementIdentifier , typename TElement >
typedef std::vector< Element > itk::VectorDataContainer< TElementIdentifier, TElement >::VectorType
private

Quick access to the STL vector type that was inherited.

Definition at line 95 of file itkVectorDataContainer.h.

Constructor & Destructor Documentation

◆ VectorDataContainer() [1/5]

template<typename TElementIdentifier , typename TElement >
itk::VectorDataContainer< TElementIdentifier, TElement >::VectorDataContainer ( )
inlineprotected

Provide pass-through constructors corresponding to all the STL vector constructors. These are for internal use only since this is also an Object which must be constructed through the "New()" routine.

Definition at line 105 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [2/5]

template<typename TElementIdentifier , typename TElement >
itk::VectorDataContainer< TElementIdentifier, TElement >::VectorDataContainer ( size_type  n)
inlineprotected

Definition at line 107 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [3/5]

template<typename TElementIdentifier , typename TElement >
itk::VectorDataContainer< TElementIdentifier, TElement >::VectorDataContainer ( size_type  n,
const Element x 
)
inlineprotected

Definition at line 109 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [4/5]

template<typename TElementIdentifier , typename TElement >
itk::VectorDataContainer< TElementIdentifier, TElement >::VectorDataContainer ( const Self r)
inlineprotected

Definition at line 111 of file itkVectorDataContainer.h.

◆ VectorDataContainer() [5/5]

template<typename TElementIdentifier , typename TElement >
template<typename InputIterator >
itk::VectorDataContainer< TElementIdentifier, TElement >::VectorDataContainer ( InputIterator  first,
InputIterator  last 
)
inlineprotected

Definition at line 114 of file itkVectorDataContainer.h.

Member Function Documentation

◆ Begin() [1/2]

template<typename TElementIdentifier , typename TElement >
Iterator itk::VectorDataContainer< TElementIdentifier, TElement >::Begin ( void  )

Get a begin iterator for the vector.

◆ Begin() [2/2]

template<typename TElementIdentifier , typename TElement >
ConstIterator itk::VectorDataContainer< TElementIdentifier, TElement >::Begin ( void  ) const

Get a begin const iterator for the vector.

◆ CastToSTLConstContainer()

template<typename TElementIdentifier , typename TElement >
const STLContainerType & itk::VectorDataContainer< TElementIdentifier, TElement >::CastToSTLConstContainer ( ) const
inline

Cast the container to a const STL container type

Definition at line 140 of file itkVectorDataContainer.h.

◆ CastToSTLContainer()

template<typename TElementIdentifier , typename TElement >
STLContainerType & itk::VectorDataContainer< TElementIdentifier, TElement >::CastToSTLContainer ( )
inline

Cast the container to a STL container type

Definition at line 133 of file itkVectorDataContainer.h.

◆ CreateElementAt()

template<typename TElementIdentifier , typename TElement >
Element & itk::VectorDataContainer< TElementIdentifier, TElement >::CreateElementAt ( ElementIdentifier  )

Get a reference to the element at the given index. If the element location does not exist, it will be created with a default element value.

It is assumed that the value of the element is modified through the reference.

◆ CreateIndex()

template<typename TElementIdentifier , typename TElement >
void itk::VectorDataContainer< TElementIdentifier, TElement >::CreateIndex ( ElementIdentifier  )

Make sure that the index range of the vector is large enough to allow the given index, expanding it if necessary. The index will contain the default element regardless of whether expansion occurred.

◆ DeleteIndex()

template<typename TElementIdentifier , typename TElement >
void itk::VectorDataContainer< TElementIdentifier, TElement >::DeleteIndex ( ElementIdentifier  )

Delete the element defined by the index identifier. In practice, it doesn't make sense to delete a vector index. Instead, this method just overwrite the index with the default element.

◆ ElementAt() [1/2]

template<typename TElementIdentifier , typename TElement >
Element & itk::VectorDataContainer< TElementIdentifier, TElement >::ElementAt ( ElementIdentifier  )

Get a reference to the element at the given index. It is assumed that the index exists, and it will not automatically be created.

It is assumed that the value of the element is modified through the reference.

◆ ElementAt() [2/2]

template<typename TElementIdentifier , typename TElement >
const Element & itk::VectorDataContainer< TElementIdentifier, TElement >::ElementAt ( ElementIdentifier  ) const

Get a reference to the element at the given index. It is assumed that the index exists, and it will not automatically be created.

◆ End() [1/2]

template<typename TElementIdentifier , typename TElement >
Iterator itk::VectorDataContainer< TElementIdentifier, TElement >::End ( void  )

Get an end iterator for the vector.

◆ End() [2/2]

template<typename TElementIdentifier , typename TElement >
ConstIterator itk::VectorDataContainer< TElementIdentifier, TElement >::End ( void  ) const

Get an end const iterator for the vector.

◆ GetClassName()

template<typename TElementIdentifier , typename TElement >
virtual const char * itk::VectorDataContainer< TElementIdentifier, TElement >::GetClassName ( ) const
virtual

Standard part of every itk Object.

◆ GetElement()

template<typename TElementIdentifier , typename TElement >
Element itk::VectorDataContainer< TElementIdentifier, TElement >::GetElement ( ElementIdentifier  ) const

Read the element from the given index. It is assumed that the index exists.

◆ GetElementIfIndexExists()

template<typename TElementIdentifier , typename TElement >
bool itk::VectorDataContainer< TElementIdentifier, TElement >::GetElementIfIndexExists ( ElementIdentifier  ,
Element  
) const

Check if the given index is in range of the vector. If it is not, return false. Otherwise, set the element through the pointer (if it isn't NULL), and return true.

◆ IndexExists()

template<typename TElementIdentifier , typename TElement >
bool itk::VectorDataContainer< TElementIdentifier, TElement >::IndexExists ( ElementIdentifier  ) const

Check if the index range of the vector is large enough to allow the given index without expansion.

◆ Initialize()

template<typename TElementIdentifier , typename TElement >
void itk::VectorDataContainer< TElementIdentifier, TElement >::Initialize ( void  )
override

Clear the elements. The final size will be zero.

◆ InsertElement()

template<typename TElementIdentifier , typename TElement >
void itk::VectorDataContainer< TElementIdentifier, TElement >::InsertElement ( ElementIdentifier  ,
Element   
)

Set the element value at the given index. If the element location does not exist, it will be created with a default element value.

◆ New()

template<typename TElementIdentifier , typename TElement >
static Pointer itk::VectorDataContainer< TElementIdentifier, TElement >::New ( )
static

Method for creation through the object factory.

◆ Reserve()

template<typename TElementIdentifier , typename TElement >
void itk::VectorDataContainer< TElementIdentifier, TElement >::Reserve ( ElementIdentifier  )

Tell the container to allocate enough memory to allow at least as many elements as the size given to be stored. In the generic case of ITK containers this is NOT guaranteed to actually allocate any memory, but it is useful if the implementation of the container allocates contiguous storage. In the particular implementation of this VectorDataContainer the call to this method actually allocates memory for the number of elements defined by ElementIdentifier.

◆ SetElement()

template<typename TElementIdentifier , typename TElement >
void itk::VectorDataContainer< TElementIdentifier, TElement >::SetElement ( ElementIdentifier  ,
Element   
)

Set the element value at the given index. It is assumed that the index exists.

◆ Size()

template<typename TElementIdentifier , typename TElement >
unsigned long itk::VectorDataContainer< TElementIdentifier, TElement >::Size ( void  ) const

Get the number of elements currently stored in the vector.

◆ Squeeze()

template<typename TElementIdentifier , typename TElement >
void itk::VectorDataContainer< TElementIdentifier, TElement >::Squeeze ( void  )

Tell the container to try to minimize its memory usage for storage of the current number of elements. This is NOT guaranteed to decrease memory usage. This method is included here mainly for providing a unified API with other containers in the toolkit.

Friends And Related Function Documentation

◆ ConstIterator

template<typename TElementIdentifier , typename TElement >
friend class ConstIterator
friend

Definition at line 148 of file itkVectorDataContainer.h.

◆ Iterator

template<typename TElementIdentifier , typename TElement >
friend class Iterator
friend

Friends to this class.

Definition at line 147 of file itkVectorDataContainer.h.



Generated on 1667476801 for elastix by doxygen 1.9.4 elastix logo